(Jan-05-2017, 06:53 PM)buran Wrote: Notwithstanding the obvious need to learn about loops and how to use properly, you should know that you don't need to loop over the list elements to check that something belongs to the list. Here is hint:
Sweet thanks for the hint :D. Would it check the list everytime username is input? I will write it out and test. I know this post is similar to the last one I posted but not a dupe post. In the previous post I asked for help fixing a registration form. In the post I'm trying to gain knowledge on basics in python because I just started programming 2 months ago and I've researched that python is a good starting language. If anyone could explain in detail whats going on in this loop I'd really appreciate that. I will do my research however I also need some iteration on this specific loop if you someone wouldn't mind. I will give back to the community. I believe I have the capabilities to become a great asset in computer science. I do these side projects fully non-profit and self-motivated.
I don't know who made http://pythontutor.com/visualize.html#co...nces=false but I love them. So basically usrdatalist gets broken down into however many username, password combanations exist and saved as their own lists. When the for loop is ran n[0] checks the first sublist, then when the for loop ends it jumps into the next sublist until all sublists have been ran through but never checking all the sublists every time the loop is ran and or never going back to previous sublists to check the previous usernames after jumping. How would I write the code to check every sublist? Using a loop or not?
This is indeed incorrect syntax, if you wouldn't mind helping me fix it so I can run it in pythonvisualtutor
username in usrdatalist: if username[0] == username: username = input("Name taken, enter new name: ")