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

COMP_1020 PREPARATION TEST 2026 QUESTIONS AND CORRECT ANSWERS GRADED A+

Document preview thumbnail
Preview 2 out of 5 pages

COMP_1020 PREPARATION TEST 2026 QUESTIONS AND CORRECT ANSWERS GRADED A+

Content preview

COMP_1020 PREPARATION TEST 2026
QUESTIONS AND CORRECT ANSWERS
GRADED A+

● Object-Oriented Programming Goals. Answer: Combining data and
actions into an object


● Making Classes. Answer: class X:
sound = "meow"
def __init__(self, ect.)
self.ect = ect
def speak(self)
print("It's", self.ect)


Y = X(ect)
Z = X(ect)
print(y.ect)
print (X.sound)


● Objects are.... Answer: data and actions


● Actions are.... Answer: functions that belong to the class (methods)

, ● Methods can use.... Answer: the data in the object (instance variables)


● Ways to Work with Strings. Answer: Make them
Get a character with an index
Join two strings
Get substrings [1:3]
Loop over a string
Check if a letter is in a string
Check if one string is in another
Check were one string is in another
Make all lowercase/uppercase/ect


● Locate where one string is in another. Answer: name.index("vi") -> 2
(where "v" is located in "David")


● .split(). Answer: splits strings
default splits at spaces, can add letters in the () to change this
Produces lists


● .join(). Answer: Combines strings in a list into a larger string
my_string = " ".join(my_list)

Document information

Uploaded on
March 7, 2026
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.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.
GradeGalaxy
4.3
(16)
Sold
189
Followers
5
Items
58731
Last sold
15 hours 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