Hi this is RM MUSIC.
I am having a doubt regarding how to access and validate elements from tuples, which are placed inside a list.
Actually, I am working on a small username and password validation project so I decided to use this part of python in my project.
So my code is like this:
L = [(1, 2), (2, 3), (3,4)]
I have thought as the left side of the tuple acting as a username and right side to be for password.
Suppose an user type in my input function like:
Enter username: 1
He types the number 1.
My problem is that how can I access the element from my list and also to print whether the input was write or wrong.
One more problem is that how can I append a tuple in a list which basically contains username and password.
for eg. Username = adorabletrooper
password = adorable1234
So I want it in (“adorabletrooper”, “adorable1234”) form.
So how can I append it in my previous list
And if you have any better method to make this code clean like storing the data in an excel file or in txt file, please write me down.
Please solve my problem as soon as possible.