高级编程技术(第五次作业)

时间:2022-02-03 21:58:31
#5.3 5.4
alien_color = "green"

if alien_color == "green":
	print("you get five points!")
else:
	print("youg get ten points!")

alien_color = "yellow"

if alien_color == "green":
	print("you get five points!")
else :
	print("you get ten points!")

#5.8,5.9
usernames =["admin","b","c","d","e"]
for username in usernames:
	if username == "admin":
		print("Hello admin, would you like to see a staus report?")
	else :
		print("Hello " + username + " ,Thank you for logging in again!")

for username in usernames:
	del usernames[0]

if usernames:
	print("we need some users!")

#5.10
current_users = ["a","b","c","d","e"]
new_users = ["a","f","g","h","b"]
for new_user in new_users:
	if new_user in current_users:
		print("you need to input another username")
	else:
		print("This username is new!")

结果

高级编程技术(第五次作业)