Fundementals ( less bloat higher yield )

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

1/83

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:00 AM on 10/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

84 Terms

1
New cards

What is a computer program?

A list of instructions that directs the computer on its operations.

2
New cards

What is programming, and who is a programmer?

Programming is the act of developing a computer program; a programmer is the person who develops it.

3
New cards

What are the six steps in program planning and development, in order?

Problem Analysis, Setting up the Algorithm, Coding, Encoding, Running/Testing/Debugging, Documentation.

4
New cards

What is done in the Problem Analysis step?

Define and understand the problem by analyzing its requirements, constraints, and objectives.

5
New cards

What is done in the Setting up the Algorithm step?

Design a step-by-step plan by breaking the problem into smaller tasks and deciding the logical flow of operations.

6
New cards

What is the difference between Coding and Encoding in program development?

Coding is translating the algorithm into actual Python code; encoding is saving that code into a file with the proper extension (usually .py).

7
New cards

What does Testing involve in program development?

Providing different inputs to the program and verifying that the outputs match expectations.

8
New cards

What does Documentation include?

Comments within the code, a comprehensive description of how the program works, and usage examples.

9
New cards

What is an algorithm?

A process that performs a sequence of operations in order to solve a given problem.

10
New cards

Why is an algorithm needed before writing a program?

Writing a large or good program directly is very difficult; an algorithm serves as the design, just as a building needs a design before construction.

11
New cards

What key idea defines how an algorithm behaves with inputs and outputs?

Given the same input, an algorithm always produces the same output.

12
New cards

What does the "Unambiguous" characteristic of an algorithm require?

Each step and its inputs/outputs must be clear and lead to only one meaning.

13
New cards

How many inputs and outputs should an algorithm have?

0 or more well-defined inputs and 1 or more well-defined outputs.

14
New cards

What does the "Finiteness" characteristic of an algorithm require?

The algorithm must terminate after a finite number of steps.

15
New cards

What does the "Feasible" characteristic of an algorithm require?

It must be feasible with the available resources.

16
New cards

What does the "Independent" characteristic of an algorithm require?

Its step-by-step directions must be independent of any programming code.

17
New cards

What is a flowchart?

A visual diagram that represents the steps of a process or algorithm using standardized symbols connected by arrows.

18
New cards

What are the benefits of using flowcharts?

They visualize complex processes, plan program logic before coding, identify errors early, and improve understanding of control flow.

19
New cards

Which flowchart symbol is the Terminal, and what is its rule?

An oval or rounded rectangle marking the beginning or end; every flowchart must have at least one Start and one End.

20
New cards

Which flowchart symbol represents a Process/Operation?

A rectangle, used for a processing step, calculation, or assignment (e.g., sum = a + b).

21
New cards

Which flowchart symbol represents a Decision?

A diamond, used for branching logic with outcomes such as Yes/No or True/False.

22
New cards

Which flowchart symbol represents Input/Output?

A parallelogram, used for data entering or leaving the process (e.g., reading a value or displaying a result).

23
New cards

Which flowchart symbol represents Preparation?

A hexagon, used for initialization of values (also called the initialization symbol).

24
New cards

What is the difference between an On-Page Connector and an Off-Page Connector?

An on-page connector (circle) links symbols on the same page; an off-page connector links to another page. Both come in pairs.

25
New cards

What is the purpose of flow lines in a flowchart?

They connect symbols and show the direction of flow.

26
New cards

What are the three basic control structures?

Sequence, Selection, and Repetition.

27
New cards

What defines a Sequence structure?

Instructions execute one after another in the exact order they appear, with no steps skipped and no decisions made.

28
New cards

What defines a Selection structure?

It evaluates a condition and executes different paths depending on whether the condition is true (YES) or false (NO).

29
New cards

What defines a Repetition structure?

A block of steps executes multiple times while a condition is true, continuing until the exit condition is met.

30
New cards

How do real programs use the three control structures?

They combine all three: steps flow in order, branch on conditions, and loop until a goal is reached.

31
New cards

What is tracing an algorithm?

Manually following a flowchart or algorithm step by step while tracking variable values and decision outcomes at each stage.

32
New cards

Why is tracing an algorithm useful?

It detects logic errors before coding, builds understanding of flow, is essential for debugging, and confirms correctness with real data.

33
New cards

What are four best practices for designing flowcharts?

Use connectors for complex flows, keep flow top-to-bottom or left-to-right, label decision branches clearly, and avoid crossing lines.

34
New cards

What is Python?

An interpreted, object-oriented, high-level programming language created by Guido van Rossum and released in 1991.

35
New cards

How does Python indicate a code block?

Through indentation.

36
New cards

What is a variable in Python, and when is it created?

A container for storing data values; it is created the moment you first assign a value to it.

37
New cards

What characters may a Python variable name be composed of?

Upper-case or lower-case letters, digits, and the underscore (_).

38
New cards

What must a Python variable name begin with?

A letter; the underscore counts as a letter.

39
New cards

Are Python variable names case-sensitive?

Yes, upper- and lower-case letters are treated as different.

40
New cards

What words can a Python variable name never be?

Python's reserved words/keywords (e.g., if, else, class, while).

41
New cards

What are the four basic data types shown for Python variables?

String, Integer, Float, and Boolean.

42
New cards

What does the print() function do?

It is a built-in function that outputs a specified message to the screen/console.

43
New cards

What does the end keyword argument of print() do?

It sets what is printed at the end of the output instead of the default newline.

44
New cards

What does the sep keyword argument of print() do?

It sets the separator placed between multiple values being printed.

45
New cards

What do the escape sequences \n, \t, \, and \' produce?

\n is a newline, \t is a tab, \ inserts a backslash, and \' inserts a single quote.

46
New cards

What does the input() function do?

It accepts the user's input.

47
New cards

What data type does input() return, and why does that matter?

A string, so it must be cast (e.g., with int()) before being used in numeric operations.

48
New cards

What is casting?

Converting one data type into another.

49
New cards

What do the casting functions int() and str() do?

int() converts a value to an integer; str() converts a value to a string.

50
New cards

What is the difference between the / operator and the // operator?

/ returns the quotient (division); // is floor division, which returns the quotient rounded down to the next smallest whole number.

51
New cards

What does the % operator do?

Modulus: divides the left operand by the right and returns the remainder.

52
New cards

What does the ** operator do?

Exponentiation: raises the left value to the power of the right value.

53
New cards

What is the order of Python operator precedence from highest to lowest?

** first, then unary ~x +x -x, then * / % //, then + -, then comparisons (== !=

54
New cards

What is a string?

A series of characters interpreted as text.

55
New cards

Why must a number be converted with str() when joined to text using +?

The + operator for concatenation only joins strings, so a number must be cast to a string first.

56
New cards

How can you write a string spanning multiple lines?

Enclose it in three double quotes or three single quotes.

57
New cards

What are the three ways to use string placeholders?

The {} with .format(), the % operator, and f-strings (F or f).

58
New cards

What is the difference between {} placeholders with and without numbers?

Empty {} fill in order; numbered placeholders like {0} and {1} fill by the position of the argument given to .format().

59
New cards

What do the placeholders %s and %.2f represent?

%s is a string placeholder; %.2f is a float formatted to two decimal places.

60
New cards

How do you write an f-string?

Put an f before the opening quote and place variable names inside curly braces, e.g., f"Cost {cost}".

61
New cards

What do upper(), lower(), capitalize(), and title() do?

They convert a string to uppercase, to lowercase, the first character to uppercase, and the first character of each word to uppercase, respectively.

62
New cards

What do split(), replace(), and len() do?

split() splits a string at a separator and returns a list; replace() swaps a specified value for another; len() counts the characters in a string.

63
New cards

What are conditional statements also known as, and what do they do?

Decision-making statements; they execute a block of code depending on whether a given condition is true or false.

64
New cards

What are the four decision-making statements in Python?

if, if-else, if-elif-else, and nested if/if-else statements.

65
New cards

What are Python's six relational operators?

== (equal to), != (not equal to), < (less than),

66
New cards

What is the difference between = and == in Python?

= assigns a value to a variable; == compares two values for equality.

67
New cards

What does the not operator do?

It reverses a Boolean value: True becomes False and False becomes True.

68
New cards

When does the and operator return True?

Only when both conditions are True.

69
New cards

When does the or operator return False?

Only when both conditions are False.

70
New cards

What is the precedence order of the logical operators?

not is highest, then and, then or.

71
New cards

What does an if statement consist of?

A Boolean expression (the condition) ending in a colon, followed by indented statements that run only if the condition is True.

72
New cards

Which values does Python treat as TRUE and which as FALSE in a condition?

Non-zero and non-null values are TRUE; zero or null is FALSE.

73
New cards

What are the rules for the colon and indentation in an if statement?

The colon is required and separates the header from the body; the body must be indented, with four spaces as the standard.

74
New cards

Why must indentation be consistent within a block?

Python has no braces, so blocks are defined by line indentation, which is rigidly enforced, and Python 3 does not allow mixing tabs and spaces.

75
New cards

What happens to the indented statements if the if condition is False?

They are skipped, and execution continues with the next instruction at the original indentation level.

76
New cards

What does an else statement do?

It holds the code that runs when the if condition evaluates to False.

77
New cards

What does elif do, and how is it different from else?

elif checks additional conditions and stops at the first one that is true; there can be many elif statements but at most one else.

78
New cards

What is a cascade of if-elif-else statements?

A series of if, elif, and else branches checked in order, where only the first true branch is executed.

79
New cards

What are the rules for using else in a cascade?

else cannot be used without a preceding if, it is optional, and it must be the last branch.

80
New cards

What happens in a cascade if there is no else branch and no condition is true?

None of the branches is executed.

81
New cards

What is nesting in if statements?

Placing one if or if-else statement inside another.

82
New cards

How do you determine which if an else belongs to in nested statements?

Each else pairs with the if at the same indentation level.

83
New cards

What are suites in Python?

Groups of individual statements that make a single code block; compound statements such as if, while, def, and class require a header line and a suite.

84
New cards

What is the purpose of the pass statement?

It is a placeholder for an if statement (or other block) with no content, avoiding an error because such blocks cannot be empty.