exam study guide Flashcards

(36 cards)

1
Q

Use ___ for variables and functions (e.g., first_name)

A

snake_case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Use ___ for classes (e.g., ClassName)

A

PascalCase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Use ___ for constants (e.g., MAX_VALUE)

A

UPPERCASE with underscores

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Maximum line length:

A

79 characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Use _ spaces for indentation

A

4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

___ blank lines between functions

A

2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(whole numbers)

A

int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(decimal numbers)

A

float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

(text)

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

(True/False)

A

Boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

(mutable, ordered) []

A

list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Templates for objects

A

classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Instances of classes

A

objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Classes inheriting properties from other classes

A

Inheritance:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

statements in Python enable the execution of specific code blocks based on whether certain conditions are met.

A

Conditionals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

a control flow statement that iterates over a sequence of items, such as a list, tuple, string, or range. It executes a block of code for each item in the sequence.

17
Q

repeatedly executes a block of code as long as a specified condition remains true. It’s useful when the number of iterations needed is not known in advance.

18
Q

Processing

19
Q

Temporary storage

20
Q

Permanent storage

21
Q

Graphics processing

22
Q

White: (255, 255, 255)

23
Q

Black: (0, 0, 0)

24
Q

import pygame
pygame.init()

25
Creating window:
pygame.display.set_mode()
26
pygame.draw.rect()
drawing a rect
27
pygame.display.update()
Updates:
28
time control
pygame.time.Clock()
29
list[index]
Access:
30
First element:
list[0]
31
Empty list:
[] or list()
32
Length list:
len(list)
33
Concatenation:
str1 + str2
34
Multiplication:
str * n
35
Length string:
len(string)
36
.lower(), .upper()
Methods: