Using OR in Python for a yes/no? -
i'm wanting have "y/n" in python, i've done, want user able input "y" or "y" , accepts both.
here's short if statement
if yn == "y": break
i'm wanting make this
if yn == "y" || "y": break
but "||" or operator in java. don't know or operator in python or if use this. help?
you're looking for
if yn in ("y", "y"):
or better:
if yn.lower() == 'y':
Comments
Post a Comment