Print the type of all of the following variables. Try to guess what it is beforehand.
w = "1" x = 2.0 y = 3 z = x + y print(type(w)) print(type(x)) print(type(y)) print(type(z))
<class 'str'> <class 'float'> <class 'int'> <class 'float'>
# one will need conversion! answer = int(w) + x + y + z print(answer)
Now, add all of them together. If an error is produced, find and fix it.
Get this program to run:
w = 10
x = "1"
y = "20"
z = 30.0
answer = x + y + z
I did the following. It is normal to see some variation, as long as the answer is right.
w = 10 x = "1" y = "20" z = 30.0 answer = w + int(x) + int(y) + z print(answer)
What is the type of the answer?