# More On Data Types Ans.

Home / U2: Math & Logic / More On Data Types Ans.

Print the type of all of the following variables. Try to guess what it is beforehand.

In [4]:
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'>

In [8]:
# one will need conversion!
answer = int(w) + x + y + z

11.0


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.

In [12]:
w = 10

x = "1"

y = "20"

z = 30.0

answer = w + int(x) + int(y) + z


61.0

print(type(answer))

<class 'float'>