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:

  1. Asks for:

    • The total bill amount

    • The service rating (good, average, poor)

    • The number of people splitting the bill

  2. Calculates the tip percentage based on service:

    • good → 20%

    • average → 15%

    • poor → 10%

  3. Calculates:

    • The total with tip

    • Each person’s share

  4. Displays it all neatly with f-strings.

Hints

  • Use input() for collecting data.

  • Convert numeric inputs with float() or int().

  • Use if/elif/else to 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

Enter total bill: 50 How was the service? (good/average/poor): good How many people to split the bill? 2 Service quality: good Tip: £10.0 Total (with tip): £60.0 Each person pays: £30.0

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

Popular posts from this blog

Math Behind Logic Gates

6502 - Part 2 Reset and Clock Circuit

Building a 6502 NOP Test