i'm trying make category select (by text interface) in python 3, , wondering how can compare if multiple strings not true, , print along lines of "that not valid choice"
input("what category choice?") if categorychoice != "category1", "category 2", "category 3": print("not valid choice")
i don't understand syntax having check if of category1, category2, category3, etc true/false
categorychoice = input("what category choice?") if categorychoice not in ("category1", "category 2", "category 3"): print("not valid choice")
by way, if you're using python 2, should really use raw_input
instead of input
.
Comments
Post a Comment