Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Purdue CNIT 155 Final Exam (Python) ACTUAL QUESTIONS AND CORRECT ANSWERS

Beoordeling
-
Verkocht
-
Pagina's
27
Cijfer
A+
Geüpload op
24-10-2025
Geschreven in
2025/2026

Purdue CNIT 155 Final Exam (Python) ACTUAL QUESTIONS AND 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

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Purdue CNIT 155 Final Exam (Python)
ACTUAL QUESTIONS AND 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]

Geschreven voor

Vak

Documentinformatie

Geüpload op
24 oktober 2025
Aantal pagina's
27
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$11.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
GENIOUSTOPCLASS
3.0
(1)

Maak kennis met de verkoper

Seller avatar
GENIOUSTOPCLASS Stanford
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1
Lid sinds
10 maanden
Aantal volgers
0
Documenten
1857
Laatst verkocht
7 maanden geleden
ACADEMIC EXAMS PLATFORM

I create high-quality, easy-to-understand academic documents to help students learn faster and perform better. My materials are well-researched, clearly organized, and cover key exam topics to make studying simple and effective.

3.0

1 beoordelingen

5
0
4
0
3
1
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen