Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code help
#1
Hello I've just started using python and i would love some help with this program code, i don't really know how to make it and it would be great if someone could help, thanks.


Problem 1 — Days of the year The program will ask the user for a day, month and year and calculate how many days in the year have passed. For example, if the user enters 3rd February 2007, then that is the 34th day of the year. (31 days in January, plus 3 in February). The program should store the number of days in each month in an appropriate data structure. The number of days are as follows:

 January 31 days
 February 28 days
 March 31 days
 April 30 days
 May 31 days
 June 30 days
 July 31 days
 August 31 days
 September 30 days
 October 31 days
 November 30 days
 December 31 days

Note that leap years occur every four years, and during a leap year the month of February has 29 days instead of 28. The program should determine whether the year is a leap year or not. In the case of a leap year, an additional day must be added to the calculation if the input month is later than February. The program should make use of subroutines, and follow standard naming conventions.
Reply


Messages In This Thread
code help - by callanlove - Jun-13-2019, 09:41 AM
RE: code help - by perfringo - Jun-13-2019, 10:38 AM
RE: code help - by callanlove - Jun-13-2019, 10:45 AM
RE: code help - by perfringo - Jun-13-2019, 10:51 AM
RE: code help - by kotter - Jun-13-2019, 11:47 AM
RE: code help - by buran - Jun-13-2019, 12:32 PM
RE: code help - by jefsummers - Jun-13-2019, 01:26 PM
RE: code help - by perfringo - Jun-13-2019, 02:05 PM
RE: code help - by jefsummers - Jun-13-2019, 03:13 PM
RE: code help - by perfringo - Jun-13-2019, 04:15 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020