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
Arturiano [62]
3 years ago
14

In Python please:

Computers and Technology
1 answer:
sergey [27]3 years ago
6 0

Answer:

Following are the program in the Python Programming Language.

#set variable for input year by user

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

#set variable and initialize to 0

flag=0

#check condition that year is divisible by 4

if(y%4==0):

 #check that the year is divisible by 100

 if(y%100==0):

   #check that the year is divisible by 400

   if(y%400 ==0):

     #then initialized flag to 1

     flag=1

   else:

     #otherwise remain 0

     flag = 0

 else:

   flag = 1

else:

 flag = 0

#for break line

print()

#check that if flag is equal to 1

if(flag==1):

 print("29 days in February")

#otherwise else

else:

 print("28 days in February")

<u>Output</u>:

Enter year: 2020

29 days in February

Explanation:

<u>Following are the description of the program</u>:

  • Set variable 'y' in which we get integer value as year from the user.
  • Set variable 'flag' and initialize that variable to 0.
  • Then, we set if-else conditional statements to check that the variable 'y' is divisible by 4 then, we check that the variable 'y' is divisible by 100 and we also check that the following variable is divisible by 400.
  • Finally, we set if-else conditional statement to check that the variable 'flag' is equal to 1 then print about the leap year, otherwise it print about the non-leap year.
You might be interested in
My tv is hdtv but it does not show the name of the channels
prohojiy [21]
It might have checked you in wrong or you guys set it up wrong.
8 0
3 years ago
What is the current in a circuit that uses 120V and has 1200W of power?
Anastaziya [24]
Power law is P = I * V. With 1200 Watts of power, just divide by the 120 voltage to get 10 amperes of current.
5 0
3 years ago
A _____ is a collection of (potentially) thousands of computers that can respond to requests over a network
Rom4ik [11]

Answer:

server or supercomputer

Explanation:

5 0
2 years ago
Which of the following creates a photograph? Silver Shutters Light Mirrors
Keith_Richards [23]

Explanation:

the reaction between silver and light creates a photograph

8 0
3 years ago
Read 2 more answers
What is what is an example of conversational AI?
taurus [48]

Answer:

a computer answering a medical patient’s question and providing health advice

Explanation:

its the only one that 'talks' back to you

6 0
3 years ago
Other questions:
  • When a class declares an entire class as its friend, the friendship status is reciprocal. That is, each class's member functions
    14·1 answer
  • While there are many types of sediments, those that make up sedimentary rocks must be transported by running water.
    9·1 answer
  • What is statement used to communicate ones feelings in a nonconfrontational manner
    9·1 answer
  • "A file named numbers.txt contains an unknown number of lines, each consisting of a single integer. Write some code that compute
    9·1 answer
  • List four useful spreadsheet functions and explain what they do.
    11·1 answer
  • Jane, a marketing manager for the Grocery SuperStore retail chain, fired up a computer program that gave her ready access to inf
    6·1 answer
  • Which tab on the ribbon houses the sort functions?<br><br> Insert<br> Data<br> View<br> Home
    11·1 answer
  • The presentation ____ determines the formatting characteristics of fonts and colors.
    8·1 answer
  • 2. What is software conflict?<br>​
    11·1 answer
  • Consider a k=8 block cipher.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!