while循环猜数字,使用random.randint(0,100) 生成0-100内的随机数,
从键盘输入数字猜这个随机数,如果猜错了就一直猜下去,
并且提示猜大了或猜小了,如果猜对了就停止猜测。
"""
# n = random.randint(0,100)
# m = int(input("猜:"))
# while m!=n:
# if m>n:
# print("猜大了")
# else:
# print("猜小了")
# m = int(input("再猜:"))
# print("猜对了")
for i in range(4):
j = 0
while j<3-i:
print(" ",end='')
j+=1
# for j in range(3-i):
# print(" ",end='')
for k in range(2*i+1):
print("*",end='')
print()
i = 0
while i<3:
for j in range(i+1):
print(" ",end='')
for k in range(5-2*i):
print("*",end='')
print()
i+=1