@valoro/

bisiesto_2

Python

https://altocodigo.blogspot.com/2018/08/anos-bisiestos-en-python.html

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.508061726833243","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJhbmRvbQpyYW5kb20uc2VlZCgpCng9cmFuZG9tLnJhbmRpbnQoMTYwMCwyNTAwKQpkZWYgYmlzaWVzdG8oeCk6CiAgaWYgeCU0PT0wOgogICAgaWYgeCUxMDA9PTA6CiAgICAgIGlmIHglNDAwPT0wOgogICAgICAgIHJldHVybiBUcnVlCiAgICAgIGVsc2U6CiAgICAgICAgcmV0dXJuIEZhbHNlCiAgICBlbHNlOgogICAgICByZXR1cm4gVHJ1ZQogIGVsc2U6CiAgICByZXR1cm4gRmFsc2UKaWYgYmlzaWVzdG8oeCk6CiAgcHJpbnQoeCwnZXMgdW4gYcOxbyBiaXNpZXN0by4nKQplbGlmIG5vdChiaXNpZXN0byh4KSk6CiAgcHJpbnQoeCwnbm8gZXMgdW4gYcOxbyBiaXNpZXN0bycp"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import random
random.seed()
x=random.randint(1600,2500)
def bisiesto(x):
  if x%4==0:
    if x%100==0:
      if x%400==0:
        return True
      else:
        return False
    else:
      return True
  else:
    return False
if bisiesto(x):
  print(x,'es un año bisiesto.')
elif not(bisiesto(x)):
  print(x,'no es un año bisiesto')