Tuesday, August 26, 2025

🐍MINI PROJECTS WITH PYTHON

Now that you have learned Python basics, it’s time to practice by building small, fun projects. These will help you solidify your skills and gain confidence.

1. Simple Calculator

Build a program that takes two numbers and an operator (+, -, *, /) as input and displays the result.


num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
op = input("Enter operator (+, -, *, /): ")

if op == "+":
    print(num1 + num2)
elif op == "-":
    print(num1 - num2)
elif op == "*":
    print(num1 * num2)
elif op == "/":
    print(num1 / num2)
else:
    print("Invalid operator")
    

2. Number Guessing Game

Let the computer pick a random number between 1 and 100. The user tries to guess it, and the program gives hints (“Too high” or “Too low”) until the correct number is guessed.

3. Contact Book

Create a simple program to store contacts with name and phone number. Allow adding, searching, and displaying contacts.

4. Student Marks Analyzer

Input marks for multiple students and calculate total, average, highest, and lowest scores. Display results neatly.

🖥️ Practice in Browser

No comments:

Post a Comment

🐍What is scikitlearn??