英文:
Is there a way to make a password into stars
问题
I am making a password checker but I want it to print out the passcode but in *.
My code is:
username = input("What is your name?")
password = input("What is your password?")
password_length = len(password)
print(f'{username}, your password, {password}, is {password_length} letters long')
英文:
I am making a password checker but I want it to print out the passcode but in *.
My code is:
username = input("What is your name?")
password = input("What is your password?")
password_length = len(password)
print(f'{username}, your password, {password}, is {password_length} letters long')
答案1
得分: 1
print(f'{username}, your password, {"*" * password_length}, is {password_length} letters long')
英文:
print(f'{username}, your password, {"*" * password_length}, is {password_length} letters long')
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论