Files
PythonGames/Дом с привидениями.py
2017-02-05 16:38:26 +02:00

22 lines
731 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ghost Game
from random import randint
print('Дом с привидениями')
feeling_brave = True
score = 0
while feeling_brave:
ghost_door = randint(1, 3)
print('Впереди три двери...')
print('Привидение за одной из них.')
print('Какую ты откроешь?')
door = input('1, 2 или 3? ')
door_num = int(door)
if door_num == ghost_door:
print('ПРИВИДЕНИЕ!!!')
feeling_brave = False
else:
print('Привидения нет.')
print('Ты переходишь в следующую комнату')
score = score + 1
print('Убегай!')
print('Ты проиграл! Твой счёт', score)