This repository is a collection of Python practice exercises designed to strengthen your programming concepts.
It covers basic input/output, loops, conditionals, string manipulation, lists, and functions, making it ideal for beginners and intermediate learners.
- Enter number from user and convert meter to centimeter.
- Write a program to calculate area of triangle.
- Write a program to enter a number from the user and check whether it is divisible by 7 or not.
- Write a program to enter nth number from the user and print sum of square of number using while loop.
- Print odd and even numbers series using loop (for/while loop).
- Accept number from user and check whether it is prime or not.
-
Accept string from user and reverse the string.
-
Write a program that accepts a sentence and calculates the number of upper case letters and lower case letters.
Example Input:
Hello world!
Output:
UPPER CASE 1 LOWER CASE 9
- Write a program to accept n integer numbers in List, calculate and display the sum of elements from the list.
- Sort the elements from the list in ascending order.
- Accept n integer elements in list and display all elements from the list using while loop.
- Write a program that calculates the squares of numbers ranging from one to 11 using a user-defined function.
- Write a program that can multiply all the numbers in a list using an inbuilt function (passing parameter to function).
- Create a function named
water_supply
that will calculate how many liters a given person would need to drink in their whole life.- Takes two arguments:
age
(life expectancy) andamount
(daily intake of water). - Formula:
age * 365 * amount
- Default values:
age=75
,amount=2
.
- Takes two arguments:
The purpose of this repository is to create a hands-on learning environment for Python learners. By solving these exercises, you will strengthen your problem-solving ability, logical thinking, and coding efficiency.
- Clone this repo:
git clone https://github.com/KaustubhSN12/Python-Practice-Exercises.git
- Open the exercises and try solving them one by one.
- Run and test solutions in your preferred Python environment (IDLE, Jupyter Notebook, PyCharm, VSCode).
- π R Programming Practicals
- π Power BI β Salary, Gender & Family Trends
- π₯οΈ Software Engineering Basics
Contributions are welcome! Feel free to fork the repo, add new exercises, or enhance existing ones and create a pull request.
This project is licensed under the MIT License β free to use and share with credit.
β¨ Star this repository if you find it useful and keep practicing Python!