Feb-18-2020, 10:54 AM
(This post was last modified: Feb-18-2020, 11:01 AM by MMOToaster.)
numbertable = ["1","2","3","4","5","6","7","8","9"]
fname= input("Your First name?")
lname = input("Your Last name?")
if " " in fname or lname:
print("No space!")
elif numbertable[0:8] in fname or lname:
print("No number!")Hey, so I wanted to do a login program in which the first and last of the user are being asked and then there is a check if in either of the variables is a space(since names can't have spaces) or a number(since names can't have numbers in them). The problem is that with inputs such as:
fname = 123
lname = 456
or
fname = Mike
lname = Bob
it still puts out: No space!
My assumption is that in line 4 there is a problem with the if condition, but I have no clue what I did wrong there.
Could anyone help me with this? Thank you in advance.
