#coding=utf-8
#第一题
message = "Hello Python World !"
print(message+"\n")
#第二题,沿用第一题的变量好了
print(message)
message = "My Homework"
print(message+"\n")
#第三题
name = "alice"
print("Hello "+name.title()+", would you like to learn some Python today?\n")
#第四题,沿用第三题的变量
print(name.lower())
print(name.upper())
print(name.title()+"\n")
#第五题
name = "Van"
sentence = " I'm an artist. I'm a performance artist. I'm hired for people to profile their fantasies, the DEEP DARK FANTASIES."
print(name + 'once said,"'+sentence+'"\n')
#第六题
famous_person = "Van"
message = " I'm an artist. I'm a performance artist. I'm hired for people to profile their fantasies, the DEEP DARK FANTASIES."
print(famous_person + 'once said,"'+message+'"\n')
#第七题
name = "\tPony Ma\n"
print(name)
print(name.lstrip()+"\n"+name.rstrip()+"\n"+name.strip()+"\n")
#第八题
print(1+7)
print(9-1)
print(2*4)
print(16/2)
#第九题
my_num = 4
message = "my favorite number is "+str(my_num)
print(message+"\n")
#第十题
#我一直在注释啊。。。
#第十一题 略
高级编程作业——2.1-2.10
最新推荐文章于 2021-10-08 12:18:36 发布