0

[PYTHON] what instruction can i give to a condition, if i wanna know the type of a variable?

If i get a variable e.g: a = 2/3 And a condition eg: if a is a float: do like this. What kind of information can i give to the condition?

30th Sep 2020, 11:09 AM
Bonheur Massonama
3 Antworten
0
a=2/3 if type(a)==float: print("it's a floating number")
30th Sep 2020, 11:13 AM
Abhay
Abhay - avatar
0
Thank you for your answer, it worked
30th Sep 2020, 11:25 AM
Bonheur Massonama
0
👍
30th Sep 2020, 11:44 AM
Abhay
Abhay - avatar