python中print函数输出字符加数字

更新时间:01-28 教程 由 往日 分享

python中print函数输出字符加数字?

字符串和数字属于不同的类型,不能够相加,解决的方法有两种: 1:这样输出 print(s,r) 2: 将数字转化为字符串,然后相加输出 print(s+str(r))

声明:关于《python中print函数输出字符加数字》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2169325.html