0
Python program to prompt user to input firstname,lastname,cohort(2022),campus(durban , first,last name shouldn't contain digits
Username Generator
2 ответов
+ 1
Attempts?
0
from xml.dom import UserDataHandler
def user_details():
"""
Prompt user input
"""
while True:
first_name = input("insert your first name:\n")
if not first_name.isalpha():
print("invalid first name")
else:
return first_name
while True:
last_name = input("insert your last name:\n")
if not last_name.isalpha():
print("invalid last name")
else:
return last_name
while True:
cohort = input("insert your cohort:\n")
if cohort != 2022:
print(cohort)
else:
print("invalid cohort")