TOPIC

5% wrong answer python 3

dhari0 asked 4 years ago

y = 0

while True:

try:
    if y != 0:
        print('')

    x = int(input())

    if x % 4 == 0 and x % 100 != 0 or x % 400 == 0 or x % 15 == 0:

        if x % 4 == 0 and x % 100 != 0 or x % 400 == 0:
            print('This is leap year.')

        if x % 15 == 0:
            print('This is huluculu festival year.')

        if x % 55 == 0:
            print('This is bulukulu festival year.')

    else:
        print('This is an ordinary year.')

    y = 1
except EOFError:
    break

Remember not post solutions. Your post may be reviewed by our moderators.

  • Guiheol replied 2 years ago

    Olá Dinesh Hari. . Acredito que para resolver este problema, basta inverter a ordem das linhas iniciais e acrescentar uma linha de código resetando a variável y = 0, conforme exemplifiquei abaixo: .

    try:
    
          x = int(input())
    
          if y != 0:
              print('')
    
          y = 0
  • dhari0 replied 4 years ago

    só pra avisar não eh por causa do tamanho de 1000 digítos