:::
猜數字

import random
stop = False
small ,big = 0 , 100
answer = random.randint(0,100)

while not stop:
        inp = int(input('請輸入一個數字:'))
        if inp == answer:
                print('恭喜你')
                stop = True
        elif inp < answer:
                small= inp+1
                print('再給大一點', small, '和', big)
        else:
                big = inp-1
                print('再給小一點', small, '和', big)
print('遊戲結束謝謝')


:::
http%3A%2F%2Fkang.phjh.hlc.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D7