Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
RINONIN committed Apr 9, 2022
1 parent 2e3d8ce commit b9446ec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
File renamed without changes.
27 changes: 27 additions & 0 deletions py/guess_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# 该实例演示了数字猜谜游戏
number = 7
guess = -1
print("数字猜谜游戏!")
while guess != number:
guess = int(input("请输入你猜的数字:"))

if guess == number:
print("恭喜,你猜对了!")
elif guess < number:
print("猜的数字小了...")
elif guess > number:
print("猜的数字大了...")


num=int(input("输入一个数字:"))
if num%2==0:
if num%3==0:
print ("你输入的数字可以整除 2 和 3")
else:
print ("你输入的数字可以整除 2,但不能整除 3")
else:
if num%3==0:
print ("你输入的数字可以整除 3,但不能整除 2")
else:
print ("你输入的数字不能整除 2 和 3")

0 comments on commit b9446ec

Please sign in to comment.