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
Ksju [112]
2 years ago
10

Edhesive assignment 7 calendar

Computers and Technology
1 answer:
ikadub [295]2 years ago
5 0

Answer:

def leap_year(y):

 if y % 4 == 0:

     return 1

 else:

     return 0

def number_of_days(m,y):

 if m == 2:

     return 28 + leap_year(y)

 elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:

     return 31

 elif m == 4 or m == 6 or m == 9 or m == 11:

     return 30

def days(m,d):

 if m == 1:

     return 0 + d

 if m == 2:

     return 31 + d

 if m == 3:

     return 59 + d

 if m == 4:

     return 90 + d

 if m == 5:

     return 120 + d

 if m == 6:

     return 151 + d

 if m == 7:

     return 181 + d

 if m == 8:

     return 212 + d

 if m == 9:

     return 243 + d

 if m == 10:

     return 273 + d

 if m == 11:

     return 304 + d

 if m == 12:

     return 334 + d

def days_left(d,m,y):

 if days(m,d) <= 60:

     return 365 - days(m,d) + leap_year(y)

 else:

     return 365 - days(m,d)

print("Please enter a date")

day=int(input("Day: "))

month=int(input("Month: "))

year=int(input("Year: "))

choice=int(input("Menu:\n1) Calculate the number of days in the given month.\n2) Calculate the number of days left in the given year.\n"))

if choice == 1:

 print(number_of_days(month, year))

if choice == 2:

 print(days_left(day,month,year))

Explanation:

Hoped this helped

You might be interested in
Annie is a nutritionist. She is conducting seminars about following a healthy diet in various offices. Annie adds a picture of f
Novosadov [1.4K]

I believe in this case you would be using Clip Art.

Smart Art is used on words to make graphics usually.

Graphs are not pictures

Shapes are completely different


8 0
2 years ago
Read 2 more answers
The primary function of a __________ is to translate the URL or web address a user enters in a web browser, into the correct cor
Mnenie [13.5K]
The primary function of a " Domain name server (DNS" is to translate the URL or web address a user enters in a web browser, into the correct corresponding IP address.
8 0
3 years ago
Fill in the blank with the correct response. Wanting to become a better archer is a what?
Oksi-84 [34.3K]
Is a better archer shooter
5 0
3 years ago
the_____ tool is used to change the select text to capital letters or small letters (change case /grow font)​
solong [7]

Answer:

on word you can use shortcut "Shift+f3" to change uppercase lowercase and title case if that is what you are asking for

3 0
2 years ago
What was the name of the first computer (machine) language?
Angelina_Jolie [31]

In 1957, the first of the major languages appeared in the form of FORTRAN. Its name stands for FORmula TRANslating system. The language was designed at IBM for scientific computing. The components were very simple, and provided the programmer with low-level access to the computers innards.


8 0
3 years ago
Read 2 more answers
Other questions:
  • Whats a computer scientist.
    5·2 answers
  • Which layer defines an interface that applications can use to request network services, rather than referring directly to applic
    5·1 answer
  • Which option will enable Mina to apply several formats to the spreadsheet cells at the same time?
    5·1 answer
  • Which of the following is true of how packets are sent through the Internet?
    11·2 answers
  • When a block of steel at 90 degrees Celsius is placed in a bucket of water at 30 degrees Celsius, what happens?
    10·1 answer
  • hich type of denial of service (DoS) attack occurs when a name server receives malicious or misleading data that incorrectly map
    6·1 answer
  • What is the value of the variable result after these lines of code are executed?
    11·1 answer
  • Write a program that represents a popular kid’s toy that teaches them about different shapes and colors.
    14·1 answer
  • Which of the following is true of lossy and lossless compression techniques?
    13·1 answer
  • should variables that contain numbers always be declared as integer or floating-point data types? why or why not? name potential
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!