Nov-13-2019, 07:24 AM
@Evil_Patrick: Think what will happen if it's a huge list(s) or if the list(s) changes...
@metro17: this is wrong by design. user should not be concerned with internals (i.e. they are not expected to know anything about variable names)
if you look at
You should use proper data structure like dict:
@metro17: this is wrong by design. user should not be concerned with internals (i.e. they are not expected to know anything about variable names)
if you look at
animals = [a,c] = [1,2]
- a
and c
are variable names.You should use proper data structure like dict:
animals = {'rabbit':1, 'fox':2} print(animals) pick = input("Enter animal to delete: ") del animals[pick] print(animals)
Output:{'rabbit': 1, 'fox': 2}
Enter animal to delete: fox
{'rabbit': 1}
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs