Write a program below that will demonstrate the different characteristics and methods of the data type list. 1. Type the following code on your Python script. 1 List_1= [1,2,2,3,4,5] 2 List 2 [6,7,8,7,10] List_3 List_1 + List_2 3 5 print (List_3) 6 print(list_1[0] 7 print(list_2[::-1]) 8 9 List_4 List_1.copy() 10 print (List 4) 11 List 2.append(88) 12 print (List 2) 13 14 List_1.pop(1) 15 print (List 1) 16 List 2.remove(10) 17 List 2.insert(4, 'a9') 18 print (List 2) 2. Run the program and explain the codes in line 5, line 6 and line 7. 3. What does the methods .copy() and .append() do? 4. Explain the difference between the methods .pop() and .remove(). What does 4 and 'a9' mean in line 17?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18SA
icon
Related questions
Question

Direction: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code.

Python download: https://www.python.org/downloads/ 
Any Python Version 3.8 and later is recommended

Programming Demo 3: Characteristics and Methods of Lists
Write a program below that will demonstrate the different characteristics and methods of
the data type list.
1. Type the following code on your Python script.
1
List_1 = [1,2,2,3,4,5]
2
List 2 = [6,7,8,7,10]
3
List_3 = List_1 + List_2
4
5
print(list_3)
6 print(list_1[0]
7
print(list_2[::-1])
8
9 List_4 = List_1.copy()
10 print (List 4)
11 List 2.append(88)
12 print (List_2)
13
14 List_1.pop(1)
15 print (List_1)
16 List_2.remove(10)
17 List_2.insert(4, '09')
18 print (list_2)
2. Run the program and explain the codes in line 5, line 6 and line 7.
3. What does the methods .copy() and .append() do?
4. Explain the difference between the methods .pop() and .remove(). What does 4
and 'a9' mean in line 17?
Transcribed Image Text:Programming Demo 3: Characteristics and Methods of Lists Write a program below that will demonstrate the different characteristics and methods of the data type list. 1. Type the following code on your Python script. 1 List_1 = [1,2,2,3,4,5] 2 List 2 = [6,7,8,7,10] 3 List_3 = List_1 + List_2 4 5 print(list_3) 6 print(list_1[0] 7 print(list_2[::-1]) 8 9 List_4 = List_1.copy() 10 print (List 4) 11 List 2.append(88) 12 print (List_2) 13 14 List_1.pop(1) 15 print (List_1) 16 List_2.remove(10) 17 List_2.insert(4, '09') 18 print (list_2) 2. Run the program and explain the codes in line 5, line 6 and line 7. 3. What does the methods .copy() and .append() do? 4. Explain the difference between the methods .pop() and .remove(). What does 4 and 'a9' mean in line 17?
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning