第四周作业b 第8章选做(1、3、7、8)

8-1

def display_message(message):
	print(message)
mess=input("Input a message and it will be displayed:")
display_message(mess)


8-3

def make_shirt(size,message):
	print("The shirt will be made with the size of "+size)
	print(".And it will show the message:"+message)
size_=input("Please input the size of shirt:")
mess_=input("And input the message:")
make_shirt(size_,mess_)
print("\n")
make_shirt(message=mess_,size=size_)


8-7-8

def make_album(singer,album,count=""):
	dict={
		"singer_name":singer,
		"album_name":album,
		"count":count
	}
	print("\n")
	print(dict)
	print("\n")

while True:
	print("Input 'quit' to quit.")
	singer_name=input("Please input the singer name:")
	if singer_name=='quit':
		print("Quited")
		break
	album_name=input("Please input the album name:")
	num=input("If you want add the infor of count of singers,input number,or input '0':")
	if num=='0':
		make_album(singer_name,album_name)
	else:
		make_album(singer_name,album_name,num)


猜你喜欢

转载自blog.csdn.net/cjf16337023/article/details/79778048