repl.it
@yulin1127/

python-basic-hw08-2

Python

No description

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