0

Python program to prompt user to input firstname,lastname,cohort(2022),campus(durban , first,last name shouldn't contain digits

Username Generator

13th Aug 2022, 8:49 PM
Lerato Nyai
Lerato Nyai - avatar
2 Réponses
+ 1
Attempts?
14th Aug 2022, 3:37 AM
A͢J
A͢J - avatar
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")
14th Aug 2022, 6:27 AM
Lerato Nyai
Lerato Nyai - avatar