Python Forum
How to calculate a months' 1st, 4th, 7th day and also 1st again?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to calculate a months' 1st, 4th, 7th day and also 1st again?
#1
Hi everyone, I just started how to learn to code.
I am trying to write a program that should count the days an athlete decides to run once every three days for the whole year
(On the 1st, 4th, 7th ... day of each month).
At the beginning of a new month, he always runs on the 1st day of the month, even if three days have not passed since his last run.

for x in range(1,32,3):
    print(x)
This is the code I wrote for counting every three days but I couldn't find a solution for how to add the first days of months.
A little help with this would be perfect. Angel
Reply


Messages In This Thread
How to calculate a months' 1st, 4th, 7th day and also 1st again? - by cananb - Nov-11-2020, 08:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Illegal instruction? working code for months? korenron 4 12,765 Aug-05-2021, 09:57 AM
Last Post: korenron
  How to convert dates in odd format to months lokhtar 2 2,181 Apr-17-2021, 11:54 AM
Last Post: lokhtar
  How to groupby Months showing average order value - Pandas & matplotlib Rwood90 0 1,837 Oct-20-2020, 12:53 PM
Last Post: Rwood90
  'Age' categorical (years -months -days ) to numeric Smiling29 4 2,869 Oct-17-2019, 05:26 PM
Last Post: Smiling29

Forum Jump:

User Panel Messages

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