Python Programming Assignment – Lesson: Conditional Statements
📅 Submission Deadline: 16th May 2025
👉 Upload your Python file to GitHub and submit the link in the lesson's "About" section.
Assignment Objective:
This assignment helps you practice using if, elif, and else statements to make decisions in your
code — like checking age, grades, or even weather!
📘 Instructions:
1. Complete all the tasks below in one Python file.
2. Add comments to explain your code.
3. Save your file as conditionals_assignment.py.
4. Upload it to GitHub and submit the link in the lesson's About section.
✍️ Tasks:
✅ Task 1: Check Age
● Create a variable age.
● Use an if statement to check if age is 18 or older.
● If true, print "You are an adult."
✅ Task 2: Age Check with Else
● Expand Task 1 using else:
○ If age is less than 18, print "You are not an adult."
✅ Task 3: Grading System
● Create a variable marks.
● Use if, elif, and else to print grades:
○ marks >= 90 → "Grade: A"
○ marks >= 70 → "Grade: B"
○ marks >= 50 → "Grade: C"
○ Otherwise → "Fail"
✅ Task 4: Weather Advice
● Create a variable weather and set it to "rainy", "sunny", or "cloudy".
● Use conditionals to print:
○ "Take an umbrella" if rainy
○ "Wear sunglasses" if sunny
○ "It might rain later" if cloudy
✅ Task 5: Quiz – Feeling Hungry?
● Create a variable hungry = True or False.
● If hungry is True, print "Go eat something!"
● If not, print "Maybe have a snack later."
🏆 Bonus Fun Task: Mini Chatbot
Ask the user how they're feeling:
mood = input("How are you feeling today? ")
● If mood is "happy" → print "That's great to hear!"
● If "sad" → print "I hope your day gets better."
● If "bored" → print "Try reading a book or going for a walk."
● Otherwise → print "Thanks for sharing your mood!"
📤 Submission Steps:
1. Save your file as conditionals_assignment.py
2. Upload it to GitHub.
3. Submit your GitHub link in the About section of the lesson before 16th [Month] 2025.