当前位置 : 主页 > 编程语言 > python >

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

来源:互联网 收集:自由互联 发布时间:2022-07-07
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 th

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

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


上一篇:python-1.安装
下一篇:没有了
网友评论