Jogo do número Primo
from tkinter import Tk , Label , IntVar , Radiobutton , Button import random def is_prime (n): if n <= 1 : return False elif n <= 3 : return True elif n % 2 == 0 or n % 3 == 0 : return False i = 5 while i * i <= n: if n % i == 0 or n % (i + 2 ) == 0 : return False i += 6 return True def selecionar (): escolha1 = resposta1.get() if (escolha1 == 1 and is_prime(escolha_aleatoria)) \ or (escolha1 == 0 and not is_prime(escolha_aleatoria)): resultado_texto.config( text = "Parabéns! Você acertou!" ) else : resultado_texto.config( text = "Ops! Você errou!" ) def novo_jogo (): global escolha_aleatoria escolha_aleatoria = random.randint( 0 , 30 ) escolha_número.config( text =escolha_aleatoria) resultado_texto.config( text = "" ) root = Tk() root.geometry( "400x400" ) root.resizable( 0 , 0 ) root.config( bg = "#10...