हिंदी

Consider the following list myList. What will be the elements of myList after the following operation: myList = [10,20,30,40] myList.extend([80,90]) - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Consider the following list myList. What will be the elements of myList after the following operation:

myList = [10,20,30,40]

myList.extend([80,90])
टिप्पणी लिखिए

उत्तर

extend() function takes a list as an argument and appends each element of the list in the same order. The final output will be: [10, 20, 30, 40, [50, 60], 80, 90].

shaalaa.com
List Methods and Built-in Functions
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 9: Lists - Exercise [पृष्ठ २०४]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
अध्याय 9 Lists
Exercise | Q 2. ii. | पृष्ठ २०४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×