lundi 24 juin 2019

Python prints 0 for false but how in this code

We have this python code . But why it prints 0 for false even I have not mention that in the condition . Any explain ?

a=input("Enter value")
if(a=='true')or(a=='false'):
    print(int(a=='true'))
else:
    print('Error')

Aucun commentaire:

Enregistrer un commentaire