Python Tutorial - SUPER SIMPLE STARTER GAME FOR PYTHON (Guessing Game)

Опубликовано: 22 Январь 2026
на канале: Cold Code
286
8

simple guessing game in python:

def ShowQuestion():
ans='wrong'
print('guess a number between 1 and 5')
xyz=input()
num=int(xyz)
if num5:
print('your number is too high')
if num5:
print('your number is too low')
if num==5:
ans='right'
print('great job!')
if ans=='right':
return
else:
ShowQuestion()

ShowQuestion()
print('you only get here if your right')