TGViewer
Python Projects & Free Books Python Projects & Free Books @pythonfreebootcamp · 40.7K subscribers
Post #1382 1.53K
Let’s dive into our first mini project using Python:

Project 1: Number Guessing Game 🎯

Goal: 
The computer randomly picks a number between 1 and 100.

The user has to guess it — and the program gives hints like “Too High” or “Too Low” until the user gets it right.

Code:
import random

number_to_guess = random.randint(1, 100)
guess = None
attempts = 0

print("Welcome to the Number Guessing Game!")
print("I'm thinking of a number between 1 and 100.")

while guess != number_to_guess:
    guess = int(input("Enter your guess: "))
    attempts += 1

    if guess < number_to_guess:
        print("Too low! Try again.")
    elif guess > number_to_guess:
        print("Too high! Try again.")
    else:
        print(f"Congratulations! You guessed it in {attempts} tries.")

Concepts used:

• random.randint() for generating numbers

• Taking user input using input() & converting input to integers

• Using while loops and if-else logic

React with ♥️ for the next project

Important Python Concepts: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L/1441

For all resources and cheat sheets, check out our Telegram channel 
👇👇 
https://t.me/pythonproz

Hope it helps :)
  • 👍 2
  • 👏 2
  • 🔥 1
More from @pythonfreebootcamp
  1. Oct 2, 2026Data Analytics A-Z
  2. Sep 25, 2026🎯 GigaChat 3.5 Reasoning: 5 Key Features 1️⃣ Advanced Reasoning: Explores multiple step-b…
  3. Sep 14, 2026Learn AI for Free in 2026👇 1/ Kaggle Learn: https://www.kaggle.com/learn 2/ Anthropic Lea…
  4. Aug 7, 2026Roadmap to become a data analyst 1. Foundation Skills: •Strengthen Mathematics: Focus on s…
  5. Jul 31, 2026🐍 Python Roadmap 1️⃣ Basics: 📝📜 Syntax, Variables, Data Types 2️⃣ Control Flow: 🔄🤖 If…
  6. Jul 24, 2026🔰 Comprehensions in python with example
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →