Python Coding Flashcards

1
Q

Is Python an operating system?

A

No - it is a high level programming language

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

Define a variable

A

Variables are containers for storing data values

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

What is missing from this line of code?

print (“hello)

A

A “ is missing

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

An If statement is an example of…

A

Selection

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

A while loop is an example of…

A

Iteration

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

A print statement is an example of…

A

Sequence

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

What does this line of Python code do?

this line creates a new variable

A

Not run as it is just a comment

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

Why is this a syntax error?
if mark >10:
print (“well done”)

A

Line 2 is not indented

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

What is a syntax error?

A

When there is a spelling mistake or code is missing

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

What are the two other error types in addition to Syntax?

A

Logic error
Run-time error

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

What data type would a shoe size use?

A

Float

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

What data type would a phone number use?

A

String

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

What data type would date of birth use?

A

Date

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