SlideShare a Scribd company logo
1 of 6
Download to read offline
Question 1
A Python list is .. set of items.
an unordered
an ordered
a limited
an integer
Question 2
Which is a valid Python statement?
alist = [1; 4; 9; 16]
alist = 1: 2: 3: 4]
alist = [1, 4, 9, 16]
Question 3
A Python list's items can be any Python type.
True
False
Question 4
If squares = [1, 4, 9, 16], what is the value of squares(1] ?
an error
1
4
5
Question 5
If squares = [1, 4, 9, 16, 25], what is len(squares)?
4
55
5
1
Question 6
The following statement is valid:
alist = [ ]
True
False
Question 7
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 8
What is the output of the following:
alist = [1, 4, 9]
sum = 0
for value in alist:
sum += value
print(sum)
[1, 5, 14]
0
14
[1, 4, 9]
Question 9
If squares = [1, 4, 9, 16, 25], what is the value of squares[1:3] ?
[4,91
[4, 9, 16]
[1,4]
[1, 4, 9]
Question 10
If squares = [1, 4, 9, 16, 25], what is the value of squares[:3] ?
[1, 4, 9, 16]
an error
[1, 4, 9]
Question 11
If squares = [1, 4, 9, 16, 25], what is the value of squares[2:]?
[4,9, 16, 25]
an error
[1. 41
[9, 16, 25]
Question 12
If squares = [1, 4, 9, 16, 25], what is the value of squares[0::2] ?
[1, 4]
an error
[1, 9, 25]
[1, 4, 9]
Question 13
What function can be used to determine the smallest value in a list?
smallest()
min()
least()
minimum()
Question 14
Which keyword is used to determine if a value is in a list?
contains
in
has
within
Question 15
Assuming alist is a list of 4 items, what does this statement do:
alist[11 = 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 16
Which statement can be used to insert an item into a list named alist?
alist.insert(item, O)
insert(alist, item)
alist.insert(O, item)
alist <- item
Question 17
What method can be used to append a list to the end of another list?
augment()
extend()
concatenate()
add()
Question 18
Assuming the list squares is set to [1, 4, 9, 16], what statement can be
used to remove the value 1 from the list
del alist.0
alist.remove(1)
remove(alist, 1)
remove(alist, O)
Ouestion 19
Assuming alist is a list with 4 items, what statement can be used to
remove the last item from alist and assignment the variable last to its
value?
last = alist.pop()
last = alist.drop()
last = alist[-1]
last = alist[0]
Question 20
What statement can be used to remove all items from a list named alist?
delete alist
alist.clear()
del alist
clear(alist)
Question 21
What statement can be used to remove the first item from a list named
alist?
remove(alist, 0)
alist.remove(O)
del alist[O]
del(alist, O)
Question 22
If alist is a list, what method can be used to create a new list with a copy
of the items contained in alist?
blist = alist.dup()
blist = alist
copy(alist, blist)
blist = alist.copy()
Question 23
If alist is a list, what does sorted(alist) do?
generates a new ordered list
checks if alist is sorted, and return True or False
returns the index of the first item out of order
updates alist so that its items are in order
Question 24
If alist is a list, what does alist.sort( do?
checks if alist is sorted =, and return True or False
generates a new ordered list
updates alist so that its items are in order
returns the index of the first item out of order
Question 25
If alist is a list, what does alist.reverse do?
generates a new list in reverse order
checks if alist is reverse sorted, and return True or False
updates alist so that its items are in reverse order
returns the index of the first item out of order
Question 26
A table can be represented as a list of lists.
True
False
Question 27
After a tuple is created, its items can be changed.
True
False
Question 28
Which can be used to create a tuple?
square brackets
curly braces
colons
parentheses
Question 29
A tuple's items can be access by square brackets, similar to lists.
True
False

More Related Content

Similar to Question 1A Python list is ��.. set of items.an unorderedan or.pdf

Bsc cs ii dfs u-2 linklist,stack,queue
Bsc cs ii  dfs u-2 linklist,stack,queueBsc cs ii  dfs u-2 linklist,stack,queue
Bsc cs ii dfs u-2 linklist,stack,queueRai University
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Poojith Chowdhary
 
Mca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueMca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueRai University
 
Prompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdfPrompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdfalsofshionchennai
 
Python PRACTICAL NO 6 for your Assignment.pptx
Python PRACTICAL NO 6 for your Assignment.pptxPython PRACTICAL NO 6 for your Assignment.pptx
Python PRACTICAL NO 6 for your Assignment.pptxNeyXmarXd
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3infanciaj
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptxSakith1
 
Can you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdfCan you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdfSeanIC4Jamesn
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-listpinakspatel
 
The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184Mahmoud Samir Fayed
 
There are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdfThere are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdfaamousnowov
 
The Ring programming language version 1.6 book - Part 24 of 189
The Ring programming language version 1.6 book - Part 24 of 189The Ring programming language version 1.6 book - Part 24 of 189
The Ring programming language version 1.6 book - Part 24 of 189Mahmoud Samir Fayed
 
Built-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdfBuilt-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdfalivaisi1
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4Introduction To Programming with Python-4
Introduction To Programming with Python-4Syed Farjad Zia Zaidi
 
Aj unit2 notesjavadatastructures
Aj unit2 notesjavadatastructuresAj unit2 notesjavadatastructures
Aj unit2 notesjavadatastructuresArthik Daniel
 

Similar to Question 1A Python list is ��.. set of items.an unorderedan or.pdf (20)

Bsc cs ii dfs u-2 linklist,stack,queue
Bsc cs ii  dfs u-2 linklist,stack,queueBsc cs ii  dfs u-2 linklist,stack,queue
Bsc cs ii dfs u-2 linklist,stack,queue
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3
 
Mca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueMca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queue
 
Prompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdfPrompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdf
 
Lists
Lists Lists
Lists
 
Python PRACTICAL NO 6 for your Assignment.pptx
Python PRACTICAL NO 6 for your Assignment.pptxPython PRACTICAL NO 6 for your Assignment.pptx
Python PRACTICAL NO 6 for your Assignment.pptx
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptx
 
07 java collection
07 java collection07 java collection
07 java collection
 
Can you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdfCan you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdf
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
 
The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184
 
There are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdfThere are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdf
 
1 D Arrays in C++
1 D Arrays in C++1 D Arrays in C++
1 D Arrays in C++
 
The Ring programming language version 1.6 book - Part 24 of 189
The Ring programming language version 1.6 book - Part 24 of 189The Ring programming language version 1.6 book - Part 24 of 189
The Ring programming language version 1.6 book - Part 24 of 189
 
Built-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdfBuilt-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdf
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4Introduction To Programming with Python-4
Introduction To Programming with Python-4
 
MA3696 Lecture 8
MA3696 Lecture 8MA3696 Lecture 8
MA3696 Lecture 8
 
Aj unit2 notesjavadatastructures
Aj unit2 notesjavadatastructuresAj unit2 notesjavadatastructures
Aj unit2 notesjavadatastructures
 

More from climatecontrolsv

Required is a project that seeks to develop a program that check.pdf
Required is a project that seeks to develop a program that check.pdfRequired is a project that seeks to develop a program that check.pdf
Required is a project that seeks to develop a program that check.pdfclimatecontrolsv
 
Question 1A Python list isset of items.an unorderedan ordere.pdf
Question 1A Python list isset of items.an unorderedan ordere.pdfQuestion 1A Python list isset of items.an unorderedan ordere.pdf
Question 1A Python list isset of items.an unorderedan ordere.pdfclimatecontrolsv
 
PROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdf
PROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdfPROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdf
PROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdfclimatecontrolsv
 
Principles of Insurance Chapter 3 Exercise 1 Name of student Regist.pdf
Principles of Insurance Chapter 3 Exercise 1 Name of student Regist.pdfPrinciples of Insurance Chapter 3 Exercise 1 Name of student Regist.pdf
Principles of Insurance Chapter 3 Exercise 1 Name of student Regist.pdfclimatecontrolsv
 
Please use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdf
Please use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdfPlease use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdf
Please use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdfclimatecontrolsv
 
Please help me what is the best answer for this. (Organizational Beh.pdf
Please help me what is the best answer for this. (Organizational Beh.pdfPlease help me what is the best answer for this. (Organizational Beh.pdf
Please help me what is the best answer for this. (Organizational Beh.pdfclimatecontrolsv
 
Please help this code is supposed to evaluate current node state and i.pdf
Please help this code is supposed to evaluate current node state and i.pdfPlease help this code is supposed to evaluate current node state and i.pdf
Please help this code is supposed to evaluate current node state and i.pdfclimatecontrolsv
 
Please IRAC this brief. Terrance and Barbara Moser were married on O.pdf
Please IRAC this brief. Terrance and Barbara Moser were married on O.pdfPlease IRAC this brief. Terrance and Barbara Moser were married on O.pdf
Please IRAC this brief. Terrance and Barbara Moser were married on O.pdfclimatecontrolsv
 
Please help me fix this code! will upvote. The code needs to produce .pdf
Please help me fix this code! will upvote.  The code needs to produce .pdfPlease help me fix this code! will upvote.  The code needs to produce .pdf
Please help me fix this code! will upvote. The code needs to produce .pdfclimatecontrolsv
 
PART 1Net present value represents the difference between the pres.pdf
PART 1Net present value represents the difference between the pres.pdfPART 1Net present value represents the difference between the pres.pdf
PART 1Net present value represents the difference between the pres.pdfclimatecontrolsv
 
Please create a context diagram of the following housing system Y.pdf
Please create a context diagram of the following housing system Y.pdfPlease create a context diagram of the following housing system Y.pdf
Please create a context diagram of the following housing system Y.pdfclimatecontrolsv
 

More from climatecontrolsv (11)

Required is a project that seeks to develop a program that check.pdf
Required is a project that seeks to develop a program that check.pdfRequired is a project that seeks to develop a program that check.pdf
Required is a project that seeks to develop a program that check.pdf
 
Question 1A Python list isset of items.an unorderedan ordere.pdf
Question 1A Python list isset of items.an unorderedan ordere.pdfQuestion 1A Python list isset of items.an unorderedan ordere.pdf
Question 1A Python list isset of items.an unorderedan ordere.pdf
 
PROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdf
PROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdfPROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdf
PROBLEM STATEMENTIn this assignment, you will complete DoubleEnde.pdf
 
Principles of Insurance Chapter 3 Exercise 1 Name of student Regist.pdf
Principles of Insurance Chapter 3 Exercise 1 Name of student Regist.pdfPrinciples of Insurance Chapter 3 Exercise 1 Name of student Regist.pdf
Principles of Insurance Chapter 3 Exercise 1 Name of student Regist.pdf
 
Please use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdf
Please use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdfPlease use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdf
Please use R studiodata13.txtX Y7.04948502035051 4.37962324700.pdf
 
Please help me what is the best answer for this. (Organizational Beh.pdf
Please help me what is the best answer for this. (Organizational Beh.pdfPlease help me what is the best answer for this. (Organizational Beh.pdf
Please help me what is the best answer for this. (Organizational Beh.pdf
 
Please help this code is supposed to evaluate current node state and i.pdf
Please help this code is supposed to evaluate current node state and i.pdfPlease help this code is supposed to evaluate current node state and i.pdf
Please help this code is supposed to evaluate current node state and i.pdf
 
Please IRAC this brief. Terrance and Barbara Moser were married on O.pdf
Please IRAC this brief. Terrance and Barbara Moser were married on O.pdfPlease IRAC this brief. Terrance and Barbara Moser were married on O.pdf
Please IRAC this brief. Terrance and Barbara Moser were married on O.pdf
 
Please help me fix this code! will upvote. The code needs to produce .pdf
Please help me fix this code! will upvote.  The code needs to produce .pdfPlease help me fix this code! will upvote.  The code needs to produce .pdf
Please help me fix this code! will upvote. The code needs to produce .pdf
 
PART 1Net present value represents the difference between the pres.pdf
PART 1Net present value represents the difference between the pres.pdfPART 1Net present value represents the difference between the pres.pdf
PART 1Net present value represents the difference between the pres.pdf
 
Please create a context diagram of the following housing system Y.pdf
Please create a context diagram of the following housing system Y.pdfPlease create a context diagram of the following housing system Y.pdf
Please create a context diagram of the following housing system Y.pdf
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Recently uploaded (20)

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

Question 1A Python list is ��.. set of items.an unorderedan or.pdf

  • 1. Question 1 A Python list is .. set of items. an unordered an ordered a limited an integer Question 2 Which is a valid Python statement? alist = [1; 4; 9; 16] alist = 1: 2: 3: 4] alist = [1, 4, 9, 16] Question 3 A Python list's items can be any Python type. True False Question 4 If squares = [1, 4, 9, 16], what is the value of squares(1] ? an error 1 4 5 Question 5 If squares = [1, 4, 9, 16, 25], what is len(squares)? 4 55 5 1 Question 6 The following statement is valid: alist = [ ]
  • 2. True False Question 7 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 8 What is the output of the following: alist = [1, 4, 9] sum = 0 for value in alist: sum += value print(sum) [1, 5, 14] 0 14 [1, 4, 9] Question 9 If squares = [1, 4, 9, 16, 25], what is the value of squares[1:3] ? [4,91 [4, 9, 16] [1,4] [1, 4, 9] Question 10 If squares = [1, 4, 9, 16, 25], what is the value of squares[:3] ? [1, 4, 9, 16]
  • 3. an error [1, 4, 9] Question 11 If squares = [1, 4, 9, 16, 25], what is the value of squares[2:]? [4,9, 16, 25] an error [1. 41 [9, 16, 25] Question 12 If squares = [1, 4, 9, 16, 25], what is the value of squares[0::2] ? [1, 4] an error [1, 9, 25] [1, 4, 9] Question 13 What function can be used to determine the smallest value in a list? smallest() min() least() minimum() Question 14 Which keyword is used to determine if a value is in a list? contains in has within Question 15 Assuming alist is a list of 4 items, what does this statement do: alist[11 = 2 Insert two items into the list at position 1 Change alist's second item to 2
  • 4. Change alist's first item to 2 Insert an item in a list at position 1 with value 2 Question 16 Which statement can be used to insert an item into a list named alist? alist.insert(item, O) insert(alist, item) alist.insert(O, item) alist <- item Question 17 What method can be used to append a list to the end of another list? augment() extend() concatenate() add() Question 18 Assuming the list squares is set to [1, 4, 9, 16], what statement can be used to remove the value 1 from the list del alist.0 alist.remove(1) remove(alist, 1) remove(alist, O) Ouestion 19 Assuming alist is a list with 4 items, what statement can be used to remove the last item from alist and assignment the variable last to its value? last = alist.pop() last = alist.drop() last = alist[-1] last = alist[0]
  • 5. Question 20 What statement can be used to remove all items from a list named alist? delete alist alist.clear() del alist clear(alist) Question 21 What statement can be used to remove the first item from a list named alist? remove(alist, 0) alist.remove(O) del alist[O] del(alist, O) Question 22 If alist is a list, what method can be used to create a new list with a copy of the items contained in alist? blist = alist.dup() blist = alist copy(alist, blist) blist = alist.copy() Question 23 If alist is a list, what does sorted(alist) do? generates a new ordered list checks if alist is sorted, and return True or False returns the index of the first item out of order updates alist so that its items are in order Question 24 If alist is a list, what does alist.sort( do? checks if alist is sorted =, and return True or False generates a new ordered list updates alist so that its items are in order returns the index of the first item out of order
  • 6. Question 25 If alist is a list, what does alist.reverse do? generates a new list in reverse order checks if alist is reverse sorted, and return True or False updates alist so that its items are in reverse order returns the index of the first item out of order Question 26 A table can be represented as a list of lists. True False Question 27 After a tuple is created, its items can be changed. True False Question 28 Which can be used to create a tuple? square brackets curly braces colons parentheses Question 29 A tuple's items can be access by square brackets, similar to lists. True False