- 1
Dear friends ... I am begineer in python .Regarding i have small doubt on this below code .I want to print number or string fro
a = (int,float,str(input("Enter your password:"))) if a == 33: print ("The new window will open") elif a == 33.33: print ("The new window will open") elif a == "": print ("The new window will open") else: print ("you enter the wrong password and try aain!")
3 odpowiedzi
+ 1
float()*
0
Here, 'a' contains the tuple with the int class, the float class and the input, so it always gives the wrong result. Use this instead:
a = int(input("Enter your password: "))
0
Calvin Thomas
This will fix it since the input is going to be only an integer but from what nandha kumar is trying, the input should be in multiple data types.
I'm curious, is it possible to do so? Is there a proper syntax to do just that?