python中的+,-,/,*,%,//,于print函数的总和

python的print函数的用法(集合)

a=99
print(id(a))#id(a)函数是求取a的存储地址
print(a)#输出a所表示的值,即99
print('hello word')
print("hello word")
print(10)
print(str(10))
print('hello')
print('word')
print(' hello',
      ' word')
print('hello\nworld')#\n的作用是换行
print('i\nlike\nyou')

在这里插入图片描述
python中的+号的作用,即数值的加减乘除,求余,取整

#+号的作用第一就是将两个部分进行合并
print('hello'+'123')
print('hello'+str(123))
print(1+2)
print('1+2')
print(float(1.5)+2)
#  //是取整
# + - * / %
# **次方
#一般不强调数值的类型时,就是int型,浮点型是float
print(1+2)
print(1-3)
print(4*3)
print(2**4)#相当于2的四次方
print(4/2)
print(4/3)
print(8%7)
print(9//3)
a=3
b=6
c=7
d=10+b
a=a+3
print(d)
print(a,b,c,d)
print(a+b)
print(a)
f1=12.23#浮点型
f2=13.45
f3=f1+f2
print(f3)
print(f1,f2)
string1='hello'#字符型
string2='world'
print(string1+string2)
print(string1,string2)
string3=string1+string2
print(string3)
print('a+b=',a+b)

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值