a = 66
count = 1
while count <=3 :
b = int(input("猜测这个数字:"))
if b < a:
print("猜测的结果小了小了.")
if b > a:
print("猜测的结果大了大了.")
if b == a:
print("你猜对了.")
break
print("你猜了%d次了." % count)
count += 1
else:
print("你有点笨.")

解释: "%s" 是数字占位符,传的是数字, 通过count来传数字.
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄