vendredi 18 mars 2016

python program contradicting

This is my input

   if checkDigit == userChoice3[7]:
       print("Thats correct")
       print(userChoice3[7])
    else:
       print("Sorry thats worng,try agian")  
       print("the correct answer was ",checkDigit)
       print(userChoice3[7])

This is the output

Please Enter your 8 digit check number: 12345670
Sorry thats worng,try agian
the correct answer was  0
0
Please Enter your 8 digit check number: 

so basically userchoice3 is equal to the checkdigit even thouh the computer says it isnt? sorry if this is a dumb question.

Aucun commentaire:

Enregistrer un commentaire