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
In dt.py, you will implement a basic decision tree classifier for
cestrela7 [59]

Answer:

Please see the attached file for the complete answer.

Explanation:

Download pdf
4 0
3 years ago
Suppose you want to delete an existing file from within Word. What would you do? A. Click on the File button, choose Recent, ope
koban [17]
The asnwer would be A
7 0
4 years ago
What are the three fundamental principals of mnemonics??
olasank [31]
The three fundamental principles underlying the use of mnemonics are imagination, association and location
4 0
3 years ago
Read 2 more answers
Queries in Access can be used ______________
Alenkinab [10]
A query is an Access object used to view, analyze, or modify data. The query design determines the fields and records you see and the sort order.
6 0
3 years ago
Which of these statements best describes an application programming interface?
TiliK225 [7]
<span>It is a set of commands, provided by the manufacturer of an operating system, which allows programmers to create applications.</span>
5 0
3 years ago
Other questions:
  • Which of the following is an extension of the fill pattern Sunday,Tuesday?
    10·2 answers
  • While traveling in India, Sabina notes all of her daily expenses in rupees in her spreadsheet. At the end of the day, she wants
    5·2 answers
  • Which topology requires a central controller or hub?
    15·1 answer
  • What are some ways in which reading and writing have changed in our newly networked world
    10·1 answer
  • I need help making this table in html code I have some of chart done but idk where to go after the 6:30pm part
    13·1 answer
  • You can install several printers on your machine, but at least one must be the _______ printer.
    6·1 answer
  • Object Oriented Programming (OOP) allows us to handle complex code in an organized structure and break down the problem by model
    5·1 answer
  • What function should be entered into B7 to calculate the total budget
    15·2 answers
  • What type of IPv6 address should you use when you have multiple routers on a subnet and want hosts to use the nearest router for
    10·1 answer
  • What type of program would you use to create a personal budget?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!