Python If Else for Beginners: Make Your Code Decide | Part 3
Beyond School
0:00 / 0:00
Python If Else for Beginners: Make Your Code Decide | Part 3
2 просмотра · 1 час назад
Beyond School
25 подписчиков
2 просмотра · 1 час назад
Learn Python if else for beginners with simple pictures and real examples. In this lesson you'll compare values, write if / elif / else, and build a quiz scorer, a password check, a budget alert and a time-of-day greeting bot. Nothing to install: practice in Google Colab, right in your browser.
▶ Python Full Course playlist: • Python Full Course | Beyond School
⬅ Previous: Part 2, Variables • Python Variables for Beginners: Teach Pyth...
🧭 Start here, Part 0 (what you'll build + full syllabus): • Python Intro: What Is Python? What You Can...
Chapters:
0:00 What you'll build
0:40 Python if else in 3 pictures
1:27 Comparison operators: > < == !=
2:11 Your first if statement + Pause & Guess #1
3:26 Build: password check with else
4:49 Build: quiz scorer with elif + Pause & Guess #2
6:03 Budget alert, and / or + greeting bot
8:12 Practice challenge: weather tip
9:57 Recap & next part
What you'll learn:
• if / else in 3 pictures (light switch, traffic light, fork in the road)
• Comparison operators: > < >= <= == !=
• The colon + indentation rule
• else and elif: first True wins, so order matters
• Beginner mistakes: = vs ==, missing colon, IndentationError
• and / or: two questions at once
• Two ifs vs elif: why both lines print
• Two Pause & Guess quizzes + a weather-tip challenge
Practice code from this video:
score = 85
if score >= 90:
print("Great!")
elif score >= 50:
print("Good")
else:
print("Keep practicing")
password = input("Password? ")
if password == "tiger":
print("Welcome in!")
else:
print("Wrong password")
budget = 500
spent = 620
if spent > budget:
print(f"Over budget by {spent - budget}!")
Practice in Google Colab: https://colab.research.google.com (nothing to install)
💬 What should your program decide for YOU? Comment one idea.
Beyond School: Ready to learn in a fun way! Anyone can learn.
#Python #LearnPython #PythonIfElse