Programming Fundamentals Flashcards

(25 cards)

1
Q

What is a variable?

A

A named container that stores data you can change or reuse.

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

What is a data type?

A

A category that tells the computer what kind of value something is (text, number, true/false, etc).

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

Name 4 common data types.

A

String (text), Integer (whole number), Float (decimal number), Boolean (true/false).

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

What is a string?

A

Text inside quotes, like “hello”.

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

What is a boolean?

A

A value that is either true or false.

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

What is an operator?

A

A symbol that performs an action, like + - * / = > <.

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

What does = do in programming?

A

Assigns a value to a variable.

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

What does == do in programming?

A

Checks if two values are equal.

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

What is control flow?

A

The order in which code runs.

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

What does an if statement do?

A

Runs code only if a condition is true.

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

What does else do?

A

Runs code when the if condition is false.

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

What is a loop?

A

A way to repeat code multiple times automatically.

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

Name two common types of loops.

A

for loops and while loops.

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

When would you use a loop?

A

When you want to repeat actions without writing them over and over.

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

What is a function?

A

A reusable block of code that does a specific task.

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

What are parameters in a function?

A

Inputs the function receives to work with.

17
Q

What is a return value in a function?

A

The output the function sends back after running.

18
Q

Can a function exist without returning a value?

A

Yes, not all functions return something.

19
Q

What is a comment in code?

A

Notes for humans that the computer ignores.

20
Q

Why use comments?

A

To explain code so it’s easier to understand later.

21
Q

What is pseudocode?

A

Writing out logic in plain language before coding.

22
Q

Does pseudocode run in a program?

A

No, it’s for planning, not execution.

23
Q

Why is pseudocode useful?

A

It helps you think through problems without getting stuck on syntax.

24
Q

What is debugging?

A

Finding and fixing errors in code.

25
Are errors in code also called “bugs”?
Yes.