I want to make a program that outputs something like:
Enter integer: 117
117 is lucky!
Enter integer: 1003
1003 is not lucky!
So, if the integer entered contains at least one 7 in it, it will output is lucky! And if it doesn't it will output the is not lucky!
Here's my code:
lucky=(raw_input("Enter a integer: ") for i in range(len(lucky)): if lucky[i] == "7": print str(lucky) + " " + "is lucky!" else: print str(lucky) + " " + "is not lucky."
I don't really know how to fix the code to output what I want it to, any help appreciated, thanks.