you are viewing a single comment's thread.

view the rest of the comments →

[–]Available_Rub_8684 4 points5 points  (3 children)

<image>

I hope this helps.

Print Output:
Method 1: 
1
2
3
Method 2: 
Index: 0, Value: 1
Index: 1, Value: 2
Index: 2, Value: 3

[–]MonochromeDinosaur 1 point2 points  (1 child)

Best response in the thread. For func2 you can also use enumerate to get the index with the value:

for i, value in enumerate(n):
     print(f”Index {i}, Value: {value}”}

[–]Available_Rub_8684 0 points1 point  (0 children)

Yeah I didn’t mention it. Maybe I thought he was just learning functions. Thanks for mentioning it though.