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
Define a public class named Sample with two instance variables: an int called count and a String called name. Provide a complete
Firlakuza [10]

Answer:

The code to this question can be given as:

class Sample  //define class Sample.

{  

   //define private member.

 private int count;            

 private String name;

 Sample(int count, String name)           //define parameterized constructor.  

 {

   this.count = count;               //holding values.

   this.name = name;

 }

 public int getCount()                   //define function with returntype.

 {

   return count;

 }

 public String getName()         //define function with returntype.

 {

   return name;

 }

 public void setCount(int count)       //define function with no returntype.

 {

   this.count = count;

 }

public void setName(String name)         //define function with no returntype.

 {

   this.name = name;

 }

}

Explanation:

In the above code firstly we define the class that is Sample. In this class, we define two variable that is not public. Then we define the constructor. This code we parameterized constructor because it takes the values as a parameter. To assign the value in the constructor we use this keyword.  Then we used the get and set method. when we use get method because it returns a value (getcount and getname).  When we use the set method it does not return any value (setcount and setname).

7 0
3 years ago
The following image shows the number of orders Company A received in 2015-2020. A financial analyst wants to calculate the year-
abruzzese [7]

The step that the analyst take to apply the same formula to all adjacent years using the Macabacus’ Fast Fill Right shortcuts  is the use of the  Macabacus Excel Add-in.

<h3>What are the feature in the Formulas menu of the Macabacus Excel add-in?</h3>

The Macabacus Excel Add-in is known to be a formula auditing tools that aids  one to be able to know and correct any kinds of errors and other forms of inconsistencies in the financial models.

Note that it is one that tends to bring up the speed of the modeling process. The Excel add-in is a tool that aid the users to make some reliable links between the financial model and that of the PowerPoint or Word documents.

Hence, The step that the analyst take to apply the same formula to all adjacent years using the Macabacus’ Fast Fill Right shortcuts  is the use of the  Macabacus Excel Add-in.

Learn more about Macabacus from

brainly.com/question/1538272

#SPJ1

8 0
2 years ago
WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
padilas [110]

Answer:

BOI I got ricked rolled!

Explanation:

He done it!

5 0
3 years ago
Which of the following qualifies as a teamwork skill? A. Free associating B. Multitasking C. Listening D. Problem solving
NeX [460]

There are certain skills that are required to be a good team member or team leader. A main characteristic of the required skills would be those that can be used in interacting with other people, since that is a main feature when working in teams.

From the given options, only one skill would be most suitable to be used when dealing with other people, which is (C) listening.  

4 0
3 years ago
What are rules that we use on the internet called, and what are some of them?
dusya [7]
Like safety rules like what to do privacy, plagarizim, and  cyberbullying and what not. Just stuff like that.
5 0
3 years ago
Other questions:
  • Computer architecture:
    6·1 answer
  • Why do hard drives tend to slow down over time?
    11·2 answers
  • In this lab, you declare and initialize variables in a Java program. The program file named NewAge.java, calculates your age in
    14·1 answer
  • Python: initalize the variable first_name with the value from the user prompt "What is your first name? " initalize the variable
    9·1 answer
  • PHP can be run on Microsoft Windows IIS(Internet Information Server):
    5·1 answer
  • Use the drop-down menus to complete the statements about Outlook notes.
    8·1 answer
  • Which of the following activities would be best-suited for a thinking mind map?
    10·2 answers
  • Add and multiply
    10·1 answer
  • What menu and grouping commands is the "SORT" tool? ( please answering meeeee)
    9·1 answer
  • What should you implement to leverage power, cooling, and networking capabilities independent from other datacenters in a region
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!