2-1
>>> a='I love Python.'
>>> print(a)
I love Python.
2-2
>>> a='I love Python.'
>>> print(a)
I love Python.
>>> a='I am learnning Python.'
>>> print(a)
I am learnning Python.
2-3
name='Pikaqiu'
print('Hello '+name+',you are so handsome.')
Hello Pikaqiu,you are so handsome.
2-4
>>> name='pikaqiu'
>>> print(name.lower()) #小写
pikaqiu
>>> print(name.upper()) #大写
PIKAQIU
>>> print(name.title()) #首字母大写
Pikaqiu
2-5
>>> name='Albert Einstein'
>>> quotes='A person who never made a mistake never tried anything new.'
>>> print(name+' once said,"'+quotes+'"')
Albert Einstein once said,"A person who never made a mistake never tried anything new."
2-6
>>> famous_person='Albert Einstein'
>>> quotes='A person who never made a mistake never tried anything new.'
>>> message=famous_person+' once said,"'+quotes+'"'
>>> print(message)
Albert Einstein once said,"A person who never made a mistake never tried anything new."
2-7
>>> name=' \tPika\nqiu '
>>> print(name.lstrip())
Pika
qiu
>>> print(name.rstrip())
Pika
qiu
>>> print(name.strip())
Pika
qiu
2-8
>>> print(2+6)
8
>>> print(10-2)
8
>>> print(2*4)
8
>>> print(16/2)
8.0
2-9
>>> number='2'
>>> message='My favourite number is '+number+'.'
>>> print(message)
My favourite number is 2.