0
Can any one explain below code?
2 RĂ©ponses
+ 5
[*p], p[k:k] = "python", "<appple>"
Above code uses tuple unpacking
https://www.sololearn.com/learn/Python/2485/?ref=app
We can write the same as follows:
[*p] = "python"
p[k:k] = "<appple>"
[*p] = "python" #p is a list of chars now: ['p','y','t','h','o','n']
https://code.sololearn.com/ccNpPRk4GO8M/?ref=app
p[k:k] = "<appple>" #insert <appple> at index k
https://www.sololearn.com/learn/Python/2453/?ref=app
+ 1
python
I got exact answer from above link.