09/04/2025
50 Days of Python: A Challenge a Day
The concept is simple: do one or two challenges a day for just 50 days.
đź’ˇ Why challenges?
Well, without hands-on practice, you won’t internalize Python’s syntax or logic. For example, you might understand a for loop in theory, but if you don’t use it to solve a real problem, you will not fully grasp its capabilities and limitations.
📍 Here is a challenge from the book:
A school has asked you to write a program that will calculate teachers' salaries. The program should ask the user to enter the teacher’s name, the number of periods taught in a month, and the rate per period. The monthly salary is calculated by multiplying the number of periods by the monthly rate. The current monthly rate per period is $20. If a teacher has more than 100 periods in a month, everything above 100 is overtime. Overtime is $25 per period. For example, if a teacher has taught 105 periods, their gross monthly salary should be $2,125. Write a function called "your_salary" that calculates a teacher’s gross salary. The function should return the teacher’s name, periods taught, and gross salary. Here is how you should format your output:
Teacher: John Kelly,
Periods: 105
Gross salary: 2,125
Can you solve it?
Whether you like it or not, the next 50 days are going to pass. After 50 days, you can still be where you are today, or you could be 50 times better.
📍 The choice is yours.