Home>
November 16 from 15:00 to 16:00
Enter a 4-digit year to display whether it is a leap year
Create a gram. (Already done) Repeat input/judgment display until end is entered. A function is used to determine the leap year. How should the function part and end part be written?
I am a beginner and spend time, but I can't solve it.
year = input ("Please enter the year!")
year = int (year)
if year% 400 == 0:
print ("閏年")
elif year% 100 == 0:
print ("average")
elif year% 4 == 0:
print ("閏年")
else:
print ("average")
Code
-
Answer # 1
Related articles
- python - i want to change the value of the list using a function
- please explain the function using the python dictionary
- python - i want to fix garbled characters when using a function
- about batch change of file name using python
- parameter estimation using python's weighted least squares method (wls)
- parallel processing using python multiprocessingpool and multiprocessingqueue does not work well
- python - i want to create a function that finds the standard deviation sigma from x, y
- processing using the len function when an integer value is obtained from python standard input
- about external libraries when using multiple versions of python
- python - i want to separate by a specific word using the split function
- python - image recognition using cnn keras multiple inputs
- python - meaning of dlib face detection function arguments
- i don't understand the exercises using python trigonometric functions
- python - i'm using selenium the text sent by send_keys to the input tag disappears when the text is sent by send_key to the next
- python 3x - how to rename a folder created using jupyternotebook
- python 3x - processing to jump to the link destination using chrome driver in python
- python - error in image binarization using cv2adaptivethreshold function
- python - when using the cv2adaptivethreshold function in the binarization process of an image, an error occurs in medianblur and
- i want to adjust the execution result using the while statement in python as expected
- python - i want to put the image file path in a variable and open it using that variable
Trends
Is this the case? I don't think it's very good code.