Skip to content

sahildkapare/python-begineer-projects

Repository files navigation

python-begineer-projects

📁 Collection of begineer Python projects

👋 Welcome to my repository of beginner Python projects! This collection is a showcase of my journey in learning and applying Python fundamentals. Each project is designed to help me practice core concepts, and I'll be adding more as I continue to grow my skills.

1- 🎲 Number Guessing Game

A simple Python CLI game where the computer randomly selects a number between 1 and 10, and the player has to guess it. The game provides hints ("too high"/"too low") until the correct number is guessed, a play again option is also provided.

🚀 How to Run

  1. Make sure you have Python installed on your computer
  2. Save the code as numbguess_game.py
  3. Open terminal/command prompt and navigate to the file location
  4. Run the program:

Sample Run (Screenshot + Text Example)

🖥️ Sample Run

Welcome to the Number Guessing Game! I'm thinking of a number between 1 and 10. Enter your guess: 7 Too low! Try again. Enter your guess: 10 Too high! Try again. Enter your guess: 9 🎉 Congratulations! You guessed the number 9 in 3 attempts.

Would you like to play again? (y/n): No Thanks for playing! Goodbye!

📷 Screenshot

IMG-20250925-WA0011.jpg

🧩 Concepts applied

  • Using Python's random module to generate random numbers
  • Implementing while loops for game logic
  • Handling user input validation with try-except blocks
  • Creating interactive console applications
  • Adding replay functionality to games
  • String methods like lower() for case-insensitive input handling

⚙️ Features

  • Input validation (only accepts numbers 1-10)
  • Error handling for invalid inputs
  • Case-insensitive play again option
  • Attempt counter
  • User-friendly feedback messages

2- 🏠 Rent Calculator Program

A simple Python console application that helps users split rent and shared expenses (like food and electricity) among roommates or flatmates. The program takes input for total rent, food expenses, electricity units used, and the number of people sharing the room/flat,then calculates how much each person should pay. It also includes an option to calculate again or exit for convenience.


🚀 How to Run

  1. Make sure Python is installed on your computer.

  2. Save the code as rent_calculator.py

  3. Open Terminal/Command Prompt and navigate to the file location.

  4. Run the program using the command:

python rent_calculator.py

  1. Follow the prompts on screen to enter rent, food cost, electricity details, and number of persons.

🖥️ Sample Run

Enter your hostel/flat rent = 8000
Enter the amount of food ordered = 1200
Enter the total electricity units spent = 90
Enter the charge per unit = 10
Enter the number of persons living in room/flat = 3

Each person will pay = ₹ 3100.0

Do you want to calculate again? (yes/no): no
Thank you for using the Rent Calculator! Goodbye 👋

📷 Screenshot

IMG-20251022-WA0002.jpg

🧩 Concepts Applied

  • String methods like .lower() and .startswith() for flexible input handling
  • While loops to enable repeated calculations until the user exits
  • Arithmetic operations to compute shared expenses
  • User input handling with input() and int() conversion
  • Basic error prevention by guiding user input format
  • Modular thinking for future expansion (e.g., adding income, savings, or CSV export)

⚙️ Features

  • Rent, food, and electricity cost calculator
  • Per-person cost split based on total expenses
  • Case-insensitive replay option using .startswith("y")
  • Clear and friendly output formatting with round() for currency precision
  • Looped interaction for multiple calculations in one session
  • Exit message with gratitude and emoji for user experience polish

About

Collection of begineer Python projects

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages