import time r = False while r == False : n = input ("Escolha um número de 1 a 10 : ") r = True try : i = int (n) if i >=1 and i <= 10 : for x in range (0,i) : if x%2 == 0 : print(" ", x+1, " <>", end='\r') else : print(" ", x+1, " ><", end='\r') time.sleep (1) print ("") r = False while r == False : print ("Verde") print ("Azul") print ("Preto") print ("Branco") c = input ("Escolha uma cor acima : ") r = True if c[0].upper() == "V" : if i%2 == 0 : print ("Legal") else : print ("Chato") elif c[0].upper() == "A" : if i%2 == 0 : print ("Inteligente") else : print ("Bonito") elif c[0].upper() == "P" : if i%2 == 0 : print ("Cabeça Oca") else : print ("Bobo") elif c[0].upper() == "B" : if i%2 == 0 : print ("Feio") else : print ("Burro") else : print (c, " não está na lista de cores.") r = False else : print ( n , " não é um número de 1 a 10") r = False except ValueError as ex: print ( n , " não é um número inteiro !") r = False
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question