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
What is encyclopedia. Com considered to be?
nydimaria [60]
An encyclopedia is reference material and a tertiary source. A tertiary source is a distillation and collection of primary and secondary sources.  A tertiary source is good place to get an overview of a subject. <span>Encyclopedias are also considered a scholarly source. The content is written by an academic for an academic audience.</span>
7 0
4 years ago
Convert octal number 2470 to decimal number
Vikki [24]
In decimal it is:
0*8^0 + 7*8^1 + 4*8^2 + 2*8^3 = 1336

Basically adding up the place values.
3 0
3 years ago
Read 2 more answers
The Fully Meets rating should be assigned when the spelling suggestion matches query intent
neonofarm [45]
Yes definitely absolutely
8 0
3 years ago
Do you think Apple will eventually meet their goal of becoming a replacement for a physical wallet
Dmitry_Shevchenko [17]
Yes they are the leading tech innovators of the 21st century and have already made massive strides in this direction
8 0
3 years ago
What is the function of ctrl+Q​
vlabodo [156]

Answer:

Ctrl+Q is used to remove a paragraph's formatting

Explanation:

Hope that's the answer you're looking for!

5 0
3 years ago
Other questions:
  • Write a complete program to do the following: The main program calls a method to read in (from an input file) a set of people's
    12·1 answer
  • Which statements describe molecules
    12·1 answer
  • To display measurements on the ruler while changing column widths, hold down the ________ key while dragging the marker.
    13·1 answer
  • What is an effective way to display calculations in a Word document
    7·2 answers
  • You would like to know how many cells contain data. Which function should you use?
    11·1 answer
  • Suppose a MATV/SMATV (Satellite Master Antenna Television) firm has to start it's operation in the metropolitan area of a countr
    12·1 answer
  • If you could make another device "smart" and have
    12·1 answer
  • The __________ operator increases the value of the variable by 1 after the original value is used in the expression in which the
    7·1 answer
  • Python program oranges and apples 3.4.6 copy and paste would be nice
    7·1 answer
  • Using an outline, how do you maintain your computer or cellphone​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!