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
Genrish500 [490]
3 years ago
12

python program A year with 366 days is called a leap year. Leap years are necessary to keep the calendar in sync with the sun, b

ecause the earth revolves around the sun once very 365.25 days. As a result, years that are divisible by 4, like 1996, are leap years. However, years that are divisible by 100, like 1900, are not leap years. But years that are divisible by 400, like 2000, are leap years. Write a program named leap_year.py that asks the user for a year and computes whether that year is a leap year
Computers and Technology
1 answer:
Liula [17]3 years ago
3 0

Answer:

In Python:

year = int(input("Year: "))

if (year % 4) == 0:

  if (year % 100) == 0:

      if (year % 400) == 0:

          print("Leap year")

      else:

          print("Not a leap year")

  else:

      print("Leap year")

else:

  print("Not a leap year")

Explanation:

This line prompts user for year

year = int(input("Year: "))

This condition checks if input year is divisible by 4

if (year % 4) == 0:

If yes, this condition checks if input year is divisible by 100

  if (year % 100) == 0:

If yes, this condition checks if input year is divisible by 400

      if (year % 400) == 0:

If divisible by 4, 100 and 400, then it is a leap year

          print("Leap year")

      else:

If divisible by 4 and 100 but not 400, then it is not a leap year

          print("Not a leap year")

  else:

If divisible by 4 but not 100, then it is a leap year

      print("Leap year")

else:

If it is not divisible by, then it is not a leap year

  print("Not a leap year")

You might be interested in
For BitTorrent, which of the following is true:
Bumek [7]

Answer:

d. All of the above

Explanation:

All the above mentioned statements are true about BitTorrent.

8 0
3 years ago
Which term describes a character used to separate items in a text file?
frosja888 [35]

Answer:

extension describes a character used to separate items in a text

6 0
3 years ago
Write a function named starCounter that takes three parameters:1. a dictionary named starDictionary. Each key in starDictionary
Rom4ik [11]

Explanation: ik what it is but its no coming to my head sorry!

7 0
4 years ago
You're working in a table that has three columns and five rows. Since the first row will be a header row, you want it to span al
Sidana [21]
Hey there! Hello!

In an instance of Microsoft Word 2016, you'll find that Merge Cells in the right-click option menu will do just what you're looking to. In Attachment 1, you'll find where the actual selection is, and in Attachment 2, you'll see what it did to the cells across the top, which were previously connected. I also added a different formatting to the table in the second attachment, the colors were not changed do to selecting Merge Cells. 

Hope this helps you out! Feel free to ask me any additional questions if you have any. :-)

5 0
3 years ago
To serve as a visual reminder that the structure or class name is not a variable, structure names and class names should _______
GrogVix [38]
<span>be clearly marked as distinct from variables. Instead, they should be marked or labeled otherwise, and an explicit indication that they are not variables should be provided both next to the structure and class names, and also on a separate visual material.</span>
7 0
4 years ago
Other questions:
  • Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
    9·1 answer
  • Under what category of programs and apps do screen savers and backup programs fall?
    10·1 answer
  • Discuss why it is common for XML to be used in interchanging data over the Internet. What are the advantages of using XML in dat
    7·1 answer
  • JAVA
    14·1 answer
  • Annie wants to create a polka-dot pattern. She wants the dots to be distributed evenly in her pattern. She has turned on the gri
    10·1 answer
  • Logo Game:name the 10 social media logos you see in the picture below​
    15·2 answers
  • Write a technical term for following statements
    15·1 answer
  • 3. Maria is in charge of consolidating the names of the participants of the two-day virtual
    13·1 answer
  • Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string. Fo
    13·1 answer
  • What are the 3 main colors for a computer screen?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!