Issue detecting if an input contains both letters and numbers
Solution 1:
You need to check for each character:
def multi_test(analysis_input):
alpha_test = False
number_test = False
for char in analysis_input:
if char.isalpha():
alpha_test = True
if char.isnumeric():
number_test = True
if alpha_test and number_test:
print(analysis_input,'is multiple characters')
else:
print('not')
analysis_input = input('enter your string argument')
multi_test(analysis_input)
EDIT: a perhaps faster and nicer method is using regex
^(?=.*[a-zA-Z]+)(?=.*\d+).+
# pseudo code, i'm not sure if this code works but its something like this
return bool(re.match(analysis_input, ^(?=.*[a-zA-Z]+)(?=.*\d+).+))
Idea from https://stackoverflow.com/a/24656216/10875953