Automation Flashcards

1
Q

What is an expression? Give an example?

A

The most basic kind of programming instruction; concisting of values and operators and they can always evaluate (i.e. reduce) to a single value.

e. g. 2 + 2
note: a single value is also an expression.

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

What does it mean when you program crashes?

A

It means the program stopped running unexpectedly; usually because the computer can’t understand a line of code.

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

List, in order of highest to lowest precedence.

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

What can be done to override Python’s natural operation precedence.

A

Use brackets.

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

List three most-common data types in Python.

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

What does the below error usually mean?

SyntaxError: EOL while scanning string literal

A

you probably forgot the final single quote character at the end of the string.

e.g.

‘Hello, world!

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

What are the rules for variable naming in Python?

A

It can be only one word with no spaces.

It can use only letters, numbers, and the underscore (_) character.

It can’t begin with a number.

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

How are comments made in Python?

A

put a # before the comment.

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

What do the str(), int(), and float() functions do?

A

The str(), int(), and float() functions will evaluate to the string, integer, and floating-point forms of the value you pass, respectively.

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

What data type is returned by the input() function?

A

string

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