S SmartDocs
シリーズ: python old python 8 行 · 更新日 2026-02-03

guessing.py

python_old/guessing.py

import random

print("Welcome to the Guessing Game!")
print("Try to guess the number I am thinking of between 1 and 100.")

number = random.randint(1, 100)  # generate random number
guess = -1  # initialize guess to an invalid value

関連記事