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
What is the usual price of smartphone apps?
natka813 [3]

0-20 dollars

that's the usual cost for apps

and for phone it's cost

RS 32,000 Nepali rupes

you can convert it by dividing it by 110

and you will get price in dollars

8 0
3 years ago
Read 2 more answers
A utility program that makes a copy of all files or selected files that are in the libraries is called ______
sleet_krkn [62]

Answer: File History

8 0
3 years ago
A palindrome number is a number that remains the same when its digits are reversed. Like 16461, for example, is a palindrome num
xxMikexx [17]

Answer:

Code is given below and output is attached as an image.

Explanation:

#include <iostream>

#include <fstream>

using namespace std;

bool isPalindrome(int n)

{

       // Find reverse of n

       int rev = 0;

       for (int i = n; i > 0; i /= 10)

               rev = rev * 10 + i % 10;

       // If n and rev are same,then n is a palindrome

       return (n == rev);

}

int main()

{

       int min = 1;        // Lower Bound

       int max = 200;      // Upper Bound

       ofstream myfile;

       myfile.open("palindrome.txt");

       for (int i = min + 1; i < max; i++)

               if (isPalindrome(i))

                       myfile << i << endl;

       myfile.close();

       return 0;

}

5 0
3 years ago
Write an efficient C++ function that takes any integer value i and returns 2^i ,as a long value. Your function should not multip
Ilya [14]

Answer:

long power(int i)

{

   return pow(2,i);

}

Explanation:

The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.

for ex:-

pow(3,2);

It means 3^2 and it will return 9.

4 0
3 years ago
The instant pivot button is displayed in the statistics and visualization tabs when a _______ search is run.
Arisa [49]

Answer:

<h2>The instant pivot button is displayed in the statistics and visualization tabs when a <u>non-transforming</u>  search is run. </h2>

Explanation:

<h3>Transforming Search:</h3>

It can be defined as a search in which transforming commands are used that involve, charts and stats to convert data of events that is gained by the search in to tables (statistical). These tables can further be used for the basis of visualizing data in the form of charts.

Non-Transforming Search:

The search that do no contains produce event lists that can be viewed in Events tab. while using non-transforming search, i we want to generate tables or charts we must follow the points below:

  • Click ob statistics and Visualization tab.
  • Select pivot to open the search.
  • All the visualizations can be generated in this editor.

<h2>i hope it will help you!</h2>
5 0
3 years ago
Other questions:
  • Where should you look to find contact information about a company? I. on the company website II. at your local library III. in t
    11·2 answers
  • How do you ask brainy a question without it not liking the question and saying it hurts their feelings?
    14·1 answer
  • Who all likes fortnite
    15·2 answers
  • Fill in the blanks. The ________________ donut chart shows the distribution across your website’s pages by the number of clicks
    14·1 answer
  • What’s the answer to this question?
    15·1 answer
  • (I made this up teehee) what anime is katski bakugo from
    15·2 answers
  • In PowerPoint online what can you add to your presentation from the insert tab
    8·2 answers
  • Since the rules cannot address all circumstances, the Code includes a conceptual framework approach for members to use to evalua
    8·1 answer
  • If a folder exists on an NTFS partition, which permission is needed by a user who needs to set security permissions on the folde
    11·1 answer
  • UPS or FedEx plays what role in the supply?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!