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
How prevalent is licensing for software engineers in the United States
Liono4ka [1.6K]

Answer:

Software Engineering is now a profession that needs a license in the US, and in most of the states, the total being almost 40 out of all where you need the license. And there are various forms of requirements like certification programs and the degrees as well as professional ethics, professional associations and government licensing. It's certainly a licensing discipline now in Texas, out here in the US.

Explanation:

Software Engineering is now a profession that needs a license in the US, and in most of the states, the total being almost 40 out of all where you need the license. And there are various forms of requirements like certification programs and the degrees as well as professional ethics, professional associations and government licensing. It's certainly a licensing discipline now in Texas, out here in the US.

And most recent dates it has been given the definition, that both the Engineering and Computer Science are being involved, their principles, practices for the designing and the development of various software applications. Failure can be deadly, and this is the main reason why this step has been taken ACM, IEEE, APEGBC and the ICCP have been up with the professional code of ethics.

However, if you have a Degree or a certification, you need not worry. You are already licensed then.

5 0
3 years ago
Under what circumstances are composite primary keys appropriate?
guajiro [1.7K]
A composite primary key<span> is a set of several primary </span>keys<span> that, together, uniquely identifies each record.</span>
Primary keys are used as identifiers of composite entities. In this case each primary key combination is allowed only once in the *:* relationship.
Other case where primary keys are used is as identifiers of weak entities, where the weak entity has a strong identifying relationship with the parent entity. 
8 0
3 years ago
The chip that controls the radio frequency waves within a device
torisob [31]

Answer:

An RF module

Explanation:

I googled it lol

7 0
3 years ago
Recursion occurs when a function (calls itself/ calls another function/ calls a function from the python standard library)
lesantik [10]

Answer:

Recursion is calling of a function from within that same function

5 0
3 years ago
A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi
UkoKoshka [18]

Answer:

The program in Python is as follows:

qty = int(input("Quantity: "))

price = 100 * qty

if qty >1000:

    price = (100 - 0.10 * 100) * qty

print("Cost: "+str(price))

Explanation:

This prompts the user for the quantity

qty = int(input("Quantity: "))

This calculates the price or cost, without discount

price = 100 * qty

This checks if the quantity is greater than 1000

if qty >1000:

If yes, this calculates the price or cost, after discount

    price = (100 - 0.10 * 100) * qty

This prints the calculated cost

print("Cost: "+str(price))

4 0
3 years ago
Other questions:
  • A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output i
    15·2 answers
  • PLEASE HELP!<br> How do you "brainliest" an answer?
    13·2 answers
  • Which CSS attribute would change an element's font color to blue
    15·2 answers
  • PLEASE HELP
    5·1 answer
  • Security Definition updates for windows defender are performed through the ——— function in windows server 2016
    7·2 answers
  • What will the following code display?
    12·1 answer
  • Given positive integer n, write a for loop that outputs the even numbers from n down to 0. If n is odd, start with the next lowe
    8·1 answer
  • Can i eat chicken and you shut
    14·2 answers
  • Help me and i'll mark brainliest
    9·1 answer
  • After creating a webpage with html code, what do you need to do so that others can access it on the internet?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!