+ 1
why this happens in term of understanding the code this should be right isn't it ?
a=1379 if a==2758: print("no this data you have provided is worng !") elif a==(input(" ")): print("yeh procede ahead > ")
4 Antworten
+ 4
1. Put input to top
2. Change a from int to str
3. Switch if clause from == to !=
4. Change elif to else:
Voila!
+ 8
If you are thinking of comparing an input to a variable, it has to be queried before the comparison, not after.
Also, the types have to be the same - so either make the variable string or make the input integer.
+ 8
a=1379 # I assume this is the password
i = int(input("Enter password: "))
if a!=i:
# if password is wrong
print("no this data you have provided is worng !")
else: # if password is right
print("yeh procede ahead > ")
0
can you please make this code correct what am trying to do that in that way