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
Question 1
Alexxandr [17]

Explanation:

so, what do you think ?

I am sure you have used a computer or a smart phone yourself.

how many clicks or taps do you want to do before you you get what you were looking for ?

hmmmm ?

as few a possible, right ?

ideally, of course, this is one (1) click or tap.

7 0
2 years ago
A _____ is a device that helps capture action without losing focus. It stabilizes camera movement by reducing the impact of shak
lyudmila [28]

Answer:crane

Explanation:

4 0
2 years ago
20 points<br><br> In what ways is the human brain like a computer? In what ways is it different?
mojhsa [17]

Answer:

Alright imma explain below

Explanation:

It it’s similar because both give info. Also the reaction time on both are fast. They are different in some ways too. A computer runs on electricity but the brain doesn’t. A brain can actually think but a computer can not.

Hope this helps

8 0
3 years ago
Read 2 more answers
I need help with doing a debate for ela. The debate topic is "do you think we are to dependable on our laptops/cellphones. My te
Mama L [17]

Answer:

I think we are so this is hard lol

Explanation:

we are not too dependable

things that show this is library are still open, school sports teams still flourish(if we were too depending on them they wouldnt) they help us plan ways to interact in person if we were too dependent businesses would struggle more and only be online

this is hard if I can think of any others I'll come back I'm sorry if this isn't any help

7 0
3 years ago
Read 2 more answers
. What year did the USA host World Cup? Right answer 1994
Ksivusya [100]

Answer:

USA host World Cup in 1994 1994 FIFA World Cup

Explanation:

USA host World Cup in 1994 FIFA World Cup

it was the 15th edition of FIFA World Cup

and Brazil was won the tournament

Brazil beat Italy by 3–2 in  penalty shoot-out

it was play between 17 June to 17 July and 24 team play this World Cup

and there matches played = 52

and 9 cities host this game

United States of America was chosen as the host by FIFA on the 4 July, 1988

5 0
3 years ago
Other questions:
  • . Java is a high-level language.. true or false?
    5·1 answer
  • How to ask for a letter of recommendation via email?
    10·1 answer
  • Select all that apply.
    8·2 answers
  • Which type of chart is best for highlighting trends in data?
    15·2 answers
  • All mla text is double spaced. true false
    13·2 answers
  • Betty set up an account on a popular social networking website. she wants to know whether the privacy policy is effective for he
    14·1 answer
  • Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input
    12·1 answer
  • A customer wants to increase his storage capacity by 25gb
    7·1 answer
  • What are your strongest competencies? What will you do them? <br>❌NONSENSE ANSWER<br>​
    9·1 answer
  • If a person communicates indirectly and attaches little value to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!