Learn Python in 30 Days — Day 7: Review Day
Learn Python in 30 Days — Day 7: Review Day
Welcome to Day 7 of the Learn Python in 30 Days series!
You’ve made it through your first full week of python programming, that's a huge milestone.
Today isn’t about learning something new, it’s about tying everything together with a hands-on challenge.
The Day 7 Challenge: Tip Calculator
Let’s build something practical, a Tip Calculator.
It will pull together everything you’ve learned this week: input, variables, operators, logic, and clean output formatting.
Your Challenge
Write a program that:
-
Asks for:
-
The total bill amount
-
The service rating (
good,average,poor) -
The number of people splitting the bill
-
-
Calculates the tip percentage based on service:
-
good→ 20% -
average→ 15% -
poor→ 10%
-
-
Calculates:
-
The total with tip
-
Each person’s share
-
-
Displays it all neatly with
f-strings.
Hints
-
Use
input()for collecting data. -
Convert numeric inputs with
float()orint(). -
Use
if/elif/elseto handle service quality. -
Use logical chaining to validate input (e.g., if the bill is greater than 0 and people > 0).
-
Try nesting: first check input validity, then calculate.
Example Output
Bonus Challenge
If you finish, try expanding it:
-
Add an error message if someone types a negative number or zero people.
-
Format outputs to 2 decimal places using
round()or formatted strings. -
Let the user choose the currency symbol (£, $, €).
Wrap-Up
You can find the code the challenge on my GitHub here.
You can find the code for the bonus challenge on my GitHub here.
You’ve officially completed Week 1 of your Python journey!
You can now write small, logical programs that:
-
Interact with users
-
Handle numbers and text
-
Make decisions based on conditions
Next week, we move into Day 8 and will cover For loops.
Hope you have enjoyed this first week introduction to python programming.
Thanks
Matty


Comments
Post a Comment