vendredi 11 mai 2018

hi, i was just testing my python code ,,i tried to check by my if statement ,,just please tell me,,,my code is ok or not ,,,,

i was just testing my python code ,,i tried to check by my if statement ,,just please tell me,,,my code is ok or not ,,,,

print "the sum of any number you will put here will be 0"

input = raw_input("please enter any numbers for addition " )

if input == int:

print "0"

elif input == str:

print "please enter integer ,not strings"

else:

print "wrong attempt"

it is always giving me else statement ,,does not matter whether i am entering an integer or a string ,,,help ,,,

Aucun commentaire:

Enregistrer un commentaire