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
What is mean by computer ?where it is used?​
dem82 [27]

Answer:

computer is a set consisting of hardware and software that perform specific set of instructions

Explanation:

thy are used in hospitals, institute,hotels

4 0
3 years ago
Write a program that generates 100 random numbers and keeps a count of how many of those random numbers are even and how many of
Anvisha [2.4K]

Answer:

import random

numbers = []

even = 0

odd = 0

for i in range(100):

   numbers.append(random.randint(1, 200))

for i in range(100):

   if numbers[i] % 2 == 0:

       even += 1

   else:

       odd += 1

print("Even:", even)

print("Odd:", odd)

Explanation:

Gg ez.

8 0
3 years ago
PLEASE HELP ASAP
Phantasy [73]
Reliable sources state that Americans whom use social media have a better overall sense of community. Social media is beneficial to the overall mental stability of Americans when it comes to community
5 0
3 years ago
Suppose that an intermixed sequence of push and pop operations are performed on a LIFO stack. The pushes push the numbers 0 thro
nordsb [41]

Answer:

b) 01564 37928

e) 26 8 75 32 901

Explanation:

Pushes and pulls are the computer operations which enable the user to perform numerical tasks. The input commands are interpreted by the computer software and these tasks are converted into numeric values to generate output.

8 0
3 years ago
Naruto Uzumaki who likes naruto ??? who waches it??
nika2105 [10]

Answer:

me

Explanation:

naruto is the coolest dude

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following refers to a marketing metric that shows an event that occurs on a Web page met a predefined goal associat
    6·1 answer
  • The system should enable the staff of each academic department to examine the courses offered by their department, add and remov
    14·1 answer
  • What does computer means?
    9·2 answers
  • Q1 To remove filter
    15·2 answers
  • Sonja is writing a program to compare two numbers and print the larger number. Which of these should be used?
    6·1 answer
  • HURRY 50 POINTS A human is needed to create the algorithms that computers use.<br> True<br> False
    14·2 answers
  • Consider a k=8 block cipher.
    10·1 answer
  • Question 1 of 10
    8·1 answer
  • 1. The running configuration is also known as the _____________ (Select Two) a. Startup config b. Working configuration c. Curre
    14·1 answer
  • Let A and B be regular languages. Is the set of strings of odd length from A beginning with 0 concatenated with the set of strin
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!