Skip to content

[THIS IS SPAM] Treinando Phyton , fazendo jogo de advinhação basico #4142

Closed

Description

@AqyyA

import random

def exibir_ranking (ranking):
print("\n--- Ranking de Pontuação ---")
if not ranking:
print("Nenhum jogador registrado.")
else:
for i, pontos in enumerate(ranking[:5],1):
print(f"{i}º lugar: {pontos} tentativas")
print("-----------------------------")

def jogar():
ranking = []
while True :
numero_secreto = random.randint(1, 100)
tentativas = 0
acertou = False

    print ("-----------------------------")
    print("Bem-vindo ao jogo de adivinhação!")
    print("Tente adivinhar o número secreto entre 1 e 100.")
    print ("-----------------------------")
    while not acertou:
        try:
            chute = int(input("digite seu chute : "))
            tentativas += 1
            if chute < numero_secreto:
                print("Tente um número maior.")
            elif chute > numero_secreto:
                print("Tente um número menor.")
            else:
                acertou = True      
                print(f" Parabens Voce acertou o numero secreto em {tentativas} tentativas.")
                ranking.append(tentativas)
        except ValueError:
            print("digite um numero valido.") 

    exibir_ranking(ranking)
    jogar_novamente = input("Deseja jogar novamente? (s/n): ")          
    if jogar_novamente.lower() != 's':
        print("Obrigado por jogar! Até a próxima!")
        break

if name == "main": jogar()

Activity

  1. github-actions commented on May 2, 2026

    @github-actions
    Contributor

    Hello. Thanks for opening an issue on Exercism 🙂

    At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.

    This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!

    If you're interested in learning more about this auto-responder, please read this blog post.

  2. locked as spam and limited conversation to collaborators on May 3, 2026
  3. changed the title [-]Treinando Phyton , fazendo jogo de advinhação basico[/-] [+][THIS IS SPAM] Treinando Phyton , fazendo jogo de advinhação basico[/+] on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions