A school’s computer system automatically generates a username for every new student.
You have been asked to write a Python program that creates a username using the student’s personal details.
The program must:
Ask the user for the following:
First name
Last name
Year of birth
A list of their favourite subjects (at least 3 subjects)
Use string-handling techniques to create a username with the following rules:
Take the first three letters of the first name.
Take the last three letters of the last name.
Take the last two digits of the year of birth.
Add the first letter of the last subject in the list.
Combine these parts to create a username.
All letters should be lowercase.
Remove any spaces from the subjects list (e.g., "Computer Science" → "ComputerScience" for the first letter).
Display the generated username.
(Extension challenge):
If the first name or last name is shorter than 3 characters, use the whole name instead.
Ensure the username is at least 8 characters long by adding random digits if necessary.
Enter your first name: Amelia
Enter your last name: Thompson
Enter your year of birth: 2008
Enter your 3 favourite subjects:
Subject 1: Art
Subject 2: Mathematics
Subject 3: Computer Science
Generated username: ame son 08 c
(Which becomes: ameson08c)