您的位置:首页 > 编程语言

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

2018-03-19 13:07 197 查看
#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!")
结果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: