Methods - Computational Thinking

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:01 AM on 10/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

.partition(sep)

String method - Split the string at the last occurance of sep — 3-tuple

2
New cards

.just(width[fillchar]) (left or right)

String method - Return the string justified in a string of width

3
New cards

.index(sub[, start[, end]])

String method - Like find() — finds a substring within a string — but raises an error when the value is not found

4
New cards

.replace(old, new [, count])

String method - Return a copy of a string with a replaced substring at ALL occurances

5
New cards

.join()

List method - Concatenates a list of elements

6
New cards

.split(sep = None, maxsplit = -1)

String/List Method - Separates string into individual elements

  • Returns a list of words in a string, sep is the delimiter


7
New cards

.remove()

List method - Removed the value without the index

8
New cards

.del()

List method - Removed unneeded listed value

9
New cards

.pop()

List & Dictionary method - Modifies a listed item w/ a given index; removes w/ a specified index

  • Retrieve the item at index and also remove it from sequence. By default, the last item in sequence is removed and returned.


10
New cards

.sort()

List Method - Arranges the list from low to high

11
New cards

.extend()

List Method - Takes a list and appends all arguments

12
New cards

.append()

List Method - Adds a new element to the end of a list

13
New cards

.lower()

String Method - Lowercases

14
New cards

.startswith(prefix[, start[, end]])

String Method - Boolean value if it starts with it

15
New cards

.strip()

String Method - Removes white space

16
New cards

.find(sub, [start, [end]])

String Module - finds substrings

  • Return the first index where the substring is found


17
New cards

.endswith(suffix, [start, [end]])

String Method - Boolean value if it ends with it

18
New cards

.count(sub[, start[, end]])

String Method - Returns the number of occurrences of a substring

19
New cards

.capitalize()

String Method - Return the 1st letter of a string as capitalized and the rest lowercase

20
New cards

.casefold()

String Method - Return a case folded copy of the string

21
New cards

.center(width, fillchar = ‘‘)

String Method - Return centered in a string of length “width”

22
New cards

.read()

File Method - Reads through a file

23
New cards

.readline()

File Method - Reads through one individual line

24
New cards

.write()

File Method - Adds a text string to an open file; rewrites it each time

25
New cards

.open()

File Method - Opens a file

26
New cards

.close()

File Method - Closes a file

27
New cards

.punctuation()

String Method - Predefined string constant of punctuation values

28
New cards

.translate()

String Method - Specified characters are replaced of removed

29
New cards

.values()

Dictionary Method - Returns a list of all the values in a dictionary

30
New cards

.keys()

Dictionary Method - Returns a list of the dictionary’s keys

31
New cards

.items()

Dictionary/Tuple Method - Returns a list containing a tuple for each key value pair

32
New cards

.get()

Dictionary Method - Returns the value of the specified key

33
New cards

.update()

Dictionary Method - Updates the dictionary with the specified key-value pairs

34
New cards

.popItem()

Dictionary Method - Removes the last inserted key-value pair

35
New cards

.clear()

Dictionary Method - Removes all the elements from the dictionary

36
New cards

.copy()

Dictionary Method - Returns a copy of the dictionary

37
New cards

.fromkeys()

Dictionary Method - Returns a dictionary with the specified keys and value