Skip to content

A collection of beginner-friendly Python exercises focusing on lists, loops, user inputs, and basic functions to build foundational programming skills.

NotificationsYou must be signed in to change notification settings

Sa3d-Ka/Python_Exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Python Exercises

This repository contains solutions to a variety of Python exercises aimed at improving basic programming skills. Below are the descriptions of the exercises included:


Exercise 1: Display Even Numbers

  • Create a list containing the numbers from 1 to 10.
  • Display only the even numbers from the list.

Exercise 2: Remove a Letter from a List

  • Create a list containing the letters of the alphabet.
  • Ask the user to enter a letter.
  • Remove the entered letter from the list and display the updated list.

Exercise 3: Swap First and Last Items

  • Create a list containing 5 items of your choice.
  • Swap the first item with the last item in the list.
  • Display the updated list.

Exercise 4: Managing Book Return Delays (Library)

  • Problem Statement:
    In a library, several students must return their books before a due date.

  • Tasks:

    1. Write a function that takes the expected return date and the actual return date as parameters.
    2. Calculate the number of days late for each student.
    3. Write a procedure that applies a fine of 5 units per day of delay and displays the total fine amount.
    4. Use a loop to process multiple students consecutively, as long as they wish.

Exercise 5: Grades Comparison

  • Problem Statement:
    Ahmad and Khalid have grades in n subjects, where the coefficient for each subject is 1.

  • Tasks:

    1. Read the grades of Ahmad and Khalid.
    2. Calculate their respective averages.
    3. Display the averages.
    4. Identify and display the name of the student with the better average.

How to Use

  1. Clone the repository to your local machine.
  2. Run the exercises using any Python interpreter of your choice.
  3. Follow the prompts in the console for interactive exercises.

Contributions

Feel free to contribute by improving existing solutions or adding more exercises!

About

A collection of beginner-friendly Python exercises focusing on lists, loops, user inputs, and basic functions to build foundational programming skills.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published