exam study guide Flashcards
(36 cards)
Use ___ for variables and functions (e.g., first_name)
snake_case
Use ___ for classes (e.g., ClassName)
PascalCase
Use ___ for constants (e.g., MAX_VALUE)
UPPERCASE with underscores
Maximum line length:
79 characters
Use _ spaces for indentation
4
___ blank lines between functions
2
(whole numbers)
int
(decimal numbers)
float
(text)
string
(True/False)
Boolean
(mutable, ordered) []
list
Templates for objects
classes
Instances of classes
objects
Classes inheriting properties from other classes
Inheritance:
statements in Python enable the execution of specific code blocks based on whether certain conditions are met.
Conditionals
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.
for loops
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.
while loops
Processing
CPU:
Temporary storage
RAM:
Permanent storage
ROM
Graphics processing
GPU:
White: (255, 255, 255)
Black: (0, 0, 0)
import pygame
pygame.init()
Setup: