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
Jet001 [13]
4 years ago
13

Write a program that reads a month number (1 for January, 12 for December) and the day number and displays thedate afterxdays, e

ntered by the user. For simplicity, assume that each month has 30 days except for February thatalways counts for 28 days
Engineering
1 answer:
attashe74 [19]4 years ago
5 0

Answer:

Python datetime [52 exercises with solution]

[An editor is available at the bottom of the page to write and execute the scripts.]

1. Write a Python script to display the various Date Time formats - Go to the editor

a) Current date and time

b) Current year

c) Month of year

d) Week number of the year

e) Weekday of the week

f) Day of year

g) Day of the month

h) Day of week

Click me to see the solution

2. Write a Python program to determine whether a given year is a leap year. Go to the editor

Click me to see the solution

3. Write a Python program to convert a string to datetime. Go to the editor

Sample String : Jan 1 2014 2:43PM

Expected Output : 2014-07-01 14:43:00

Click me to see the solution

4. Write a Python program to get the current time in Python. Go to the editor

Sample Format :  13:19:49.078205

Click me to see the solution

5. Write a Python program to subtract five days from current date. Go to the editor

Sample Date :

Current Date : 2015-06-22

5 days before Current Date : 2015-06-17

Click me to see the solution

6. Write a Python program to convert unix timestamp string to readable date. Go to the editor

Sample Unix timestamp string : 1284105682

Expected Output : 2010-09-10 13:31:22

Click me to see the solution

7. Write a Python program to print yesterday, today, tomorrow. Go to the editor

Click me to see the solution

8. Write a Python program to convert the date to datetime (midnight of the date) in Python. Go to the editor

Sample Output : 2015-06-22 00:00:00

Click me to see the solution

9. Write a Python program to print next 5 days starting from today. Go to the editor

Click me to see the solution

10. Write a Python program to add 5 seconds with the current time. Go to the editor

Sample Data :

13:28:32.953088

13:28:37.953088

Click me to see the solution

11. Write a Python program to convert Year/Month/Day to Day of Year in Python. Go to the editor

Click me to see the solution

12. Write a Python program to get current time in milliseconds in Python Go to the editor

Click me to see the solution

13. Write a Python program to get week number. Go to the editor

Sample Date : 2015, 6, 16

Expected Output : 25

Click me to see the solution

14. Write a Python program to find the date of the first Monday of a given week. Go to the editor

Sample Year and week : 2015, 50

Expected Output : Mon Dec 14 00:00:00 2015

Click me to see the solution

15. Write a Python program to select all the Sundays of a specified year. Go to the editor

Click me to see the solution

16. Write a Python program to add year(s) with a given date and display the new date. Go to the editor

Sample Data : (addYears is the user defined function name)

print(addYears(datetime.date(2015,1,1), -1))

print(addYears(datetime.date(2015,1,1), 0))

print(addYears(datetime.date(2015,1,1), 2))

print(addYears(datetime.date(2000,2,29),1))

Expected Output :

2014-01-01

2015-01-01

2017-01-01

2001-03-01

Click me to see the solution

17. Write a Python program to drop microseconds from datetime. Go to the editor

Click me to see the solution

18. Write a Python program to get days between two dates. Go to the editor

Sample Dates : 2000,2,28, 2001,2,28

Expected Output : 366 days, 0:00:00

Click me to see the solution

19. Write a Python program to get the date of the last Tuesday. Go to the editor

Click me to see the solution

20. Write a Python program to test the third Tuesday of a month. Go to the editor

Click me to see the solution

21. Write a Python program to get the last day of a specified year and month. Go to the editor

Click me to see the solution

22. Write a Python program to get the number of days of a given month and year. Go to the editor

Click me to see the solution

23. Write a Python program to add a month with a specified date. Go to th

Explanation:

You might be interested in
Establishes general guidelines concerning licensing and vehicle
gavmur [86]

Answer:

A. National Highway Safety Act

Explanation:

The National Highway Safety Act establishes general guidelines concerning licensing, vehicle registration and inspection, and traffic laws for state regulations. The act was made in 1966 to reduce the amount of death on the highway as a result of increase in deaths by 30% between 1960 and 1965

National Traffic and Motor Vehicle Safety Act regulates vehicle manufacturers  by ensuring national safety standards and issuance recalls for defective vehicles

Uniform Traffic Control Devices Act  defines shapes, colors and locations for road signs, traffic signals, and road markings

5 0
3 years ago
Read 2 more answers
Technician A ay that acid rain doe the mot harm when it firt fall on a finih. Technician B ay that hard water potting i uually j
Tamiku [17]

Technician B is right say that hard water potting i usually jut a Surface problem that can be wahed off.

What do you mean by Hard water?

The amount of dissolved calcium and magnesium in the water determines its hardness. Calcium and magnesium are the main dissolved minerals in hard water. The last time you washed your hands, you might have actually felt the effects of hard water.

What do you mean by acid rain?

Any type of precipitation that contains acidic elements, such as sulfuric or nitric acid, that falls to the ground from the atmosphere in wet or dry forms is referred to as acid rain, also known as acid deposition. Rain, snow, fog, hail, and even acidic dust can fall under this category.

Some plants are sensitive to excessive moisture around their root zone, so it may be necessary to increase drainage when growing plants in pots. Additionally, standing water at the bottom of the pot can cause root rot.

Many university agriculture extension agencies have thoroughly debunked the old garden myth that adding rocks to the bottom of a pot will increase drainage.

Learn more about hard water click here:

brainly.com/question/28178305

#SPJ4

6 0
2 years ago
A steel bolt has a modulus of 207 GPa. It holds two rigid plates together at a high temperature under conditions where the creep
VikaD [51]

Answer:

14.36((14MPa) approximately

Explanation:

In this question, we are asked to calculate the stress tightened in a bolt to a stress of 69MPa.

Please check attachment for complete solution and step by step explanation

7 0
3 years ago
After a strong storm, a worker does not realize that a power transmission line has fallen on his car and is electrocuted while o
joja [24]

Answer and Explanation:

<u>The correct answer choice is Contacting Overhead Power Lines.</u>

This is because the powerlines are making contact (touching) his car, and the example isn't related to the other answer choices.

<u><em>#teamtrees #PAW (Plant And Water)</em></u>

3 0
3 years ago
Define the word vision statement​
Elena L [17]

Answer:

A vision statement describes what a company desires to achieve in the long-run, generally in a time frame of five to ten years, or sometimes even longer. It depicts a vision of what the company will look like in the future and sets a defined direction for the planning and execution of corporate-level strategies.

Explanation:

While companies should not be too ambitious in defining their long-term goals, it is critical to set a bigger and further target in a vision statement that communicates a company’s aspirations and motivates the audience. Below are the main elements of an effective vision statement:

-Forward-looking

-Motivating and inspirational

-Reflective of a company’s culture and core values

-Aimed at bringing benefits and improvements to the organization in the future

-Defines a company’s reason for existence and where it is heading

7 0
3 years ago
Other questions:
  • Air at 293k and 1atm flow over a flat plate at 5m/s. The plate is 5m wide and 6m long. (a) Determine the boundary layer thicknes
    14·1 answer
  • A steam turbine receives 8 kg/s of steam at 9 MPa, 650 C and 60 m/s (pressure, temperature and velocity). It discharges liquid-v
    7·1 answer
  • PLZ HURRY IM ON A TIMER
    6·1 answer
  • A cylindrical specimen of a titanium alloy having an elastic modulus of 107 GPa (15.5 × 106 psi) and an original diameter of 3.7
    14·1 answer
  • Write a function named is_float(s) that takes one argument that is a string. It returns True if string s represents a floating p
    6·1 answer
  • PLEASE ANSWER THIS DIAL CALIPER
    9·1 answer
  • 1) What output force (Fout) is produced if the lever arm length (rout) is 100 mm?
    13·2 answers
  • Which design activity is part of the design for manufacturability (DFM) methodology?
    10·1 answer
  • (a) calculate the moment at point "c", where point "c" is the square 3'' below the centroid
    13·1 answer
  • A liquid jet vj of diameter dj strikes a fixed cone and deflects back as a conical sheet at the same velocity. find the cone ang
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!