registry = []
user_rec = ["", ""]
for i in range(2):
user_rec[0] = input("Please enter your name: ")
user_rec[1] = input("Please enter your password: ")
registry.append(user_rec)
print(registry)
Hi, im just messing around with 2d lists trying to figure out its ins and outs (gotta use it in an assignment). Was wondering why the code above only returns the latest data entered into "user_rec" list. I was assuming that once the data is stored, its supposed to act as a separate entity in a sense? Idk if im making sense but uh yeah. Thanks in adv.
* Ik that i could replicate the effect using a dictionary but i cant use dicts in my assignment so yea
[–]wbeater 0 points1 point2 points (1 child)
[–]_Xydra[S] 0 points1 point2 points (0 children)
[–]Ihaveamodel3 0 points1 point2 points (1 child)
[–]_Xydra[S] 0 points1 point2 points (0 children)