CoPro1 HN Sem 1 Exam Study Guide

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

1/68

encourage image

There's no tags or description

Looks like no tags are added yet.

69 Terms

1
New cards

Class

A blueprint for creating objects with specific attributes and methods.

2
New cards

Constructor

A method used to create an instance of a class.

3
New cards

Object

An instance of a class with properties and behaviors.

4
New cards

Instance

A specific realization of a class.

5
New cards

Signature

The parameters required for a constructor or method.

6
New cards

Attribute

A variable contained within an object.

7
New cards

Accessor

A method that retrieves or 'gets' an object's attribute.

8
New cards

Mutator

A method that changes or 'sets' an object's attribute.

9
New cards

Color

A class used to create color objects using RGB values or color names.

10
New cards

Red (R)

The red component of an RGB color.

11
New cards

Green (G)

The green component of an RGB color.

12
New cards

Blue (B)

The blue component of an RGB color.

13
New cards

Random

A Python module used to generate random numbers.

14
New cards

randint()

Returns a random integer between two inclusive values.

15
New cards

randrange()

Returns a random number in a specified range, but the end is exclusive.

16
New cards

Inclusive

Includes the boundary value.

17
New cards

Exclusive

Does not include the boundary value.

18
New cards

Expression

A combination of values, variables, and operators that evaluate to a value.

19
New cards

Conditional

Code that runs only if a specific condition is met.

20
New cards

Boolean

A data type with two possible values: True or False.

21
New cards

Comparison Operators

Operators used in expressions to compare values, including <, >, <=, >=, ==, !=.
22
New cards

if-statement

A conditional statement that executes a block of code if a condition is True.

23
New cards

elif-statement

A conditional statement that follows an if, executed if the if condition is False and its condition is True.

24
New cards

else-statement

Executes a block of code if all previous if and elif conditions are False.

25
New cards

and

Logical operator that requires both conditions to be True.

26
New cards

or

Logical operator that requires at least one condition to be True.

27
New cards

Function

A block of code that performs a specific task when called.

28
New cards

Method

A function that belongs to an object and is called on that object.

29
New cards

Parameter

A variable used in a function definition to accept input.

30
New cards

Return

A value that a function sends back to the caller.

31
New cards

Contains Method

Determines if a point (like the mouse) is inside an object.

32
New cards

Overlaps Method

Checks if two objects are touching or overlapping.

33
New cards

Loop

Repeats a block of code while a condition is True.

34
New cards

While Loop

A loop that continues to execute as long as a specified condition is True.

35
New cards

For Loop

A loop that iterates over a range or a list of items.

36
New cards

Range()

A function used to generate a sequence of numbers.

37
New cards

Iteration

A single pass through a loop.

38
New cards

Indexing Variable

A variable used to keep track of a position in a loop (often i or j).

39
New cards

Text

A class in pyDraw used to create and display text on the screen.

40
New cards

String

A sequence of characters enclosed in quotes (e.g., 'Hello', 'World').

41
New cards

List

A data structure that stores multiple items in a single variable.

42
New cards

Index

The position of an element in a list (starting from 0).

43
New cards

Element

An individual item in a list.

44
New cards

List Construction

The process of creating a list using square brackets (e.g., [1, 2, 3]).

45
New cards

append()

Adds an element to the end of a list.

46
New cards

count()

Counts how many times a specified value appears in a list.

47
New cards

index()

Returns the position of the first occurrence of a specified value in a list.

48
New cards

insert()

Adds an element at a specified index in a list.

49
New cards

pop()

Removes and returns an element from a specified position in a list.

50
New cards

remove()

Removes the first occurrence of a specified value from a list.

51
New cards

len()

Returns the number of elements in a list.

52
New cards

Algorithm

A step-by-step set of instructions to solve a problem.

53
New cards

Centering Algorithm (Two-step)

A method to center an object inside another object using relative positioning.

54
New cards

Centering Algorithm (Single-step)

A simpler way to center an object using the .center() method.

55
New cards

Odd/Even Check

Uses modulus (% 2) to check if a number is odd or even.

56
New cards

Bouncing Object Algorithm

Changes the direction of an object when it hits the screen edge.

57
New cards

<

Less than.

58
New cards

>

Greater than.

59
New cards

<=

Less than or equal to.

60
New cards

>=

Greater than or equal to.

61
New cards

==

Equal to.

62
New cards

!=

Not equal to.

63
New cards

%

Modulus operator (remainder of a division).

64
New cards

+

Addition operator.

65
New cards

-

Subtraction operator.

66
New cards

*

Multiplication operator.

67
New cards

/

Division operator.

68
New cards

=

Assignment operator.

69
New cards

+=

Increment operator (adds a value to a variable).