• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 14 pages
Exam (elaborations)

Python Programming Exam Review Questions With Verified Answers

Document preview thumbnail
Preview 2 out of 14 pages

how do we add a list to a list? - Answer list[2] = [1, 2, 3] how do we ad elements of a list to a list? - Answer list[2:2] = [1,2,3] how do we delete elements from a list? - Answer del list[1] what's another way of deleting elements from a list, besides del? - Answer list[1] = [] what does 3 * [0] return? - Answer [0,0,0] if you really want to copy a list, what can you do? - Answer list2 = list1[:] difference between append and extend? - Answer append adds whole argument as single element, while extend adds each item of argument as element how to insert exactly one element? - Answer t(position, element) what does remove do to a list? - Answer removes first element in list with given value what does () do? - Answer what does () do? - Answer what does () do? - Answer what does (key) return if the key exists? - Answer the value of the key what does (key) return if the key does not exist? - Answer None what kind of objects do dictionary methods return? - Answer view what are the three dictionary methods? - Answer keys(), values(), items() what is the advantage of returning dictionary methods as view objects rather than as lists? - Answer thye are dynamic and reflect changes to the dictionary define list - Answer collection of different objects indexed by numbers what is the big difference between strings and lists? - Answer strings are immutable, lists are mutable what is the difference between list[2] = [1,2,3] and list[2:2] = [1,2,3]? - Answer [2] adds as list, [2:2] adds as separate elements how many elements does list[2:3] represent? - Answer one where does a slice end? - Answer right before the second index of the slice how do you remove element three from a list by slicing? - Answer list[2:3] = [] is len a function or a method? - Answer function how to find the length of a list? - Answer len(list) what do we have to know about the operands of list operators? - Answer both must be lists how to determine whether a value is an element of list? - Answer element in list what does in do? - Answer determines whether element is in list what does in operator return if element is fond? - Answer TRUE what does in return if element is not found? - Answer FALSE how do you return an entire list by slicing? - Answer list[:] how do you reverse the order of elements of a list in place? - Answer se() what are two situations for which tuples can be used but lists cannot? - Answer % formatting, dictionary keys how do you get a dictionary value - Answer dict[key] what are strings? - Answer collection of characters that are stored together what do strings represent? - Answer arbitrary text what are three ways of creating strings from text? - Answer single, double, triple quotes what are two ways to make multiline strings? - Answer triple quotes, backslash backspace - Answer b horizontal tab - Answer t vertical tab - Answer v newline - Answer n bell - Answer a formfeed - Answer f char escape for carriage return - Answer r null terminator - Answer 0 octal escape for ascii - Answer 0nn hex escape for ascii - Answer xnn escape - Answer e what can you put at the beginning of a string when you want escape characters interpreted literally? - Answer r'' what does + do to strings? - Answer concatenate


Document information

Uploaded on
February 7, 2024
Number of pages
14
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

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

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.
Grademasters
3.8
(46)
Sold
118
Followers
69
Items
2591
Last sold
1 month ago



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

Whoops! We can’t load your doc right now. Try again or contact support.