Programming Exercises

Exercise 1: Daily Temperatures:

Write a program that allows the user to enter the daily temperatures for a week. Store these temperatures in a list, calculate the average temperature for the week, and identify the highest and lowest temperatures.

 

Exercise 2: Student Scores:

Create a program that prompts the user to input the scores of 10 students on a test. Store these scores in a list, calculate the average score, and display the highest and lowest scores along with the names of the students who achieved them.

 

Exercise 3: Expense Tracker:

Develop a program that asks the user to enter their daily expenses for a month (30 days) and stores them in a list. Calculate the total expenses for the month, the average daily expense, and identify the day with the highest and lowest expenses.

 

Exercise 4: Product Prices:

Write a program that allows the user to enter the prices of 15 different products. Store these prices in a list, then sort the list and display the prices in ascending order. Also, calculate and display the total and average price of the products.

 

Exercise 5: Temperature Conversion:

Create a program that accepts a list of temperatures in Fahrenheit from the user and converts each temperature to Celsius. Store the converted temperatures in a new list and display both the original and converted lists.

 

Exercise 6: Grocery List:

Write a program that lets the user create a grocery list by entering items one by one. Allow the user to remove items from the list, and display the final list sorted alphabetically.

 

Exercise 7: City Population:

Develop a program that prompts the user to enter the populations of 10 cities. Store these populations in a list, then find and display the city with the highest and lowest population, as well as the average population.

 

Exercise 8: Book Collection:

Create a program that allows the user to enter the titles of 20 books they own. Store these titles in a list, then let the user search for a specific title in the list and display whether or not it is in the collection.

 

Exercise 9: Monthly Savings:

Write a program that prompts the user to enter their savings for each month of the year into a list. Calculate and display the total savings for the year, the average monthly savings, and the months with the highest and lowest savings.

 

Exercise 10: Fitness Tracker:

Develop a program that lets the user input the number of steps they took each day for a month (30 days). Store these values in a list, then calculate the total steps for the month, the average daily steps, and identify the day with the highest and lowest step counts.

 

Exercise 11: Employee Records:

Write a program that prompts the user to enter the name, age, and salary of five employees. Store each employee's data in a tuple, and then store these tuples in a list. Display the details of all employees, and find and display the employee with the highest and lowest salary.

 

Exercise 12: Course Information:

Create a program that allows the user to enter information for three courses, including the course name, instructor's name, and number of students enrolled. Store each course's information in a tuple, then store these tuples in a list. Display the information for all courses and identify the course with the highest number of students.

 

Exercise 13: Geographical Coordinates:

Develop a program that lets the user input the latitude and longitude of five cities. Store each city's coordinates in a tuple, and then store these tuples in a list. Display the coordinates of all cities and determine the city located furthest north (highest latitude).

 

Exercise 14: Product Catalog:

Write a program that prompts the user to enter the name, price, and stock quantity of ten products. Store each product's information in a tuple, then store these tuples in a list. Display all products and identify the product with the highest price and the one with the lowest stock quantity.

 

Exercise 15: Student Records:

Create a program that asks the user to enter the name, grade, and student ID for five students. Store each student's information in a tuple, and then store these tuples in a list. Display the details of all students, and find and display the student with the highest grade and the one with the lowest grade.