作业day3

作业

2.3
people_name = "DaWei"
print("Hello "+people_name+",would you like to learn some Python today?")

2.4
print("小写:"+people_name.lower())
print("大写:"+people_name.upper())
print("首字母大写:"+people_name.capitalize())

2.5
name="dafei"
str1=""做店长的话,我的店不打烊,做船长的话,我的船不靠岸.""
print(name+"曾说:"+str1)

2.6
famous_people=name
message=str1
print(famous_people+"今天说"+message)

2.7
name1 = "888888dafei666666"
print(name1.lstrip("8"))
print(name1.rstrip("6"))
print(name1.strip("8"))

答案

2.3
Hello DaWei,would you like to learn some Python today?

2.4
小写:dawei
大写:DAWEI
首字母大写:Dawei

2.5
dafei曾说:"做店长的话,我的店不打烊,做船长的话,我的船不靠岸."

2.6
dafei今天说"做店长的话,我的店不打烊,做船长的话,我的船不靠岸."

2.7
dafei666666
888888dafei
dafei666666
[Finished in 0.1s]

你可能感兴趣的:(作业day3)