import random """
#查看源代码日后爬虫用
import urllib.request # coding=utf-8 url = "http://www.baidu.com"
data = urllib.request.urlopen(url).read()
data = data.decode('UTF-8') print(data) # print练手
x = 5 / 2
y = 3 / 2 print('x为', x, '\n', 'y为', y)
print('x和y分别为%.1f,%.1f' % (x, y)) for z in range(1, 11):
print('{0:5d} {1:5d} {2:4d}'.format(z, z * z, z * z * z)) print("what? ?" + " water")
print(5 + 8)
"""
# if else语句练手 Help = '大了'
Help2 = '小了'
gmAnswer = 12450
key = random.randint(1, 10)
gmAnswer = key
life = 3 while life > 0:
userAnswer = int(input('随便给个整数')) # 直接将输入的str转换成int并赋值
if userAnswer < gmAnswer:
print(Help2)
elif userAnswer > gmAnswer:
print(Help)
else:
print('you win')
break
life -= 1