0
点赞
收藏
分享

微信扫一扫

python-2.输出字符串,注释

exercise 1

print somthing you like

print("Wello World!")
print("Hello Again!")
print('I like typing this.')
print("This is fun!")
print('Yay! Pringing.')
print("I'd much rather you 'not'.")
print('I "sad" do not touch this.')

注意:输出字符串的时候单双引号都可以,其他语言里面的反斜线转义在python里面也是生效的.

python-2.输出字符串,注释_转义

exercise 2

add a comment in your code

### this is a comment ,so that you can read it after a long time##
print("Hello , this is a comment !")

# test a program
print("This will run!")

print('this will not ## ## be ignored !')

python-2.输出字符串,注释_转义_02

注意:单行多行注释都是使用#符号,字符串里面的#后面的字符不会被注释.


举报

相关推荐

0 条评论