0

I am making a program for my CS class. Is there a way, in python, to set more than one value to a variable? Am I thinking about this in the wrong way?

I need to make a program that asks a bank account holder for their username.

If that user name is in the the system it asks for the pin.
If not, it kicks them back a step

If the username and pin match then it displays their account details.
If not, again, it kicks them back a step

Any help would be greatly appreciated!

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by pyTony
0

try to use classes :)

In the class I am going to create a variable called user_names.
Is is possible for a variable to have multiple values?
Example: user_name = lee, wes?

That idea is what I am stuck on. Is that possible?

Thanks

0

For example, use list.

user_names = []
user_names.append('User1')
user_names.append('User2')
print(user_names)
if user_names[0] == someuser:
    ....

Edited by _neo_: n/a

0

There is many ways to reprecent group of information. Basic choice is list for changing data or tuple for rarely changing data. Tuple is faster but any change to it generates new tuple as it is immutable. Please go through the tutorials section on types.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.