Fianl Flashcards

0
Q

What adds element to the end of the list?

A

append()

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

What is a python file extension called?

*It also indicates that it is a python program/module…

A

.py

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

What is the assignment operator?

A

a single equal sign

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

What are the boolean values?

A

True or False

True and False are capitalized

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

When you use multiple nested if statements, the path that the program follows is known as…?

A

Branching

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

Cartesian coordinate system

A

x and y axes coordinates (graphs use them)

X increases as you go right
Y increases as you go down
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The description or blueprint of an object is?

A

Class

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

Knowing when two sprites are touching or overlapping is?

A

Collision detection

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

Commenting

A

Use a # to create a single-line comment

Gets ignored by the interpreter

A triple quoted string can be used (“““hey”””) for multiple lines

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

Comparison operators

A

==, , =, !=

be able to name 3 of the 6 - (> goes before =)

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

What does an event-driven program do?

A

It waits for instructions

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

What is something that stores data; you can read or write?

A

A file

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

What type of loop is used to loop over a list of values?

A

for loop

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

How do you pass an argument to a function?

A

you call the function and put the argument in the parentheses

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

function creation

A

You create or define a function with Python’s def

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

How is a global variable defined?

A

they are defined outside of functions

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

What does GUI stand for?

A

Graphical User Interface.

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

What is not not able to be changed (like a tuple)

A

Immutable

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

What does import do?

A

imports a python module

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

An indentation must be…

20
Q

What does int() do?

A

can convert a string to an integer

don’t leave off ()

21
Q

Each time a loop is called a…

22
Q

a pygame event that senses when you release any key is a…?

23
Q

To create a list you use _______ brackets.

A

Square

Example: name = []

24
Each element has an _____, the first is __.
Index, 0
25
What is a pygame event that detects mouse motion
MOUSE MOTION
26
What are two characteristics to an object (created by a class) - attributes (facts about object - red, etc.) and methods (functions that the object performs)
Object attributes
27
Objects have two components, they are...?
Attributes and methods
28
Class is the...?
Blueprint
29
assigning a variable to something that it was not initialized as
Overwriting a variable
30
What do you do when you pass arguments to functions?
Put in parentheses with function call
31
Which python module makes storing things like lists easier?
Pickle
32
What does pixel stand for?
Picture element
33
What takes (removes) the last item of a list and gives it back to you?
pop()
34
What allows you to use random number generation in your program.
Random module
35
What numbers would be added to the list if you added in the range function?
Does not add last number
36
What is the purpose of raw_input?
takes a string from the user
37
Colors that hold value of red, green, and blue for every pixel are what?
RGB color
38
The three sound formats are?
.mid, .wav, .mp3
39
What is a two-dimensional image that is integrated into a larger scene.
Sprite
40
Modules that come defaultly with python?
Standard modules
41
What does str() do?
Turns something into a string
42
When you join two strings together use what?
+ and -
43
How do you create a string?
myString = "test" Make sure to use quotes
44
What is the definition of a timer?
it generates an event at regular intervals
45
What is something that can hold a value that changes?
Variable
46
What is almost the same as speed?
Velocity
47
While loops
A type of loop