Computer Science Signs, Words, Symbols, Methods, and Types

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

1/44

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering core Python signs, keywords, syntax symbols, list and random methods, and data types from the lecture notes.

Last updated 8:54 PM on 10/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

45 Terms

1
New cards

+

Add numbers, or join two strings ('a' + 'b' is 'ab').

2
New cards

–

Subtract.

3
New cards

*

Multiply, or repeat a string ('ab' * 3 is 'ababab').

4
New cards

/

Divide; always gives a decimal (7 / 2 is 3.5).

5
New cards

//

Divide and drop the remainder (7 // 2 is 3).

6
New cards

%

The remainder (7 % 2 is 1).

7
New cards

**

To the power of (3 ** 2 is 9).

8
New cards

=

Assign: store a value in a variable (x = 5).

9
New cards

==

Is equal to; compares two things and gives True or False.

10
New cards

!=

Is NOT equal to.

11
New cards
<

Less than.

12
New cards

>

Greater than.

13
New cards

Less than or equal to.

14
New cards

=

Greater than or equal to.

15
New cards

+=

Add to the variable (total += 2 means total = total + 2).

16
New cards

and

Both sides must be True.

17
New cards

or

At least one side must be True.

18
New cards

not

Flips True to False and False to True.

19
New cards

in

Is it inside? (3 in [1, 2, 3] is True).

20
New cards

def

Define a function.

21
New cards

return

Send a value back to where the function was called, and end the function.

22
New cards

print

Show something on the screen.

23
New cards

input()

Ask the user to type something; always gives back a string.

24
New cards

if

Run the indented code only when the condition is True.

25
New cards

elif

'Else if': checked only if the earlier conditions were False.

26
New cards

else

Runs when none of the earlier conditions were True.

27
New cards

for

Loop: repeat the indented code for each item.

28
New cards

range()

Makes a sequence of numbers; stops BEFORE the last number.

29
New cards

len()

How many items (or characters) there are.

30
New cards

import random

Load the random tools so you can use random.randint and others.

31
New cards

: (colon at the end of a line)

An indented block starts on the next line (after if, for, def).

32
New cards

Indentation

The indented lines belong to the if, for, or def above them.

33
New cards

[ ]

[1, 2, 3] makes a list; nums[0] gets the item at position 0.

34
New cards

-1 (in nums[-1])

The last item in the list.

35
New cards

( )

Function call: the inputs (print(5)); math: do this first; condition: group it.

36
New cards

f'…{x}…'

An f-string: puts the value of x into the text.

37
New cards

:.2f (inside an f-string)

Show the number as a decimal rounded to 2 places.

38
New cards

#

A comment; Python ignores the rest of the line.

39
New cards

append

Adds an item to the end of the list.

40
New cards

pop(i)

Removes the item at position i AND returns it.

41
New cards

insert(i, x)

Puts x at position i; the others shift right.

42
New cards

random.randint(a, b)

Gives a random whole number from a to b, including both ends.

43
New cards

random.choice(list)

Picks one item from the list at random.

44
New cards

int, float, str, and bool

int = whole number (5); float = decimal (5.0); str = text ('5'); bool = True or False.

45
New cards

int(), float(), and str()

Convert a value to that type (int(3.9) is 3; float(2) is 2.0; str(5) is '5').