python课程作业——第2章 变量和简单数据类型

xiaoxiao2021-02-28  46

第2章 变量和简单数据类型

# 2-3 name = "Eric" print("Hello " + name + ", would you like to learn some Python today?") # 2-4 name = "Albert Einstein" print(name.upper()) print(name.lower()) print(name.title()) # 2-5 print('Albert Einstein once said, "A person who never made a mistake never tried anything new."') # 2-6 famous_person = "Albert Einstein" message = 'A person who never made a mistake never tried anything new.' print(famous_person + ' once said, "' + message + '"') # 2-7 name = "\tAlbert Einstein\n" print("origin: ") print(name) print("lstrip: ") print(name.lstrip()) print("rstrip: ") print(name.rstrip()) print("strip: ") print(name.strip())
转载请注明原文地址: https://www.6miu.com/read-2612953.html

最新回复(0)