Automation | Questions & Answers|
Grade A| 100% Correct (Verified
Answers)
What is Syntax Error?
- Correct Answer –
contains invalid code that cannot be understood
What is Indentation Error?
- Correct Answer –
lines of the program are not properly indented
What is a Value Error?
- Correct Answer –
invalid value is used (e.g., int(three))
What is a Name Error?
- Correct Answer –
program tries to use a variable that does not exist
,What is a Type Error?
- Correct Answer –
operation uses incorrect types (e.g. int(5) + string(four))
How do you check which version of Python editor you have?
- Correct Answer –
import sys
print(sys.version)
How do you edit, save, and run a Python file?
- Correct Answer –
edit = can edit in a text editor
save = save as file.py
run = in command prompt, type file.py
Can you run Python in the Command Line?
- Correct Answer –
type python or py
you will see Python version information and >>>
when you are finished, type exit( )
What is unique about Python script formatting?
- Correct Answer –
, relies on indentation (whitespace) to define scope instead of curly
brackets
Which Python datatypes are used to store arrays?
- Correct Answer –
list, tuple, set, and dictionary
Python datatypes allow arrays with duplicates?
- Correct Answer –
list and tuple
Which Python datatypes are for ordered arrays?
- Correct Answer –
list, tuple, dictionary
Which Python datatypes are unchangeable?
- Correct Answer –
tuple and set
What kind of variable would x = [ ] result in?
- Correct Answer –
list