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
djyliett [7]
2 years ago
9

My code get an input of 1900 and it should output not a leap year but it fails first line of code. It should output not a Leap a

ny number with 1500 not divisble by 4 with/out a remainder should output (not a leap year. )
input_year = int(input())

if input_year % 4 == 0: #fails on this step, 1900 should be false
print(input_year, "- is Leap Year")

elif input_year % 100 == 0:
print(input_year, "- leap year")

elif input_year % 400 ==0:
print(input_year, "is a leap year")

else:
print(input_year, "- not a leap year")
Computers and Technology
1 answer:
marshall27 [118]2 years ago
3 0

Answer:

Explanation:

The code does not fail on the first step since 1900 divided by 4 is actually 475 and has no remainder, meaning that it should return True. The code won't work because the if statements need to be nested in a different format. The correct algorithm would be the following, which can also be seen in the picture attached below that if we input 1900 it would output is not a leap year as it fails on the division by 400 which gives a remainder of 0.75

input_year = int(input())

if input_year % 4 == 0:

   if input_year % 100 == 0:

       if input_year % 400 == 0:

           print(input_year, "is a leap year")

       else:

           print(input_year, "- not a leap year")

   else:

       print(input_year, "is a leap year")

else:

   print(input_year, "- not a leap year")

You might be interested in
What are the main dimensions of information system and their components
nydimaria [60]

Answer:

The dimensions of information systems include organizations, management, and information technology. The key elements of an organization are its people, structure, business processes, politics, and culture. An organization coordinates work through a structured hierarchy and formal standard operating procedures.

7 0
3 years ago
______ is a disadvantage of EDI.
Artist 52 [7]

Answer:The number of standards

Explanation:Electronic data interchange (EDI)  is the mechanism through which data is interchanged in the system electronically.It is mostly found in the business field for exchanging of data.

As EDI helps in making message accurate by decreasing the length and also has beneficial features of maintaining the security and increasing productivity ,hence these factor are not considered as the disadvantage .

Too many standard present in the EDI make the working complex by limiting the processing in the small business as compared with large organization.

 

6 0
2 years ago
12.
melisa1 [442]
The correct answer is 1.6
7 0
2 years ago
How many bytes make up a megabyte? One hundred One thousand One million One billion
Phoenix [80]
One million is the answer.
4 0
3 years ago
Dashed lines that display on your slide when you are moving an object and that assist you with alignment are referred to as:
Umnica [9.8K]
Smart guides is the answer.
7 0
2 years ago
Read 2 more answers
Other questions:
  • If you’d like to have multiple italicized words in your document, how would you change the font of each of these words?
    7·2 answers
  • Which type of object is used to organize and store data in Microsoft access 2013
    5·2 answers
  • Due to the absorption and scattering of shorter wavelengths by interstellar dust, distant stars appear A) bluer. B) brighter. C)
    9·1 answer
  • Minimalism is a major movement in postmodern art. O True O False
    14·1 answer
  • What are the two main functions of user accounts in Active Directory? (Choose all that apply.) Allow users to access resources m
    7·2 answers
  • A bank uses a computer program during the night to tell if the alarm should ring. Sensors in the bank set the following Boolean
    5·1 answer
  • Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, s
    11·1 answer
  • You are developing a system to process lists of days of the week, represented as strings. Create a function is_weekend that cons
    12·1 answer
  • How was the addition of an improvement over early web design?
    11·1 answer
  • The ability to understand a person's needs or intentions in the workplace is demonstrating
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!