2) Prompt the user for a bank account number. Then if the user is an existing customer, greet them with their name. Ex: Please enter your bank account number: 109 Greetings, John Doe!
2) Prompt the user for a bank account number. Then if the user is an existing customer, greet them with their name.
Ex:
Please enter your bank account number: 109 Greetings, John Doe!
Here's an example of python code to implement the prompt and greeting:
Input:
bank_accounts = {
"109": {"name": "John Doe"},
"110": {"name": "Jane Doe"},
"111": {"name": "Jim Brown"}
}
bank_account_number = input("Please enter your bank account number: ")
if bank_account_number in bank_accounts:
name = bank_accounts[bank_account_number]["name"]
print(f"Greetings, {name}!")
else:
print("Sorry, we could not find an account associated with that number.")
Output:
Please enter your bank account number: 109
Greetings, John Doe!
Step by step
Solved in 2 steps with 1 images