print('hey, u') print('hey', ' u') x = 1 y = 2 z = 3 print(x, y, z) print('x = %d, y = %d, z = %d' %(x,y,z)) print('x = {}, y = {}, z = {}'.format(x,y,z)) print(f'x = {x}, y = {y}, z = {z}') print(x) print(y) print(z) print(x, end=' ') print(y, end=' ') print(z, end=' ')
x,y = eval(input('Enter two numbers: ')) print(f'x = {x}, y = {y}') x,y = y,x print(f'x = {x}, y = {y}')
print(chr(10000), end=" ") print(chr(0x025b), end=" ") print(chr(0x2708), end=" ") print(chr(0x00A5), end=" ") print(chr(0x266b))
from math import sqrt n = float(input('输入一个数:')) x = sqrt(n) print('%f的平方根是: %.2f' %(n, x)) print('{}的平方根是{}'.format(n, x)) print(f'{n}的平方根是: {x}')
from math import pi text = ''' 好奇心是人的天性。 理想情况下,学习新东西是让人愉快的事。 但学校里的学习似乎有点像苦役。 有时候,需要画一个大饼,每次吃点学点新鲜的,才会每天变得更好一点点。 ''' print(text) r = float(input('给学习画一个大饼,大饼要做的很大,半径要这么大: ')) circle = 2*pi*r print(f'绕起来,大饼的圆周有这么长, {circle}, 够不够探索宇宙...')