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

2.13 LAB: Branches: Leap Year

Computers and Technology
1 answer:
Neporo4naja [7]3 years ago
5 0

Answer:

The program in Python is as follows:

year = int(input("Enter a year: "))

print(year,end=" ")

if year % 4 == 0:

  if year % 100 == 0:

      if year % 400 == 0:           print("is a leap year")

      else:           print("is not a leap year")

  else:       print("is a leap year")

else:   print("is not a leap year")

Explanation:

This gets input for year

year = int(input("Enter a year: "))

This prints year, followed by a blank

print(year,end=" ")

If year is divisible by 4

if year % 4 == 0:

If yes, check if year is divisible by 100

  if year % 100 == 0:

If yes, check if year is divisible by 400; print leap year if true

      if year % 400 == 0:           print("is a leap year")

print not leap year if year is not divisible by 400

      else:           print("is not a leap year")

print leap year if year is not divisible by 100

  else:       print("is a leap year")

print leap year if year is not divisible by 4

else:   print("is not a leap year")

You might be interested in
The condition, ____, entered in the criteria row of a long text field in a query window would retrieve all records where the lon
skad [1K]
A query criterion<span> is an expression that Access compares to query field values to determine whether to include the record that contains each value</span><span>
The condition, *education, entered in the criteria row of a long text field in a query window would retrieve all records where the long text field had any mention of education.</span>
6 0
3 years ago
5
vova2212 [387]

Answer:

Document

Explanation:

Document because after you structure your document together the way you like you can add pictures.

3 0
4 years ago
Read 2 more answers
Which of these is NOT an example of a programming language?
777dan777 [17]
High level sorry if im wrong
7 0
3 years ago
Read 2 more answers
What is software? Why is it needed? ​
sesenic [268]

Computer software, also known simply as software, also known by overseas Vietnamese as software is a collection of data or commands that instruct the computer to tell the computer how to work.  This is in contrast to the physical hardware, from which the system is built and actually does the work.  Because it helps people perform functions that humans can't do or do for a very long time

8 0
3 years ago
Why won't my ads load brainly? Is anyone else having this problem? Brainly company or whoever you are that is running this websi
djverab [1.8K]

No I have not had that do that to me before It has always loaded my ads and sent me right back to the answer

7 0
3 years ago
Read 2 more answers
Other questions:
  • _____ provide the standards, syntax, statements, and instructions for writing computer software
    14·1 answer
  • How do you represent the decimal integer 50 in binary?
    14·1 answer
  • When doing career research online, you always want to make sure you are viewing a reliable source, what factors about the websit
    10·2 answers
  • If the speakers are not working on a laptop, what could be the problem besides the speakers?
    5·1 answer
  • Although implementations vary, reader–writer locks usually block additional readers if a lock is already held in read mode and a
    13·1 answer
  • How do motion sensors determine in simation
    13·1 answer
  • How does one skip videos on edgenuit
    7·1 answer
  • Potterheadler varmı burada​
    10·2 answers
  • what stage is the most inner part of the web architecture where data such as, customer names, address, account numbers, and cred
    11·1 answer
  • What is the complete path and filename of the file where ports and their associated protocols are defined
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!