type_of_people =10
x =f'There are {type_of_people} type_of_people'
binary ='binary'
do_not ='''don't'''
y =f'Those who know {binary} and those who {do_not}'print(x)print(y)print(f'I said:{x}')print(f'''I also said:'{y}' ''')
hilarous =False
joke_evalution ='''Isn't that joke so funny?! {}'''print(joke_evalution.format(hilarous))
w ='That is the left side of ...'
e ='a string with a right side.'print(w + e)
输出:
There are 10 type_of_people
Those who know binary and those who don't
I said:There are 10 type_of_people
I also said:'Those who know binary and those who don't'
Isn't that joke so funny?! False
That is the left side of ...a string with a right side.
巩固练习
把一个字符串放进另一个字符串:
x =f'There are {type_of_people} type_of_people'
y =f'Those who know {binary} and those who {do_not}'print(joke_evalution.format(hilarous))print(w + e)