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
The World Wide Web Consortium enforced a stricter set of standards in a different version of Hypertext Markup Language (HTML) ca
Eva8 [605]

Answer:

Option B is the correct answer for the above question

Explanation:

XHTML is an advanced version of HTML language which is recommended by W3C. It set the standard in 26-JAN-2000 for the XHTML which belongs to the family of HTML. XHTML is made with the help of XML and also used like XML. It used to create more secure websites.

The Above question asked about the W3C recommendation but the above paragraph described that XHTML is a W3C recommendation. Hence Option B is the correct choice answer. while the other is not because--

  • Option A suggests HTML 4.01 which is the updated version of HTML only.
  • Option C suggests XML which is used to data transfer only.
  • Option D suggests about DHTML but XHTML is a W3C recommendation
5 0
3 years ago
Which major and minor keys have no sharps or flats apex?
9966 [12]
C major and A minor have no sharps or flats.
5 0
3 years ago
Read 2 more answers
On the line below, write the two places you can control tab settings.
nikklg [1K]

The two places you can control tab settings are the  ruler and in the dialog box.

<h3>What are setting tabs?</h3>

The Ctrl + Tab is one that is often referred to as Control Tab and C-tab or the Ctrl+Tab.

It is known to be a keyboard shortcut that is said to be most often used to chose between open tabs in a browser.

Note that the settings Tabs are said to be a kind of paragraph-formatting tool that is often used to align text.

Hence, The two places you can control tab settings are the  ruler and in the dialog box.

Learn more about control tab settings from

brainly.com/question/11509892

#SPJ1

See full question below

Where can’t you control tab settings? Check all the apply

On a ruler

In a dialog box

In the mini toolbar

In the paste special options

4 0
1 year ago
Which type of keyboard improves accuracy and reduces the strain on the wrists?
klasskru [66]
That would be an Ergonomic keyboard, due to the fact that it is laid out in such a way that doesn't harm your wrists
4 0
3 years ago
Read 2 more answers
In this exercise, your function will receive 2 parameters, the name of a text file, and a list of strings. The function will wri
diamong [38]

Answer:

# the function is defined

# it takes 2 arguments: filename and list of string

def solution(filename, listOfString):

   # the file is opened in write mode

   # so that we can write to it

   with open(filename, 'w') as file_object:

       # we loop through the entire list of string

       # this looping help us know what to write to the file

       for each_string in listOfString:

           # if the length of the string is less than 4

           # we write 'x' with a new line

           if len(each_string) < 4:

               file_object.write("x\n")

           # else if the length of the string is greater than equals 4

           # we write the fourth character

           # and also add new line

           else:

               file_object.write(each_string[3])

               file_object.write("\n")

Explanation:

The function is written in Python. It takes two argument; filename and list of string.

It opens the file in write mode and then loop through the list of string. During the loop, we know what to write to the file.

In the length of a string is less than 4; we write 'x' else we write the fourth character in the string. The fourth character has an index of 3 because string uses zero index counting like a string. Starting from zero; 0, 1, 2, 3, 4... the fourth character has an index of 3.

5 0
3 years ago
Other questions:
  • Which graphic design tool allows you to lay images on top of one another? A. Layers B. Selection C. Drawing D. Color
    10·2 answers
  • You can use ???? a to test tread wear on your tires
    14·2 answers
  • To hide the ribbon, ______ on any one of the tabs of the ribbon.
    10·1 answer
  • Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
    11·1 answer
  • How would improving the nutritional health of an entire community impact the overall physical, emotional, and financial health o
    14·1 answer
  • What does the third argument (3) refer to in the following formula: VLOOKUP(10005, A1:C6, 3, FALSE)
    6·1 answer
  • Define<br>output<br>devices<br>.<br>Give<br>any<br>three<br>examples<br>.<br>3.​
    8·2 answers
  • Robert's got a quick hand
    8·2 answers
  • Please help ASAP!
    15·1 answer
  • How to connect two routers wirelessly to extend range.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!