Automation Flashcards
What is an expression? Give an example?
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.
What does it mean when you program crashes?
It means the program stopped running unexpectedly; usually because the computer can’t understand a line of code.
List, in order of highest to lowest precedence.
What can be done to override Python’s natural operation precedence.
Use brackets.
List three most-common data types in Python.
What does the below error usually mean?
SyntaxError: EOL while scanning string literal
you probably forgot the final single quote character at the end of the string.
e.g.
‘Hello, world!
What are the rules for variable naming in Python?
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 are comments made in Python?
put a # before the comment.
What do the str(), int(), and float() functions do?
The str(), int(), and float() functions will evaluate to the string, integer, and floating-point forms of the value you pass, respectively.
What data type is returned by the input() function?
string