0

I am trying to reassign 'hello' with 'goodbye' in the list, but the reassigning is happening at incorrect positions

Using Jupyter Notebook

list3 = [1,2,[3,4,'hello']]
 
list3[2][2]= 'goodbye'
list3
[1, 'goodbye', [3, 4, 'goodbye']] 

I am gettig the above result. I only want to reassign 'hello'.

Barmar
  • 741,623
  • 53
  • 500
  • 612

1 Answers1

1

Drshanu

I tried the code from my side.

But the results are very good.

list3 = [1,2,[3,4,'hello']]

list3[2][2]= 'goodbye'

print(list3)

Result

[1,2,[3,4,'goodbye']]

So I think you should post all your code unless it's the private code.

Then I will review and reply again.

Victory
  • 36
  • 1
  • 4