#2-1
message = 'Hey,py!'
print(message)
#2-2
message = 'Hey,py!'
print(message)
message = 'Bye,py!'
print(message)
#2-3
name = 'Taylor'
print(name + ", how are you today?")
#2-4
name = 'Taylor'
print(name.lower())
print(name.upper())
print(name.title())
#2-5
print('Ma Yun once said, "I don`t like money."')
#2-6
famous_person = 'Ma Yun'
message = "I don`t like money."
print(famous_person + ' once said, "' + message + '"')
#2-7
name = '\n \tTaylor \t\n'
print(name)
print(name.lstrip())
print(name.rstrip())
#2-8
print(1 + 7)
print(9 - 1)
print(2 * 4)
print(16 / 2)
#2-9
favorite_num = 7
print('My favourite number is ' + str(favorite_num) + ".")
#2-11
import this
py第二章习题
最新推荐文章于 2020-11-22 12:42:04 发布