The python code is as below:
"torge" is not be used yet.
"tom" is not be used yet.
"ada" is already used, please find a new name.
['torge', 'tom', 'ace', 'amanda']
"amanda" is not be used yet.
So the question is why 'ace' in the new_account is not processed in the result.
Many thanks!
curren_accounts=['amy','ADA','eric','tim','jasmin']
new_accounts=['torge','tom','ada','ace','amanda']
for new_account in new_accounts:
for curren_account in curren_accounts:
if new_account.title() == curren_account.title():
print('"'+new_account+'"'+' is already used, please find a new name.')
new_accounts.remove(new_account)
print(new_accounts)
if new_account in new_accounts:
print('"'+new_account+'"'' is not be used yet.')the result is as below:"torge" is not be used yet.
"tom" is not be used yet.
"ada" is already used, please find a new name.
['torge', 'tom', 'ace', 'amanda']
"amanda" is not be used yet.
So the question is why 'ace' in the new_account is not processed in the result.
Many thanks!
