> import random > for x in range(0,1): > num = random.random() > print (num) > m=input('input pass:') > if m==num: > print('you entered correctly, proceed')
Your problem lines in the differences in between the types - your num variable is a float, whereas your m variable is a string. In order to compare them here, you need to either use the float() function or the str() function to convert one to a comparable data type, for example - if m==str(num): print('you entered correctly, proceed') Might I also note that your for loop does nothing except run once, and the 0 is unnecessary. HTH _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor