Python Programming Flashcards

All information on topic

1
Q

What is a program?

A

A program is a set of instructions in order to complete a task written in code.

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

What is an algorithm?

A

An algorithm is a set of instructions in order to complete a task

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

What does the “print” function do?

A

It prints what is given in the brackets afterwards

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

What is a variable?

A

A space in computer memory that can be used to store a value or data that can be changed throughout the code.

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

What are the variable name rules?

A

A variable name must start with a letter or the underscore character
A variable name cannot start with a number
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different variables)
A variable name cannot be any of the Python keywords.

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

What is the assignment of a variable?

A

Assignment is giving a variable a value

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

What is a sequence in programming?

A

A sequence is when lines of code are executed one after the other

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

What is selection?

A

Selection is when lines of code will only be executed when the condition is True

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

What is iteration?

A

Repeated execution of lines of code when the condition is true

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

What is count-controlled iteration?

A

Count-controlled iteration repeatedly executes a section of code a fixed, predetermined number of times.

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

What is condition-controlled iteration?

A

Condition-controlled iteration repeatedly
executes a section of code until the condition is False

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

What is nesting?

A

Nesting occurs when one programming construct is included within another

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

What is concatenation?

A

Concatenation is the process of joining two or more strings together to form one single string

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

What is casting?

A

Casting is when you specify a type onto a variable

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

What is an integer?

A

An integer is a positive or negative whole number

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

What is a float?

A

A float is a is a positive or negative number that can be a decimal

17
Q

What is a string?

A

A string is a data type that is a sequence of characters

18
Q

What is a boolean variable?

A

A boolean is a True or False value to use as a truth testing procedure

19
Q

What is a for loop an example of?

A

Count-controlled iteration

20
Q

What is a while loop an example of?

A

Condition-controlled iteration

21
Q

What is nesting?

A

Nesting occurs when one programming construct is included within another.

22
Q

Why do we comment on our code?

A

To make it easier for other programmers to understand

23
Q

What are the logical operators?

A

== , != , < , > , <= , >=

24
Q

What is the != operator?

A

Not equal to

25
Q

What is the == operator?

A

Equal to

26
Q

What is the < operator?

A

Less than

27
Q

What is the > operator?

A

Greater than

28
Q

What is the <= operator?

A

Less than or equal to?

29
Q

What is the >= operator?

A

Greater than or equal to

30
Q

What are the arithmetic operators?

A

+ , - , / , * , % , // , ^ ,

31
Q

What is the + operator?

A

Add

32
Q

What is the - operator?

A

Subtract

33
Q

What is the / operator?

A

Division

34
Q

What is the * operator?

A

Multiplication

35
Q

What is the // operator?

A

Whole number division

36
Q

What is the % operator?

A

Modulus operator (remainder)

37
Q

What is the ^ operator?

A

To the power of

38
Q

What is an array?

A

An array is a set of values of the same data (forpython they can be different) type stored under one identifier

39
Q
A