Python program to prompt user to input firstname,lastname,cohort(2022),campus(durban , first,last name shouldn't contain digits | Sololearn: Learn to code for FREE!

0

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

Username Generator

8/13/2022 8:49:01 PM

Lerato Nyai

2 Answers

New Answer

+1

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")