SlideShare a Scribd company logo
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 isset of items.an unorderedan ordere.pdf

Lists
Lists Lists
Lists
abdullah619
 
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
Rai University
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3
Poojith 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,queue
Rai 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 .pdf
alsofshionchennai
 
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
NeyXmarXd
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3
infanciaj
 
Data Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptxData Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptx
RashidFaridChishti
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptx
Sakith1
 
07 java collection
07 java collection07 java collection
07 java collection
Abhishek Khune
 
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
SeanIC4Jamesn
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
Praveen M Jigajinni
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
pinakspatel
 
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
aamousnowov
 
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
Mahmoud 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.pdf
alivaisi1
 
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
Mahmoud Samir Fayed
 

Similar to Question 1A Python list isset of items.an unorderedan ordere.pdf (20)

Chap10
Chap10Chap10
Chap10
 
Lists
Lists Lists
Lists
 
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
 
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
 
Data Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptxData Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptx
 
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
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
 
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
 
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
 
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
 
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
 
MA3696 Lecture 8
MA3696 Lecture 8MA3696 Lecture 8
MA3696 Lecture 8
 

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.pdf
climatecontrolsv
 
Question 1A Python list is ��.. set of items.an unorderedan or.pdf
Question 1A Python list is ��.. set of items.an unorderedan or.pdfQuestion 1A Python list is ��.. set of items.an unorderedan or.pdf
Question 1A Python list is ��.. set of items.an unorderedan or.pdf
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 
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
climatecontrolsv
 

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 is ��.. set of items.an unorderedan or.pdf
Question 1A Python list is ��.. set of items.an unorderedan or.pdfQuestion 1A Python list is ��.. set of items.an unorderedan or.pdf
Question 1A Python list is ��.. set of items.an unorderedan or.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

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 

Recently uploaded (20)

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 

Question 1A Python list isset of items.an unorderedan ordere.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:
  • 2. 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] ?
  • 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
  • 4. 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]
  • 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