Computer Science

0.0(0)
studied byStudied by 2 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/145

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

146 Terms

1
New cards

Problem solving

Coding helps you become better at problem-solving as it teaches you to breakdown problems into a logical structured format

2
New cards

Coding on the job

Coding might be required to perform small tasks that a program can't handle automatically

3
New cards

Understanding of how Software works

Understanding how Software works helps you learn how to apply it better when coding to solve problems

4
New cards

Learning to be persistent

Coding helps you stick to problems when solving them instead of giving up

5
New cards

You can talk about technology effectively

You can communicate about coding and technology terms effectively as you start to understand them

6
New cards

Hardware

Physical components of a computer

7
New cards

Central Processing Unit (CPU)

8
New cards

Memory or Random Access Memory (RAM)

9
New cards

Inputs

keyboard, mouse

10
New cards

Output

monitor or printer

11
New cards

Software

The computer programs when creating software, most programs follow the data processing cycle this data processing cycle consists of input, processing, and output

12
New cards

Algorithm

A set of general steps to solve a problem

13
New cards

Inputs

Zero or more well-defined data items that must be provided to the algorithm

14
New cards

Output

One or more well-defined results produced by the algorithm

15
New cards

Definiteness

The algorithm must specify every step and the order the steps must be taken in the process

16
New cards

Effectiveness

Every step must be feasible

17
New cards

Finiteness

The algorithm must eventually stop

18
New cards

Program

A set of instructions that tell the computer what it's supposed to do

19
New cards

Programming

The steps taken to prepare these instructions

20
New cards

High-level programming languages

High level programming languages usually translate into several machine language instructions first, a software called a compiler translates programs fully into machine language An interpreter program reads one instruction at a time, and determines how to carry out the required action

21
New cards

Flowchart

A visual representation of a problem solution

22
New cards

Ellipse

Start/End

23
New cards

Parallelogram

Inputs/Outputs

24
New cards

Rectangle

Formulas/Actions

25
New cards

Diamond

Decisions

26
New cards
Python
An introductory programming language that emphasizes code readability.
27
New cards
Object-Oriented
Python is object-oriented, meaning data is stored as objects with properties and functions.
28
New cards
Interpreter
Python uses an interpreter to translate high-level code into machine-readable form for the CPU to execute.
29
New cards
" >>> "
The screen prompt that indicates the environment is waiting for a Python expression or instruction.
30
New cards
Syntax
Python uses syntax highlighting, which are the rules of the language.
31
New cards
Print
A function used to display output in Python, with content inside parentheses.
32
New cards
Comments
Lines starting with the pound sign (#) are comments, which are used to explain the code.
33
New cards
Input Function
Used to get input from the user via the keyboard.
34
New cards
Prompt
The parameter for the input function that displays a hint for the user about what to enter.
35
New cards
Numeric Data
Represents numbers and fractions; involves numeric operators.
36
New cards
Order of Operations
Math operations in Python follow the standard order of operations (PEMDAS).
37
New cards
Variable
A named memory location used to store data.
38
New cards
Float Value
A data type used for decimal numbers, such as a grade point average or bank account balance.
39
New cards
INT
A data type used for whole numbers, like age or golf score.
40
New cards
Assignment Statement
Used to assign a value to a variable.
41
New cards
1. if Statement
A control flow statement that executes a block of code if a specified condition is True.
42
New cards
2. Condition
An expression that evaluates to either True or False. Conditions determine whether a specific block of code will be executed.
43
New cards
3. Comparison Operators
Operators used to compare two values. The result is a Boolean value (True or False).
44
New cards
==
Equal to
45
New cards
<
Less than
46
New cards
>
Greater than
47
New cards
!=
Not equal to
48
New cards
Less than or equal to
49
New cards
>=
Greater than or equal to
50
New cards
4. Indentation
The use of spaces or tabs to define blocks of code in Python. Indentation groups statements together to form code blocks.
51
New cards
5. bool Data Type
A data type representing Boolean values, which can either be True or False.
52
New cards
6. if-else Statement
A control flow statement that executes one block of code if a condition is True, and another block if the condition is False.
53
New cards
7. Compound Conditions
Conditions that combine two or more individual conditions using logical operators such as and, or, and not.
54
New cards
8. elif Statement
Short for "else if", it allows checking multiple conditions in sequence, running only the first True condition.
55
New cards
9. else Statement
A statement that defines an action to be executed if none of the preceding conditions in an if or elif are True.
56
New cards
10. Nested if Statements
A situation where one if statement is placed inside another, allowing for multiple levels of decision-making.
57
New cards
11. not Operator
A logical operator that negates a condition, reversing its Boolean value (True becomes False, and False becomes True).
58
New cards
12. Flowchart
A diagram that represents the logical flow of a program or algorithm, using symbols to depict decisions, processes, and actions.
59
New cards
13. Sequence
A programming construct where instructions are executed one after the other in a specific order.
60
New cards
14. Repetition (Loops)
A programming construct that repeats a block of code multiple times, usually based on a condition or a range of values.
61
New cards
15. Algorithm
A set of defined steps or instructions used to solve a specific problem or perform a task.
62
New cards
16. Program
A collection of instructions written in a programming language that a computer can execute to perform a specific task.
63
New cards
17. while Loop
A control flow statement in Python that repeatedly executes a block of code as long as a specified condition remains true. It checks the condition before running the block.
64
New cards
18. Infinite Loop
A loop that never ends because the condition never becomes false. This typically occurs when the variable in the condition is not updated correctly.
65
New cards
19. for Loop
A control flow statement in Python used to iterate over a sequence (such as a list, range, or string). It automatically moves to the next element in the sequence with each iteration.
66
New cards
20. range() Function
A built-in Python function that generates a sequence of numbers. It is commonly used with the for loop to specify the range of numbers to iterate over.
67
New cards
21. Condition
A logical test that determines whether a loop should continue running. If the condition is True, the loop will continue; if False, it stops.
68
New cards
22. Action
The block of code that gets executed repeatedly inside a loop, as long as the condition is True.
69
New cards
23. Pre-Test Loop
A type of loop (like the while loop) that tests the condition before executing the loop’s body. If the condition is false at the start, the body may not execute at all.
70
New cards
24. Post-Test Loop
A type of loop where the condition is tested after executing the loop’s body. The loop will always execute at least once before checking if it should continue. (Not directly available in Python, but can be simulated.)
71
New cards
25. Nested Loop
A loop inside another loop. The inner loop completes all its iterations before the outer loop continues to the next iteration.
72
New cards
26. Flowchart
A visual representation of a process or algorithm. In the case of loops, it uses diamonds to represent conditions and arrows to indicate the flow of execution.
73
New cards
27. Debugging
The process of identifying and fixing errors in a program. Common issues in loops include infinite loops or incorrect termination conditions.
74
New cards
28. Loop Boundaries
The values that define the range or limits of a loop. These include the starting point, ending point, and the step size, which affect how many times the loop runs.
75
New cards
29. Finding Maximum (or Minimum) Value
An algorithm used to find the largest (or smallest) value in a set of inputs by iterating through each item and updating the maximum or minimum as needed.
76
New cards
30. Common Loop Errors
Errors such as infinite loops, off-by-one errors, or incorrect conditionals, which can prevent a loop from working as expected.
77
New cards
1. The print() Function
The print() function allows multiple parameters to be printed in a single call. By default, it separates each parameter with a space.
78
New cards
2. Custom Separators
The sep parameter allows you to define a custom separator between items printed by print(). This lets you change the default space between printed items to any string, such as a comma, dash, or nothing at all.
79
New cards
3. Controlling Line Endings
The end parameter in the print() function allows you to define how the line should terminate. Instead of the default newline, you can end the output with spaces, periods, or other characters.
80
New cards
4. Rounding Numbers
Python’s round() function rounds a number to a specific number of decimal places, but it does not alter the value in memory. It can be used within print statements to display rounded values.
81
New cards
5. Formatting Output with Format Specifiers
Format specifiers are used to control the appearance of numerical outputs. You can specify the number of decimal places, alignment, and total field width. This is useful when working with financial or tabular data, as it ensures consistency in the output.
82
New cards
6. Field Width and Alignment
You can control the width of the output field and align the content. By default, numbers are right-aligned, but you can modify the alignment to left or center. Padding (such as with spaces or zeros) can be applied to ensure that the output aligns as desired, especially when dealing with multiple columns of data.
83
New cards
7. Aligning Numbers in Columns
You can combine rounding and field-width specifications to display numbers in neatly aligned columns. This is especially useful when creating tables of numerical data.
84
New cards
8. str.format() Method
The str.format() method provides another way to format strings. It allows you to specify placeholders in the string and later insert values into them, controlling the format of those values.
85
New cards
9. F-Strings (Python 3.6+)
F-strings are a more modern and concise way to format strings. They allow you to embed expressions directly inside string literals, making the formatting process more intuitive and readable.
86
New cards
10. Controlling String Formatting (Padding and Alignment)
Both f-strings and format specifiers allow you to control string padding and alignment. This ensures that string data is formatted consistently, whether left-aligned, right-aligned, or centered within a field.
87
New cards
String
A string is a sequence of characters, which can include letters, digits, spaces, and symbols. A string is enclosed in quotes (single or double).
88
New cards
String Literals
These are specific string values, such as "Hello World!" or "35630-1418".
89
New cards
Empty String
A string with no characters, represented as "".
90
New cards
String Indexes
The characters in a string are assigned positions starting from 0. The first character is at index 0, the second at index 1, and so on.
91
New cards
Accessing Characters
You can access individual characters using the index, like string[0] for the first character.
92
New cards
String Slicing
You can extract substrings from a string using slicing notation. A slice is specified by a start and an end index. The slice will include characters from the start index up to but not including the end index.
93
New cards
Unspecified Indices
If no end index is provided, the slice continues to the end of the string. If no start index is provided, the slice begins from the start of the string.
94
New cards
len() Function
You can use len() to get the number of characters in a string.
95
New cards
.find()
Searches for a substring and returns the index of its first occurrence, or -1 if not found.
96
New cards
String Concatenation
You can combine strings using the + operator, which joins strings together (known as concatenation).
97
New cards
input()
The input() function is used to get input from the user as a string. It can take a prompt as a parameter to inform the user what information is expected.
98
New cards
Converting Data Types
In some cases, you need to convert data from one type to another, especially when performing arithmetic operations. This process is called casting.
99
New cards
int()
Converts a string to an integer.
100
New cards
float()
Converts a string to a float.