Python猜数字游戏

import random
answer=random.randint(1,100)
counter=0
while True:
	counter +=1
	number=int(input("请输入一个数:"))
	if number<answer:
		print("大一点")
	elif number>answer:
		print("小一点")
	else:
		print("你猜对了!恭喜。太聪明了!")
		break
print("你共猜了%d次" % counter)

if counter>7:
	print("你的智商不够呀!")