(Apr-05-2017, 08:03 PM)buran Wrote: you are comparing string (the user input) with boolean (the result of isdigit and isalpha).
That would always evaluates to False and your else is executed.
flyTo = input("Where would you like to fly? ") if flyTo.isalpha(): print("Okay, we are going to {} ".format(flyTo)) elif any(c.isdigit() for c in flyTo): print("You accidentally added a number") else: print("??")however I would skip the elif altogether
oh, i was comparing a string to a boolean?
can you elaborate on, "any(c.isdigit() for c in flyTo):"
thanks a lot