if suit in ("Diamonds","Hearts","Clubs","Spades"): return "Accepted" else: return "Wrong input"
Just use in to verify ownership, if suit not in the tuple, your else clause will be executed.
membership operators
You can also change the logic with not in :
if suit not in ("Diamonds","Hearts","Clubs","Spades"): return "Wrong input" else: return "Accepted"
If you want to also check the value:
if suit in ("Diamonds","Hearts","Clubs","Spades") and value in ("Ace","king","Queen"....): return "Accepted" else: return "Wrong input"
Using set {"Diamonds","Hearts","Clubs","Spades"} is a more effective way to verify membership.
source share