Skip to main content
conteúdo editado
Fonte Link
 def how_many_days(month_number):

   """Returns the number of days in a month.
      WARNING: This function doesn't account for leap years!
   """

   days_in_month = [31,28,31,30,31,30,31,31,30,31,30,31]

   return days_in_month[month_number]          
print(how_many_days(87));

Assim está correto.

 def how_many_days(month_number):

   """Returns the number of days in a month.
      WARNING: This function doesn't account for leap years!
   """

   days_in_month = [31,28,31,30,31,30,31,31,30,31,30,31]

   return days_in_month[month_number]          
print(how_many_days(8));

Assim está correto.

 def how_many_days(month_number):

   """Returns the number of days in a month.
      WARNING: This function doesn't account for leap years!
   """

   days_in_month = [31,28,31,30,31,30,31,31,30,31,30,31]

   return days_in_month[month_number]          
print(how_many_days(7));

Assim está correto.

Fonte Link

 def how_many_days(month_number):

   """Returns the number of days in a month.
      WARNING: This function doesn't account for leap years!
   """

   days_in_month = [31,28,31,30,31,30,31,31,30,31,30,31]

   return days_in_month[month_number]          
print(how_many_days(8));

Assim está correto.