Post

Python Programming
Python Programming@PythonPr·
Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!
Python Programming tweet media
English
27
13
115
12.1K
Earnest Codes
Earnest Codes@Earnesto037·
@PythonPr Answer: (a)  In Python, the + operator, when used with lists, performs list concatenation. This means it combines the elements of the two lists into a single, new list, in the order they appear. The elements of list y are appended to the end of list x.
English
1
0
22
776
Pranay
Pranay@pranaycooldev·
@PythonPr Answer: (a) Because: " + " it joins the two lists together. So, [1, 2, 3] + [4, 5] becomes one combined list. Output: [1, 2, 3, 4, 5]
English
0
0
3
353
Python Tech
Python Tech@PythonTech43716·
@PythonPr A is correct answer Beacuse list doesn't add to each other they just concatenate.
English
0
0
2
430
Ayo.config ⚙️
Ayo.config ⚙️@Ayo0xx2·
@PythonPr A.[1,2,3,4,5]. The + on the lists doesn’t add numbers, it concatenates it.
English
0
0
2
282
biosphere
biosphere@scytheofvyse171·
@PythonPr This is a..it's fine.. But I'm interested in What method can give a nested list as output..
English
0
0
1
117
Ifechukwude Nwoko
Ifechukwude Nwoko@IFECHUKWUD37623·
@PythonPr A Lists are mutable. So [4,5] concatenates [1,2,3] resulting [1,2,3,4,5]. Similar to append()
English
0
0
1
128
Paylaş