Dear friends ... I am begineer in python .Regarding i have small doubt on this below code .I want to print number or string fro | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 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!")

10th May 2021, 6:47 AM
Nandha kumar
3 ответов
+ 1
float()*
10th May 2021, 7:02 AM
Calvin Thomas
Calvin Thomas - avatar
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: "))
10th May 2021, 7:01 AM
Calvin Thomas
Calvin Thomas - avatar
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?
10th May 2021, 7:23 AM
RRINN
RRINN - avatar