Python Programming Flashcards

1
Q

What is an integer?

A

A whole number.

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

What data type is this? ‘Hello’

A

String

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

What is definite iteration?

A

Repeating code that will repeat a set amount of times.

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

What is indefinite iteration?

A

A loop of code that will repeat for an unknown amount of time.

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

What is nested iteration?

A

Iteration inside of another loop.

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

What is validation?

A

A check completed to ensure the data entered is appropriate.

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

What is type casting?

A

Defining what data type the data is in a program.

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

What is concatenation?

A

Joining strings together.

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

What is robust programming?

A

A style of programming designed to handle unexpected errors.

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

What is a string?

A

A data type that is made up of characters and surrounded by speech marks in a program.

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

Name five data types

A

Float/Real, Integer, String, Character, Boolean

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

Give an example of concatenation

A

name = input(‘What is your name?’)

print(‘Hi’ + name + ‘my name is Heesha.’)

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

What is a variable?

A

Storage in which one piece of data is saved and can be changed.

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

What are the two types of variables?

A

Program defined and user defined.

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

what will the following method display as an output?

.upper()

A

A string will be printed with all of the letters in uppercase.

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

what will the following method display on the shell window?

len()

A

The length of the string.

17
Q

When is selection used?

A

When the output depends on a specific condition.

18
Q

When multiplying in python what symbol is used?

A

*

19
Q

What is a float?

A

A data type that contains a decimal number.

20
Q

Why does iteration make a program more efficient?

A

The program will not need to read lines of repeated code and will therefore take less time to execute.