+ 8
I have a doubt ... How list is created using augmented operator ? ..... acc. to me it should have given error
3 Antworten
+ 4
+= is the same as using the method extend.
This method takes an iterable and appends each item separately to the list.
Since str is also a type of iterable with separate elements, this works.
+ 9
HonFu Thanks for clearing my concept😊
+ 8
Jay Matthews
ls=[ ]
ls+='python'
print (ls)
o/p --> ['p','y','t','h','o','n']
My doubt is ... Why the above code is not giving an error ?