Exercise Set 5

Exercise 1 of 6

Write a line of code to convert a variable x to a string.

Your code

Exercise 2 of 6

Write a line of code to convert a variable x to an integer.

Your code

Exercise 3 of 6

Write a line of code to convert a variable x to a float.

Your code

Exercise 4 of 6

Fix the error in the code.
width = 15
length = input("Enter the length: ")
area = length * width
print(f"The area is {area}.")

Your code

Exercise 5 of 6

Fix the error in the code.
age = input("How old are you? ")
future_age = age + 20
print(f"In 20 years, you will be {future_age} years old.")

Your code

Exercise 6 of 6

Fix the error in the code.
result = "21" / 7
print(result)

Your code