Python Forum
Calendar calculations
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calendar calculations
#3
If you are not allowed to use the datetime module for this assignment, you can use .split('-') to get the three parts of the date, and int() to turn those parts into integers. You'll need some conditionals to handle the last day of the month, and the .format() of strings to get the leading 0 on the output (details here).
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Calendar calculations - by frequency - Nov-10-2018, 08:24 PM
RE: Calendar calculations - by stullis - Nov-10-2018, 09:52 PM
RE: Calendar calculations - by ichabod801 - Nov-10-2018, 10:00 PM
RE: Calendar calculations - by frequency - Nov-11-2018, 12:16 AM
RE: Calendar calculations - by ichabod801 - Nov-11-2018, 12:27 AM
RE: Calendar calculations - by frequency - Nov-12-2018, 12:57 PM
RE: Calendar calculations - by stullis - Nov-12-2018, 03:54 PM
RE: Calendar calculations - by frequency - Nov-12-2018, 07:25 PM
RE: Calendar calculations - by nilamo - Nov-12-2018, 07:49 PM
RE: Calendar calculations - by frequency - Nov-12-2018, 08:32 PM
RE: Calendar calculations - by frequency - Nov-13-2018, 07:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Task calendar problem humanical 8 1,935 Sep-04-2023, 02:55 PM
Last Post: Pedroski55
  Calendar program louienyy 2 5,078 Mar-30-2020, 01:21 PM
Last Post: louienyy
Sad [Learning] Calendar without modules or list KoFu 5 4,973 Sep-09-2019, 03:25 PM
Last Post: DeaD_EyE
  Weird problem with reading from file and performing calculations pineapple999 1 3,083 Jul-25-2019, 01:30 AM
Last Post: ichabod801
  Convert number to a different base and make calculations frequency 12 5,830 Dec-17-2018, 05:21 PM
Last Post: frequency
  Prime numbers calculations frequency 3 3,058 Nov-27-2018, 07:07 PM
Last Post: micseydel
  dc circuit calculations michaelj 1 2,367 Nov-01-2017, 09:19 AM
Last Post: heiner55
  Calendar calcualtions deusvult 11 8,510 May-01-2017, 02:56 AM
Last Post: nilamo

Forum Jump:

User Panel Messages

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