创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users, 再创建一个依次包含 字符串’GurR’、’Niu Ke Le’、 ‘LoLo’ 和’Tuo Rui Chi’ 的列表new_users, 使用for循环遍历new_users,如果遍历到的新用户名在current_users中, 则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again! ‘的语句, 否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is ava i lable! ‘的语句。(注:用户名的比较不区分大小写)
区块链毕设网qklbishe.com为您提供问题的解答
创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users,
再创建一个依次包含字符串’GurR’、‘Niu Ke Le’、‘LoLo’和’Tuo Rui Chi’的列表new_users,
使用for循环遍历new_users,如果遍历到的新用户名在current_users中,
则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again!‘的语句,
否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is available!‘的语句。(注:用户名的比较不区分大小写)
current_users = ['Niuniu','Niumei','GURR','LOLO'] new_users = ['GurR','Niu Ke Le','LoLo','Tuo Rui Chi'] current_users_up = [i.upper() for i in current_users] for i in new_users: if i.upper() in current_users_up: print('The user name {} has already been registered! Please change it and try again!'.format(i)) else: print('Congratulations, the user name {} is available!'.format(i))
12:42
current_users = ['Niuniu', 'Niumei', 'GURR', 'LOLO'] new_users = ['GurR', 'Niu Ke Le', 'LoLo', 'Tuo Rui Chi'] for i in new_users: for j in current_users: if i.lower() == j.lower(): print(f'The user name {i} has already been registered! Please change it and try again!') break else: print(f'Congratulations, the user name {i} is available!')
59:37
以上就是关于问题创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users, 再创建一个依次包含 字符串’GurR’、’Niu Ke Le’、 ‘LoLo’ 和’Tuo Rui Chi’ 的列表new_users, 使用for循环遍历new_users,如果遍历到的新用户名在current_users中, 则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again! ‘的语句, 否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is ava i lable! ‘的语句。(注:用户名的比较不区分大小写)的答案
欢迎关注区块链毕设网-
专业区块链毕业设计成品源码,定制。
区块链NFT链游项目方科学家脚本开发培训
从业7年-专注一级市场
微信:btc9767
TELEGRAM :https://t.me/btcok9
具体资料介绍
web3的一级市场千万收益的逻辑
进群点我
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » 创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users, 再创建一个依次包含 字符串’GurR’、’Niu Ke Le’、 ‘LoLo’ 和’Tuo Rui Chi’ 的列表new_users, 使用for循环遍历new_users,如果遍历到的新用户名在current_users中, 则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again! ‘的语句, 否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is ava i lable! ‘的语句。(注:用户名的比较不区分大小写)
微信:btc9767
TELEGRAM :https://t.me/btcok9
具体资料介绍
web3的一级市场千万收益的逻辑
进群点我
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » 创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users, 再创建一个依次包含 字符串’GurR’、’Niu Ke Le’、 ‘LoLo’ 和’Tuo Rui Chi’ 的列表new_users, 使用for循环遍历new_users,如果遍历到的新用户名在current_users中, 则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again! ‘的语句, 否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is ava i lable! ‘的语句。(注:用户名的比较不区分大小写)
进群点我
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » 创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users, 再创建一个依次包含 字符串’GurR’、’Niu Ke Le’、 ‘LoLo’ 和’Tuo Rui Chi’ 的列表new_users, 使用for循环遍历new_users,如果遍历到的新用户名在current_users中, 则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again! ‘的语句, 否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is ava i lable! ‘的语句。(注:用户名的比较不区分大小写)
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » 创建一个依次包含字符串’Niuniu’、’Niumei’、’GURR’和’LOLO’的列表current_users, 再创建一个依次包含 字符串’GurR’、’Niu Ke Le’、 ‘LoLo’ 和’Tuo Rui Chi’ 的列表new_users, 使用for循环遍历new_users,如果遍历到的新用户名在current_users中, 则使用print()语句一行输出类似字符串’The user name GurR has already been registered! Please change it and try again! ‘的语句, 否则使用print()语句一行输出类似字符串’Congratulations, the user name Niu Ke Le is ava i lable! ‘的语句。(注:用户名的比较不区分大小写)