1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
8090 [49]
3 years ago
14

Date Time Manipulation Exploration If you start from Jan 1st, 1757, and repeatedly add 8 days, until you hit 1800, how many time

s will it be a Monday? # YOUR CODE HERE def calcDays (): my_date = date(1757, 1, 1) m = 0 while my_date.year != 1800 : my_date = my_date + timedelta(days = 8) if my_date.isoweekday () == 1: m += 1 return m Make a function Once you have answered this question, convert your code into a generalized function. This function, call it count_weekdays should take: start_date: a start date (a datetime object) add_days : a number of days to add (an int) • stop_year: a stop year (an int) • weekday : a day to count, represented in isoweekday format (an int) It should return the number of weekday is that occur from the start date, until stop year, when adding add_days days.
Computers and Technology
1 answer:
zimovet [89]3 years ago
4 0

Answer:

from datetime import datetime, date, timedelta

def count_weekdays(start_date, add_days, stop_year, weekday):

   my_date = start_date

   m = 0  

   while my_date.year != stop_year:  

       my_date = my_date + timedelta(days = add_days)

       if my_date.isoweekday() == weekday:

           m += 1

   return m

date_val = date(1757,1,1)

try:

   date_val = datetime.fromisoformat(input("Enter date in the format yyyy-mm-dd: "))

except ValueError:

   print("Wrong isoformat string")

print(count_weekdays(date_val, 8, 1800, 1))

Explanation:

The datetime package of the python programming language has several time modules like the date, datetime, pytz, timedelta, etc, used to manipulate date and time in documents. The function count_weekdays has four parameters and returns the number of a specified weekday in a period of time.

You might be interested in
FIND THE 6 ERRORS IN THIS RESUME 30 POINTS!!!!
babymother [125]
Answer:
________________________
The following is a list of "6 (six) errors" :
__________________________________
1)  The "city, state, and zip code" should be listed on a separate line, directly following the street address:
_______________________________________________________
   → Hartford, CT 06114
_______________________________________________________
2)  In "Objective" section:  The misspelled:  "challenging" should be changed to "challenging".
_______________________________________________________
3) In the "Objective" section:  The word:  "righting" should be changed to:
      "writing".
_______________________________________________________
4)  In the "Summary" section:  The misspelled: "addjust" should be changed to:   "adjust" .
________________________________________________________
5)  The misspelled "impppeccable" should be changed to "impeccable".
________________________________________________________
6)  Perhaps, "drive-thru" should be changed to: "drive-through" ;  but even more importantly— refer to:
________________________________________________________
"Managed all staff and ensured hi performance and efficiency" ;
          → The "hi" should be changed to "high".
___________________________________________________
These are some errors.  Glad to be of help!
___________________________________________________
6 0
3 years ago
Write multiple if statements. if caryear is 1969 or earlier, print "probably has few safety features." if 1970 or higher, print
aliina [53]
If( caryear >= 2000 ):
    print "probably has air bags.\n"
elif( caryear >= 1990 ):
    print "probably has anti-lock brakes.\n"
elif( caryear >= 1970 ):
    print "probably has seat belts.\n"
else:
    print "probably has few safety features.\n"

4 0
3 years ago
Design a circuit that will tell whether a given month has 30 days in it.
Ipatiy [6.2K]

The simplified equation is given as Y=A_3A0+A3A0. To draw the circuit diagram using a minimum number of gates we use this equation and the x^2 equation to form the truth table. This is further explained below.

<h3>What is a circuit?</h3>

Generally, a circuit is simply defined as a full circular channel via which electricity travels in electronics. A power flow, terminals, and a drain make up a basic circuit.

In conclusion, The circuit will need 4 inputs to produce 16 combinations in order to determine if the month contains 31 days. At 4 inputs, there are 12 inputs required. the

Hence,we use this information and the x^2 equation to form the truth  table

the Equation is given as

Y=A_3A0+A3A0

Read more about  circuit

brainly.com/question/27206933

#SPJ1

6 0
2 years ago
The customer's endpoint device on the wan is called the __________________.​
Lelu [443]
<span>The customer's endpoint device on the WAN is called the Data Terminal Equipment (DTA).
WAN 
is wide area network, referring to a network that extends over a large area. DTA is an end instrument which converts information into signals.</span>
3 0
3 years ago
How to upgrade brainly membership
rjkz [21]

Answer:

Go on account settings, go to subscription, and upgrade.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • A disadvantage of creating a website with tables, without CSS is
    15·2 answers
  • To execute a prepared SQL statement, you can use the _______ and execute methods of the PDOStatement object to set parameter val
    9·1 answer
  • Host to IP address lookup and its reverse lookup option are very important network services for any size network. It is also how
    14·1 answer
  • How does a content management system differ from a basic wysiwyg web authoring tool??
    11·1 answer
  • To communicate with an expansion card, one part of the ____ bus runs between RAM and the processor; the other part runs between
    13·1 answer
  • Signs of mastery include?
    10·1 answer
  • Define get_date() function.
    6·1 answer
  • Which of the following class definition defines a legal abstract class Group of answer choices public class Rectangle abstract {
    15·1 answer
  • imagine that you wanted to write a program that asks the user to enter in 5 grade values. the user may or may not enter valid gr
    12·1 answer
  • You defined a shoe data type and created an instance.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!