9 月 152020
 
first = "任何在双引号之间的字符,"
second = '或者任何在单引号之间的字符,都是字符串。'
third = '''三引号之间的内容,可以在
完成所有内容之前换行。'''
#字符串基本用法
#字符串作为值赋予变量
what_he_does = ' plays'
his_instrument = ' guitar'
his_name = 'Robert Johnson'
artist_intro = his_name + what_he_does + his_instrument
#打印变量
print(artist_intro)
print(first + second + third)
PS C:\Users\harveymei> & C:/Users/harveymei/AppData/Local/Programs/Python/Python38/python.exe c:/Users/harveymei/hello.py
Robert Johnson plays guitar
任何在双引号之间的字符,或者任何在单引号之间的字符,都是字符串。三引号之间的内容,可以在
完成所有内容之前换行。
PS C:\Users\harveymei>

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)