Week 1 - Tutorial Questions
Week 1 - Tutorial Questions
Scenario:
You are creating a user registration form for a website. The form asks for the user's first
name, last name, and age. After collecting this information, the system should display a
welcome message using f-strings.
Question:
Write a Python program that:
Takes the user's first name, last name, and age as input.
Displays a welcome message in the format: "Welcome, [First Name] [Last Name]!
You are [Age] years old."
Scenario:
A teacher wants to collect the names of five students and store them in a list. After all the
names are entered, the program should display the list of students in alphabetical order
using an f-string.
Question:
Write a Python program that:
Scenario:
A shopping app collects product names and their prices from the user. If the user enters a
negative price, the program should display an error message and ask for the input again.
Finally, the app should display the products and their prices using f-strings.
Question:
Write a Python program that:
Scenario:
You are designing a system that keeps track of a user's favorite books. The user can enter
the names of three books, which are stored in a tuple. If the user enters the same name
twice, display a warning message. Otherwise, print the list of favorite books using an f-
string.
Question:
Write a Python program that:
Scenario:
A company wants to collect the email addresses of its employees to send out a newsletter.
The system should ensure that each email address is unique. If a duplicate is entered, it
should display a message and ignore the duplicate. Finally, it should display the list of
unique email addresses.
Question:
Write a Python program that: