Every Command ON Compsci Test

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

1/40

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:31 AM on 1/7/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

41 Terms

1
New cards

print()

Outputs text to the console or terminal.

2
New cards

str()

Converts any value (usually a number) to a string.

3
New cards

int()

Converts a value to an integer.

4
New cards

math.sqrt()

Calculates the square root of a number.

5
New cards

math.pow()

Raises a number to the power of another number.

6
New cards

math.floor()

Rounds a number down to the nearest integer.

7
New cards

math.ceil()

Rounds a number up to the nearest integer.

8
New cards

round()

Rounds a number to a specified number of decimal places.

9
New cards

math.abs()

Returns the absolute value of an integer.

10
New cards

math.fabs()

Returns the absolute value of a floating point number.

11
New cards

random.randint()

Generates a random integer between two specified values.

12
New cards

random.uniform()

Generates a random float between two specified values.

13
New cards

random.choice()

Selects a random item from a list.

14
New cards

find()

Returns the index position of a character/substring starting from 0; returns -1 if not found.

15
New cards

index()

Returns the index position of a value searched starting from 0; raises an error if not found.

16
New cards

rfind()

Returns the position of the last occurrence of a value being searched; returns -1 if not found.

17
New cards

replace()

Replaces an old substring with a new substring.

18
New cards

center()

Returns a centered string within a specified number of spaces.

19
New cards

count()

Returns the number of times a specific character occurs in a string.

20
New cards

swapcase()

Returns a string where lowercase letters become uppercase and vice versa.

21
New cards

len()

Returns the number of characters in a string.

22
New cards

lstrip()

Removes leading whitespace from a string.

23
New cards

rstrip()

Removes trailing whitespace from a string.

24
New cards

strip()

Removes whitespace from both ends of a string.

25
New cards

islower()

Returns True if all letters are lowercase.

26
New cards

isupper()

Returns True if all letters are uppercase.

27
New cards

isalpha()

Returns True if the string contains only letters.

28
New cards

isdigit()

Returns True if the string contains only digits.

29
New cards

isalnum()

Returns True if the string contains only letters and/or digits.

30
New cards

isspace()

Returns True if the string contains only whitespace characters.

31
New cards

startswith()

Returns True if the string starts with a specified value.

32
New cards

endswith()

Returns True if the string ends with a specified value.

33
New cards

isidentifier()

Returns True if the string is a valid identifier.

34
New cards

append()

Adds an item to the end of a list.

35
New cards

insert()

Inserts an item at a specified index in a list.

36
New cards

extend()

Adds elements from another list to the end of the current list.

37
New cards

remove()

Removes the first occurrence of an item from the list.

38
New cards

pop()

Removes and returns an item at a specified index from the list.

39
New cards

reverse()

Reverses the order of items in the list.

40
New cards

sort()

Sorts the elements of the list in ascending order.

41
New cards

copy()

Creates a shallow copy of the list.