Why would you re-assign a list variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why would you re-assign a list variable?

It says "you can also reassign" so it's like list = [3, 4, 5, 6] and apparently you can switch one of those numbers. like number 2 in that list which is 5 (because you count starting with zero in python!!) and you can reassign 5 to 3. But why would you do that? In what case would you reassign?

2nd Sep 2020, 3:41 AM
PY7HAGOREAN
PY7HAGOREAN - avatar
1 Answer
+ 4
When you will learn more and try to make codes and solve problems, you will learn why we want this feature! Because this is important in all languages, and it is there! You will realise its importance when you will try to solve the problems in this thread! https://www.sololearn.com/Discuss/1270852/?ref=app (The index starts with 0 in all languages not only in python)
2nd Sep 2020, 4:41 AM
Namit Jain
Namit Jain - avatar