首页 > 微信 > 详细

微信之初学者:字符串

时间:2016-11-19 23:39:56      阅读:318      评论:0      收藏:0      [点我收藏+]

1.单引号和双引号

print(hello world)
print("hello world")

2转义引号

print("let‘s go!")
print(let\‘s go!)
print(let\‘s say "hello world")

3字符串拼接

print(hello, + world)#注意hello后面的逗号,

4长字符串的输入

print(‘‘‘Where there  is a will,here is a way,
you jump ,I jump.
to be or not to be,is a question.
let‘s go‘‘‘)#在这种模式里,不要在需要反斜线来转义

5原始字符串

print(C:\\nasd\\asd\\q\\asd)
print(rC:\nasd\asd\q\asd)
print(rC:\as\asd\asd\asd‘‘\\)#结尾以反斜线

 

微信之初学者:字符串

原文:http://www.cnblogs.com/printer/p/6081641.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!