3 odpowiedzi
+ 4
thanks man!!
+ 2
you can use
var=int(input("enter a number"))
to transform the input in an int
if you want to be sure that the user will enter a number i think you can use a try/except
0
the question is not clear.. do you want to check the datatype of a variable? it can be done by "type(variable name)" if you want to compare types of two variables it can be done as follows "type(variable 1)==type (variable 2)" you can change type of a variable like matte said..