定义变量并打印my_name=”刘德华”print(my_name)
‘’’’’整数运算‘’’’’
加法add=3+4print(‘3+4的值是{}’.format(add))
减法sub=10-8print(‘10-8的值是{}’.format(sub))
乘法multi=print(‘的值是{}’.format(multi))
除法div=10/2print(‘10/2的值是{}’.format(div))
取模delivery=7%3print(‘7%3的值是{}’.format(delivery))
取整除返回商的整数round_number=7//3print(‘7//3的值是{}’.format(round_number))
幂运算power=73print(‘73的值是{}’.format(power))
‘’’’’浮点数运算‘’’’’
加法add=0.2+0.1print(‘0.2+0.1={}’.format(add))
python3.6以上版本为了减少{},可以使用f’的方法