Sitelet https://github.com/Show-Me-the-Code/python/issues/573
Skip to content

Я сделал свою первую мини-игру "Угадайка" #573

Description

@artemkiselevit

import random
x = random.randint(1, 3)
number_guesses = 0
for i in range(3):
x1 = int(input())
if x1 == x:
number_guesses += 1
print("Вау, вы настоящий волшебник!")
else:
print("Увы, в этот раз не повезло!")
print("Количество отгадок:", number_guesses)
if number_guesses >= 2:
print("Вау, вы сегодня были в ударе!")
else:
print("Неплохой результат, но можно лучше!")

Activity

  1. brokendenim commented on Aug 26, 2026

    @brokendenim

    Since x = random.randint(1, 3) sits outside the for loop the same value gets compared against every input across the three iterations.

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