《Python编程: 从入门到实践》习题答案--第五章 5-10

tech2025-04-19  8

《Python编程: 从入门到实践》习题答案–第五章 5-10 我的笨方法。若有不足,请指点!

current_users=['john','Admin','erric','marie','tonm'] new_users=['zhangsan','lisi','John','wangwu','admin'] current_users2=[] for current_user in current_users: value=current_user.lower() current_users2.append(value) for new_user in new_users: if new_user.lower() in current_users2: print("You need to enter a different user name.") else: print("This user name is not used.")
最新回复(0)