小编Has*_*anQ的帖子

How to add an "else" option after a list of "if" commands in python

There is a bank app and you have to log in, and certain codes have certain users. how would i make it to where if none of the codes were used, i can have a message saying no valid code was entered?

#login id 10
account_name1 = "Mark"
account_balance1 = "150"

#login id 11
account_name2 = "John"
account_balance2 = "190"

#login id 12
account_name3 = "Bob"
account_balance3 = "210"

login_id = input("What is your login id?")

if login_id == "10": …
Run Code Online (Sandbox Code Playgroud)

python if-statement

0
推荐指数
1
解决办法
52
查看次数

标签 统计

if-statement ×1

python ×1