🐍 Python Script Mode Projects for Students – Simple & Fun Assignments
If you're just starting out with Python, learning through small projects is a great way to build your skills and confidence. Below are three beginner-level Python projects you can write and run using Script Mode.
These projects are ideal for:
-
Practice
-
School/college assignments
-
Building confidence with Python programming
📁 What You’ll Learn:
-
How to write a Python script in Script Mode
-
How to save, run, and test
.py
files -
Real examples with download links for
.py
files
🧮 1. Simple Calculator in Python
This script allows users to perform basic operations like addition, subtraction, multiplication, and division.
💡 Features:
-
Menu-based interface
-
Input from user
-
Error handling for division by zero
✅ Sample Code:
# calculator.py
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
if y == 0:
return "Cannot divide by zero"
return x / y
print("Select operation:")
print("1. Add\n2. Subtract\n3. Multiply\n4. Divide")
choice = input("Enter choice (1/2/3/4): ")
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
if choice == '1':
print("Result:", add(num1, num2))
elif choice == '2':
print("Result:", subtract(num1, num2))
elif choice == '3':
print("Result:", multiply(num1, num2))
elif choice == '4':
print("Result:", divide(num1, num2))
else:
print("Invalid input")
🧠 2. Quiz Game in Python
A fun multiple-choice quiz with score tracking.
✅ Sample Code:
# quiz_game.py
score = 0
print("Welcome to the Python Quiz!\n")
answer1 = input("Q1: What is the keyword to define a function in Python? \n(a) def\n(b) function\n(c) fun\nAnswer: ")
if answer1.lower() == "a" or answer1.lower() == "def":
score += 1
answer2 = input("Q2: What data type is used to store True or False? \n(a) int\n(b) bool\n(c) str\nAnswer: ")
if answer2.lower() == "b" or answer2.lower() == "bool":
score += 1
answer3 = input("Q3: What symbol is used for comments in Python? \n(a) //\n(b) <!-- -->\n(c) #\nAnswer: ")
if answer3.lower() == "c" or answer3.lower() == "#":
score += 1
print(f"\nYour final score is {score}/3")
🔍 3. Even or Odd Number Checker
A very basic utility to check if a number is even or odd.
✅ Sample Code:
# number_checker.py
number = int(input("Enter a number: "))
if number % 2 == 0:
print("The number is EVEN.")
else:
print("The number is ODD.")
📚 How to Use These Scripts (Script Mode Guide)
-
create and SAVE the scripts the files.
-
Open any file (e.g.,
calculator.py
) in a text editor or Python IDE. -
Save it if you make changes.
-
Run the script:
-
Using Terminal:
python calculator.py
-
Using IDLE:
F5
to run.
-
🎓 Final Tip for Students
These small Python projects help you:
-
Practice Script Mode usage
-
Understand input/output
-
Write if-else logic
-
Build confidence in Python basics
Once you're comfortable, try adding:
-
More math operations to the calculator
-
Timer or difficulty levels to the quiz
-
Prime number or palindrome checkers in the number tool
🧠 Click Next: to explore the list of 100 python projects for beginners, intermediate and Expert level!
No comments:
Post a Comment