Python Beginner Programs
Beginner‑Friendly Loop
colors = ["\033[91m", "\033[92m", "\033[93m", "\033[94m", "\033[95m", "\033[96m"]
text = "PYTHON"
for i, letter in enumerate(text):
print(colors[i] + letter, end="")
print("\033[0m") # reset color
Beginner Menu Example
print("\033[96m=== Python Menu ===\033[0m")
print("\033[92m1. Start\033[0m")
print("\033[93m2. Help\033[0m")
print("\033[91m3. Exit\033[0m")
Beginner‑AI Keyword Finder
keywords = ["python", "ai", "code"]
text = input("Enter a sentence: ").lower()
found = [word for word in keywords if word in text]
print("AI found:", found)
print("Learning to scan text is step one!")
Beginner‑AI Mini Chatbot Reply
cprint("Mini AI Chatbot")
user = input("How are you today? ")
if "good" in user.lower():
reply = "I'm glad you're feeling good!"
elif "bad" in user.lower():
reply = "I'm sorry. Better days are coming."
else:
reply = "Thanks for sharing that."
print("AI:", reply)
print("Keep practicing Python!")
Beginner‑AI Word Predictor
words = {"hello": "world", "python": "rocks", "ai": "learning"}
print("Simple AI Word Predictor")
user = input("Type a word: ").lower()
rediction = words.get(user, "I don't know that word yet.")
print("AI predicts:", prediction)
print("Try another word!")
Greeting Program
name = input("\033[94mWhat is your name? \033[0m")
print("\033[92mHello,", name + "! Welcome to Python.\033[0m")
Emoji (Beginner‑Safe)
print("\033[95mLearning Python is fun! 🚀\033[0m")
print("\033[96mKeep going — you’ve got this! 💡\033[0m")
Simple Calculator (Beginner Input Example
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
print("Sum:", num1 + num2)
print("Difference:", num1 - num2)
print("Product:", num1 * num2)
print("Quotient:", num1 / num2)
Random Number Guessing Game
import random
secret = random.randint(1, 10)
guess = int(input("Guess a number between 1 and 10: "))
if guess == secret:
print("You got it!")
else:
print("Not quite. The number was", secret)
We participate in the Amazon Services LLC Associates Program and may earn fees by linking to Amazon and affiliated sites.
© 2026. All rights reserved.
