• 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 15 pages
Exam (elaborations)

Python exam review questions and answers

Document preview thumbnail
Preview 2 out of 15 pages

Python exam review questions and answers What are 4 commands provided by shutil? - ANSWERS-copyfile, copy, copytree, rmtree What is the symlinks argument? - ANSWERS-An argument for copytree, decides whether to copy symbolic links or actual files How do you save things with pickle? - ANSWERS-pkl = pickle.Pickler(file); (something), () How do you load pickled information? - ANSWERS-(file) How do you shelve a file? - ANSWERS-(file) What does CGI stand for? - ANSWERS-common gateway interface How do you open a URL? - ANSWERS-en(url) How do you define a class? - ANSWERS-class Class: how do we add a list to a list? - ANSWERS-list[2] = [1, 2, 3] how do we ad elements of a list to a list? - ANSWERS-list[2:2] = [1,2,3]

Content preview

Python exam review questions and
answers15

What are 4 commands provided by shutil? - ANSWERS-copyfile, copy, copytree, rmtree



What is the symlinks argument? - ANSWERS-An argument for copytree, decides whether to
copy symbolic links or actual files



How do you save things with pickle? - ANSWERS-pkl = pickle.Pickler(file); pkl.dump(something),
file.close()



How do you load pickled information? - ANSWERS-pickle.load(file)



How do you shelve a file? - ANSWERS-shelve.open(file)



What does CGI stand for? - ANSWERS-common gateway interface



How do you open a URL? - ANSWERS-urllib.request.urlopen(url)



How do you define a class? - ANSWERS-class Class:



how do we add a list to a list? - ANSWERS-list[2] = [1, 2, 3]



how do we ad elements of a list to a list? - ANSWERS-list[2:2] = [1,2,3]

, how do we delete elements from a list? - ANSWERS-del list[1]



what's another way of deleting elements from a list, besides del? - ANSWERS-list[1] = []



what does 3 * [0] return? - ANSWERS-[0,0,0]



if you really want to copy a list, what can you do? - ANSWERS-list2 = list1[:]



difference between append and extend? - ANSWERS-append adds whole argument as single
element, while extend adds each item of argument as element



how to insert exactly one element? - ANSWERS-list.insert(position, element)



what does remove do to a list? - ANSWERS-removes first element in list with given value



what does list.sort() do? - ANSWERS-



what does list.index() do? - ANSWERS-



what does list.count() do? - ANSWERS-



what does dict.get(key) return if the key exists? - ANSWERS-the value of the key



what does dict.get(key) return if the key does not exist? - ANSWERS-None



what kind of objects do dictionary methods return? - ANSWERS-view

Document information

Uploaded on
November 15, 2025
Number of pages
15
Written in
2025/2026
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.
Bensuda
3.7
(166)
Sold
915
Followers
445
Items
23071
Last sold
2 days 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