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
If you have a mix of 32-bit and 64-bit versions of windows, which architectures should you add a unattended installation file fo
umka21 [38]
64 bit the likely hood of it failing is much less
4 0
3 years ago
True or false: Quality score is an algorithm that scores each of your search ads on spelling and grammar.
andrew11 [14]
True or false: Quality score is an algorithm that scores each of your search ads on spelling and grammar.

Answer: False

I think sorry
4 0
1 year ago
Please help me with question 1!
BaLLatris [955]

12,831 is the answer but if you care for the work then here it is:

Since its a percent then its a certain percentage of the whole. Therefore you take 13,650 x 94% or 0.94 which will give you the answer of the amount of people that are familiar with it.

4 0
2 years ago
Read 2 more answers
For what purposes do students collect data? Check all that apply.
Bumek [7]

Answer:

sounds like all of the above

Explanation:

only one im not 100% sure on is to examine a question's reliablity

5 0
3 years ago
Read 2 more answers
When youre working with a word processing document and you press the Del key what happens
REY [17]
Typically, "Del" stands for "delete."
Most times, this key will do different things depending on the type of keyboard/computer you have. For example, on macs, the "delete" key is also the backspace key, so it will delete the last character you typed. However, on most pcs, the "delete" key will delete characters you typed that are in front of your cursor.
5 0
3 years ago
Other questions:
  • Python
    14·1 answer
  • Write a algorithm to attend birthday party​
    8·2 answers
  • Sharon must give an informative presentation to a group of teenagers about cultivating earthworms for use in home gardening. Whi
    11·2 answers
  • Assume you are given a boolean variable named isNegative and a 2-dimensional array of ints that has been created and assigned to
    8·1 answer
  • Suppose that a computer has three types of floating point operations: add, multiply, and divide. By performing optimizations to
    7·1 answer
  • ..............................................................................
    8·1 answer
  • Which of the following uses the proper syntax for creating an HTML comment?
    8·1 answer
  • The following code appears in a sort function. Will this function sort in increasing order (smallest first) or decreasing order
    5·1 answer
  • Andy works for a TV broadcasting company. He needs to set up a network covering a small area on the work floor. However, he noti
    13·1 answer
  • Compare and discuss between electromechanical and electronic era of computer​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!