can anyone help me with this? this is an python mcq

Viewed 36
  1. What gets printed ? Assuming python version 3.4.3 print(type(1/2)). a) <type ‘int’> b) <type ‘float’> c) <type ‘chr’> d) <type ‘str’>
3 Answers
>>> 1/2
0.5
>>> type(1/2)
<class 'float'>

1/2 is a float so b) is the correct answer.

b) <type ‘float’> That's because 1 / 2 = 0,5 0,5 is float number

Related