A Python list is  ………. set of items an unordered an ordered a limited  an integer   Question 2 What is the output of the following program: alist = [] for i in range(3): alist.append(i**2) print(alist)   [1, 4, 16] [ ] [0,1,4] 9   Question 3 Assuming alist is a list of 4 items, what does this statement do: alist[1] = 2 Insert two items into the list at position 1 Change alist's second item to 2  Change alist's first item to 2 Insert an item in a list at position 1 with value 2

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 23SA
icon
Related questions
Question

Question 1

A Python list is  ………. set of items
an unordered
an ordered
a limited 
an integer

 

Question 2

What is the output of the following program:

alist = []

for i in range(3):

alist.append(i**2)

print(alist)

 

[1, 4, 16]

[ ]

[0,1,4]

9

 

Question 3

Assuming alist is a list of 4 items, what does this statement do:

alist[1] = 2

Insert two items into the list at position 1

Change alist's second item to 2 

Change alist's first item to 2

Insert an item in a list at position 1 with value 2

 

Question 4

After a tuple is created, its items can be changed.

True

False 

 

Question 5

A tuple's items can be access by square brackets, similar to lists.

True 

False

 

Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Arrays
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