repl.it
@cjkevin0912/

python-basic-hw08

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
number = 31
 
 select = int(input('請問你想跟我玩猜數字遊戲嗎?(選 1 要玩,選 0 結束)'))
if select == 1:
  select=int(input('考考你猜數字遊戲,請輸入一個數字'))
  if select == number:
    print('恭喜,你答對了!')
  elif select > number:
    print('答案比較小喔!')
  else:
    print('答案比較大喔!')
else:
  print('遊戲結束!')