- 1
What does this code output? letters = ['x', 'y', 'z'] letters.insert(1, 'w') print(letters[2])
pls give the answer
6 Answers
+ 2
Hi SHUVODEEP LODH,
The variable letters defines a new list containing 3 elements. letters.insert(1, 'w') inserts 'w' at the second place. The last statement prints letters[2], that is, the 3rd element of the list, which will now be y.
Next time if you want to find just the output, try using Code Playground...
https://code.sololearn.com/cv37USpFF6jx/?ref=app
+ 1
y answer
0
The answer to this problem is Y.
I hope this is helpful.
0
What does this code output?
letters = ['x', 'y', 'z']
letters.insert(1, 'w')
print(letters[2])
- 5
Run the code in Code Playground and find out for yourself.