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]
3 years ago
10

Edhesive assignment 7 calendar

Computers and Technology
1 answer:
ikadub [295]3 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
(50 POINTS)Look at the code in the example below, and then answer the question.
Artist 52 [7]
Yeah what that guy said tool tip
5 0
3 years ago
Read 2 more answers
Businesses that conduct telemarketing are required to access the Do-Not-Call Registry every _______ in order to maintain an upda
densk [106]

Businesses that conduct telemarketing are required to access the Do-Not-Call Registry every 31 days in order to maintain an updated database of people.

<h3>What telemarketing firms do?</h3>

The act of telemarketing is known to be the act talking to potential or existing customers through the use of a telephone.

Conclusively, Note that Telemarketing can help a business firm to promote or boast their products or services, make their customer database stronger, bring about a lot of leads and appointments and others.

Learn more about telemarketing from

brainly.com/question/25974538

6 0
3 years ago
4.2 code need help plz someone 15 points if u help
Korolek [52]

def func():  

 total = 0

 while True:

   pet = input("What pet do you have? ")

   if pet == "rock":

     return

   total += 1

   print("You have a {} with a total of {} pet(s)".format(pet, total))

func()

We wrapped our code in a function so that whenever the user enters rock, we can simply return and exit the function. If you have any other questions, I'll do my best to answer them.

8 0
3 years ago
When an organizatin needs a program to do a very specific job, it mayhire someone to write _____ software.​
Harman [31]
Code sofware your welcome
8 0
3 years ago
How do airbags prevent injury?
NARA [144]

honestly i think ur answer would be D because it keeps you from flying out of the window

8 0
4 years ago
Other questions:
  • A __________ is created by using a secure hash function to generate a hash value for a message and then encrypting the hash code
    6·1 answer
  • Justify the statement "The same job title can have different job roles and different qualification criteria in different organiz
    7·1 answer
  • ACL 1 has three statements, in the following order, with address and wildcard mask values as follows: 1.0.0.0 0.255.255.255, 1.1
    6·1 answer
  • Which function of InfoSec management encompasses security personnel as well as aspects of the SETA program?
    5·1 answer
  • Which line of code will print Python is cool! on the screen?
    9·2 answers
  • You're the network administrator for a company that has just expanded from one floor to two floors of a large building, and the
    13·1 answer
  • Scannable résumés are: a. Written by hand and then scanned b. Typed on a typewriter c. Created in a word-processing program d. R
    11·2 answers
  • 50 POINTS
    6·1 answer
  • Schuyler is making a list of the parts of a computer that are software. Which of the following will be on the list?
    13·2 answers
  • Explain the uses of computer in police department​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!