day05_01 鸡汤+内容回顾

推荐电影:

1.被解救的姜戈

2.华尔街之狼

3.阿甘正传

4.辛德勒的名单

5.肖申克的救赎

6.上帝之城

7.焦土之城

8.绝美之城

打印多行

msg = "hello 1
hello 2
hello 3
"
print(msg)

出错

语法错误:

""双引号只能进行单行的字符串

''' '''必须用3个引号才能进行多行字符串

msg = '''hello 1
hello 2
hello 3
'''
print(msg)

如果''' '''不加上变量的话,那就是注释

单引号和双引号的区别

msg = "Hello,its me"
msg = ' hello,its me'  
#shell 中,' 和 " 有不同的意义,但是在python中单引号和双引号都是一样的
# 如果里面是单引号,那么外面就必须是双引号
# 如果里面是双引号,那么外面就必须是单引号
# 如果里面有单引号和双引号,那么外面就必须是三引号 print(msg)

  

msg = " hello,it's me"
print(msg)

  

msg = ' hello,its "me"'
print(msg)

  

msg = ''' hello,it's "me"'''
print(msg)

  

原文地址:https://www.cnblogs.com/darkalex001/p/7489171.html