Python List Practice - Real World Assignments
Assignment 1: To-Do List Manager
Create a to-do list program. The user can choose from the following options repeatedly until they exit:
1. Add a task
2. View tasks
3. Remove a task by number
4. Exit
Sample Input/Output:
---------------------
1. Add a task
2. View tasks
3. Remove a task
4. Exit
Enter choice: 1
Enter task: Buy milk
1. Add a task
2. View tasks
3. Remove a task
4. Exit
Enter choice: 2
To-Do List:
1. Buy milk
Enter choice: 3
Enter task number to remove: 1
Task removed.
Assignment 2: Class Topper Identifier
Input names and marks of students (same length). After all entries:
Python List Practice - Real World Assignments
1. Display all names with marks
2. Identify and print the student(s) with the highest marks
Sample Input:
-------------
Enter number of students: 4
Name of student 1: Anil
Marks: 78
Name of student 2: Sita
Marks: 89
Name of student 3: Ram
Marks: 89
Name of student 4: Gita
Marks: 65
Expected Output:
----------------
Anil: 78
Sita: 89
Ram: 89
Gita: 65
Topper(s): Sita, Ram with 89 marks
Assignment 3: Shopping Basket Billing
Ask the user to input the name and price of items they bought. Then:
1. Show list of items with prices
2. Print total bill
3. Apply 10% discount if total > 1000
Python List Practice - Real World Assignments
Sample Input:
-------------
Enter number of items: 3
Item 1 name: Rice
Price: 500
Item 2 name: Oil
Price: 600
Item 3 name: Salt
Price: 50
Expected Output:
----------------
Rice - 500
Oil - 600
Salt - 50
Total before discount: 1150
Discount applied: 115
Final bill: 1035
Assignment 4: Bus Seat Booking System
There are 10 bus seats. Write a program that:
1. Displays seat availability
2. Allows user to book seats by seat number
3. Prevents double booking
Sample Output:
--------------
Seats:
1. Available
Python List Practice - Real World Assignments
2. Available
...
10. Available
Enter seat number to book (1-10): 3
Seat 3 booked!
Enter seat number to book: 3
Seat already booked.
Assignment 5: Reverse and Compare
Write a program that:
1. Takes a list of n numbers as input
2. Creates a reversed version of the list
3. Checks if it is a palindrome
Sample Input:
-------------
Enter number of elements: 5
Enter element 1: 1
Enter element 2: 2
Enter element 3: 3
Enter element 4: 2
Enter element 5: 1
Expected Output:
----------------
Original list: [1, 2, 3, 2, 1]
Reversed list: [1, 2, 3, 2, 1]
The list is a palindrome!