Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Purdue CNIT 155 Final Exam (Python) || with 100% correct answers.

Rating
-
Sold
-
Pages
24
Grade
A+
Uploaded on
27-05-2025
Written in
2024/2025

What is a List? correct answers A data structure that can store many values of under one name Which is an example of how to create an empty list? correct answers Variable = [] Variable = list() Which is an example of how to create a list with predefined values? correct answers colors = ["red, "yellow", "blue"] To create a list with predefined values, you have to.... correct answers Put a sequence of items in [] What does d(elem) do? correct answers Adds a single element to the end of the list What does t(index, elem) do? correct answers Inserts the element elem at the given index, shifting elements to the right What does d(list2) do? correct answers Add the elements in list2 to the end of the list. T or F: The extend method is not only used with a list. correct answers False T or F: Using + or += on a list is similar to using the extend method. correct answers True How do you access the individual element in a list using an index? correct answers list1[index]

Show more Read less
Institution
Purdue CNIT 155
Course
Purdue CNIT 155

Content preview

Purdue CNIT 155 Final Exam (Python) || with 100% correct
answers.

What is a List? correct answers A data structure that can store many values of under one name


Which is an example of how to create an empty list? correct answers Variable = []
Variable = list()


Which is an example of how to create a list with predefined values? correct answers colors =
["red, "yellow", "blue"]


To create a list with predefined values, you have to.... correct answers Put a sequence of items in
[]


What does list1.append(elem) do? correct answers Adds a single element to the end of the list


What does list1.insert(index, elem) do? correct answers Inserts the element elem at the given
index, shifting elements to the right


What does list1.extend(list2) do? correct answers Add the elements in list2 to the end of the list.


T or F: The extend method is not only used with a list. correct answers False


T or F: Using + or += on a list is similar to using the extend method. correct answers True


How do you access the individual element in a list using an index? correct answers list1[index]

,What are characteristics of Positive Indexes? correct answers First element in the list has index 0,
second element has index 1, and n'th element is n-1


What are characteristics of Negative Indexes? correct answers Identify positions relative to the
end of the list, index -1 identifies the last element, and -2 identifies the next to last element, etc.


What does Function do? correct answers Is a description


What does len do? correct answers Returns the number of items in the list


What does min do? correct answers Returns the minimum among the elements in the list


What does max do? correct answers Returns the maximum among the elements in the list


What does sum do? correct answers Returns the sum of all the elements in the list. (applies to list
of numerical values only)


Given a list, you may use ________ to randomize the order of the elements in a list. correct
answers Shuffle


What do you type to import the shuffle function and use the shuffle function with a list? correct
answers from random import shuffle
shuffle(list1)


You can refer to elements of a list using the... correct answers Subscript syntax


T or F: The code below makes third have a value of 83.0


scores = [75.0, 68.5, 83.0]

, third = scores[2] correct answers True


T or F: Negative indices count from the right end. correct answers True


What is the value of third after running the code below?


scores = [75.0, 68.5, 83.0]
third = scores[-1] correct answers 83.0


Which is an example of negative indices? correct answers scores = [75.0, 68.5, 83.0]
third = scores[-1]


Which is an example of positive indices? correct answers scores = [75.0, 68.5, 83.0]
third = scores[2]


Slicing gives a... correct answers List of elements


Subscripting gives a... correct answers Single element


Which is an example of slicing a list? correct answers scores = [68.5, 83.0]
exams = scores[1:3]


T or F: Each list is an object. correct answers True


Which is an example of how you call a list method? correct answers
list.methodName(arguments)

Written for

Institution
Purdue CNIT 155
Course
Purdue CNIT 155

Document information

Uploaded on
May 27, 2025
Number of pages
24
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SirAnton NURSING, ECONOMICS, MATHEMATICS, BIOLOGY, AND HISTORY MATERIALS BEST TUTORING, HOMEWORK HELP, EXAMS, TESTS, AND STUDY GUIDE MATERIALS WITH GUARANTEED A+ I am a dedicated medical practitioner with diverse knowledge in matters
Follow You need to be logged in order to follow users or courses
Sold
786
Member since
3 year
Number of followers
438
Documents
38919
Last sold
4 days ago
Reign Supreme Scholarly || Enlightened.

Get your revised study materials available here and elevate your educational outcomes. I have numerous verified learning materials (Research, Exams Questions and answers, Assignments, notes etc) for different courses guaranteed to boost your academic results. I am dedicated to offering you the best and unique learning content. You are encouraged to inquire further assistance from this end whenever need be. Kindly remember to leave your review, understanding your satisfaction is essential . We highly appreciate clients who always come back for more of the study content we offer, you are extremely valued. All the best.

Read more Read less
3.7

116 reviews

5
49
4
20
3
23
2
8
1
16

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions