Back

Code Challenge: Birth Seasons

Difficulty  

divider

Objective

Ask the user for their birth month as a number, then tell them which season they were born in.

Skills to Practice

  • Prompting a user for input
  • Converting input to the correct data type
  • Writing boolean expressions with ranges
  • Branching with if / elif / else

Tasks

  • Create a new Python program named cc-birth-seasons.
  • Prompt for a birth month as a number from 1 to 12.
  • Display the matching message from the table below.
  • Watch Winter carefully — it is not one continuous range, so it needs or.
MonthMessage
1, 2, or 12You're a Winter baby!
3–5You're a Spring baby!
6–8You're a Summer baby!
9–11You're a Fall baby!

Sample Output

Sample Output
Enter your birth month (1-12): 12 [Enter]
You're a Winter baby!

Commence Challenge