I am unsure how to add validation to my input, specifically a presence check, which looks like this:
team1.append(input("Please enter the name of a team member: "))
Normally with more traditional inputs, my validation would look like this:
exampleInput=input("enter input")
while exampleInput=="":
exampleInput=input("enter input")
But that doesn’t seem to work, as the validation does nothing if I try something like this:
team1.append(input("Please enter the name of a team member: "))
while team1.append(input)=="":
team1.append(input("Please enter the name of a team member: "))
I’m not sure how I could add any sort of validation to this. Any ideas?
>Solution :
Something like this?:
inp = input("Please enter the name of a team member: ")
if inp != "":
team1.append(inp)