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]
3 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]3 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 is the term used to describe data sets are so large and complex that they become difficult to process using traditional dat
slega [8]

Answer:

Big Data

Explanation:

Big Data refers to data sets that are large, comprising of different varieties (structured and unstructured data types) and which cannot be processed by the day to day database management systems and computer software otherwise referred to as traditional software and techniques.

The term Big does not necessarily refer to a particular size that a dataset must attain but describes the nature of the dataset and the fact that traditional database management systems cannot be used to process them take for example

The datasets of the entire product list from amazon

5 0
3 years ago
what is it called when someone uses software to run multiple operating systems on one computer at the same time? A.functional vi
Ronch [10]
The answer is C: Operating System Virtualization
8 0
3 years ago
Give two examples of desktop publishing software
soldier1979 [14.2K]
There are quite a lot of desktop publishing software as of today.
I'll give you the names of some of it.
- Adobe inDesign - one of the most popular
- Corel Draw
- Microsoft Publisher
- Serif
- Ultra Xml
And more.
There are actually a lot if you are just about to check in the internet.
7 0
3 years ago
_______________ is the term for the convergence of real-time and non-real-time communications services such as telephony, instan
Anna007 [38]

Answer:

Unified communications

Explanation:

Unified communications is the term for the convergence of real-time and non-real-time communications services such as telephony, instant messaging, video conferencing, speech recognition, voice mail, and email into a single interface.

8 0
3 years ago
A technician receives an invalid certificate error when visiting a website with port 443 enabled. Other computers on the same LA
amm1812

Answer:

Option (A) is the right answer.

Explanation:

According to the scenario, the user system is giving the error of invalid certificate while other users on the same network do not report any error, which means that there is some problem in a particular system.

Date and time can also be one of the main cause of this error because wrong date and time creates problem in surfing many websites by giving certificate error.

Hence the most appropriate answer is option (A).

While other option are wrong because of the following reasons:

  • UEFI boot mode is mainly used in booting the operating system and has no connection with network.
  • Logon time is also wrong because if the problem is with the login server, it can not give certificate error.
  • User access control is also not correct because it is used to control the access of the user.
7 0
3 years ago
Other questions:
  • The World Wide Web consists of interconnected computer networks throughout the world that everyone can use. True or False
    13·2 answers
  • Ben buys an Olympus E-PL2 from Sony which starts malfunctioning. When he opts for an exchange, the customer representative says
    11·1 answer
  • Write a for loop to verify that your function is correctly returning the expected output for the radius values between 0 and 11.
    14·1 answer
  • When a formula contains the address of a cell, it is called a(n) ________.
    15·1 answer
  • A character with the point size of 10 is about 10/72 of once inch in height
    8·1 answer
  • A database administrator (DBA) must have a clear understanding of the fundamental business of an organization, be proficient in
    12·1 answer
  • What major criteria must a product or process meet in order to be considered emerging technology?
    7·1 answer
  • 1. A _______ causes the computer program to behave in an incorrect or unexpected way.
    10·2 answers
  • The direction of a ratchet is reversed by _______________________.
    14·1 answer
  • What are three ways of verifying legitimate right of access to a computer system?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!