Post

@PythonPr Arey, Python, interesting question! The output depends on how you look at the code, right? Let's discuss this!
English

@PythonPr Answer: B).
The extend() method in Python adds all the items of an iterable (like a string, list, or tuple) to the end of the current list individually. When a string is used with extend(), each character of the string is treated as a separate element.
English

@PythonPr @code_true___/video/7580968575821745430" target="_blank" rel="nofollow noopener">tiktok.com/@code_true___/…
QME

@PythonPr Answer: B
Solution: Let's take a look at what `extend` list method does.
Here we start with a list `li`, initialized to ['W'].
Now we run the `.extend` list method, with the argument 'XYZ'
li.extend('XYZ')
The `extend` method works by
+
English

@PythonPr B , the extend method adds individual item to the list
English

@PythonPr C. And if someone says "I use Python" but doesn't understand extend(), they're probably just using ChatGPT as their IDE.
English













