name = "Agaki"
print("Hello " + name + ", would you like to learn some Python today?")
2-4调整名字的大小写
name = "Agaki"
print(name.upper())
print(name.lower())
print(name.title())
2-5 名言
print("Mark Twain" + ' once said, "' + "It’s notthe size ofthe dog inthe fight, it’s the size ofthe fight inthe dog." + '"')
2-6 名言2
famous_person = "Mark Twain"
message = "It’s not the size of the dog in the fight, it’s the size of the fight in the dog."print(famous_person + ' once said, "' + message + '"')
2-7 剔除人名中的空白
name = "\n\tAgaki\t"print(name)
print(name.lstrip())
print(name.rstrip())
print(name.strip())
favourite_num = 3.141526535897932384626message = "My favourite number is " + str(favourite_num)
print(message)
2-10 添加注释
'''
Word processing
'''
# Set name
name = "Agaki"
# All upper case alpha
print(name.upper())
# All lower case alpha
print(name.lower())
# First alpha in upper case
print(name.title())