Every Command ON Compsci Test

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 40

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

41 Terms

1

print()

Outputs text to the console or terminal.

New cards
2

str()

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

New cards
3

int()

Converts a value to an integer.

New cards
4

math.sqrt()

Calculates the square root of a number.

New cards
5

math.pow()

Raises a number to the power of another number.

New cards
6

math.floor()

Rounds a number down to the nearest integer.

New cards
7

math.ceil()

Rounds a number up to the nearest integer.

New cards
8

round()

Rounds a number to a specified number of decimal places.

New cards
9

math.abs()

Returns the absolute value of an integer.

New cards
10

math.fabs()

Returns the absolute value of a floating point number.

New cards
11

random.randint()

Generates a random integer between two specified values.

New cards
12

random.uniform()

Generates a random float between two specified values.

New cards
13

random.choice()

Selects a random item from a list.

New cards
14

find()

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

New cards
15

index()

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

New cards
16

rfind()

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

New cards
17

replace()

Replaces an old substring with a new substring.

New cards
18

center()

Returns a centered string within a specified number of spaces.

New cards
19

count()

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

New cards
20

swapcase()

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

New cards
21

len()

Returns the number of characters in a string.

New cards
22

lstrip()

Removes leading whitespace from a string.

New cards
23

rstrip()

Removes trailing whitespace from a string.

New cards
24

strip()

Removes whitespace from both ends of a string.

New cards
25

islower()

Returns True if all letters are lowercase.

New cards
26

isupper()

Returns True if all letters are uppercase.

New cards
27

isalpha()

Returns True if the string contains only letters.

New cards
28

isdigit()

Returns True if the string contains only digits.

New cards
29

isalnum()

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

New cards
30

isspace()

Returns True if the string contains only whitespace characters.

New cards
31

startswith()

Returns True if the string starts with a specified value.

New cards
32

endswith()

Returns True if the string ends with a specified value.

New cards
33

isidentifier()

Returns True if the string is a valid identifier.

New cards
34

append()

Adds an item to the end of a list.

New cards
35

insert()

Inserts an item at a specified index in a list.

New cards
36

extend()

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

New cards
37

remove()

Removes the first occurrence of an item from the list.

New cards
38

pop()

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

New cards
39

reverse()

Reverses the order of items in the list.

New cards
40

sort()

Sorts the elements of the list in ascending order.

New cards
41

copy()

Creates a shallow copy of the list.

New cards

Explore top notes

note Note
studied byStudied by 14 people
1005 days ago
4.0(1)
note Note
studied byStudied by 162 people
624 days ago
5.0(1)
note Note
studied byStudied by 16 people
122 days ago
5.0(1)
note Note
studied byStudied by 22 people
743 days ago
5.0(1)
note Note
studied byStudied by 61 people
882 days ago
4.0(1)
note Note
studied byStudied by 8 people
176 days ago
5.0(1)
note Note
studied byStudied by 10 people
898 days ago
5.0(1)
note Note
studied byStudied by 255 people
686 days ago
4.8(9)

Explore top flashcards

flashcards Flashcard (127)
studied byStudied by 31 people
911 days ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 19 people
266 days ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 8 people
784 days ago
5.0(1)
flashcards Flashcard (28)
studied byStudied by 29 people
737 days ago
5.0(2)
flashcards Flashcard (67)
studied byStudied by 9 people
837 days ago
5.0(1)
flashcards Flashcard (315)
studied byStudied by 51 people
763 days ago
5.0(4)
flashcards Flashcard (29)
studied byStudied by 15 people
379 days ago
5.0(1)
flashcards Flashcard (26)
studied byStudied by 84 people
17 days ago
5.0(1)
robot