Automation Exam Latest Update 2025-2026 60
Questions and 100% Verified Correct Answers
Guaranteed A+
Consider the following Python code:
colors = ['red', 'blue', 'green'] colors.insert(1, 'yellow')
What will be the value of colors after executing this code? - CORRECT ANSWER: ['red',
'yellow', 'blue', 'green']
when using the .insert(), it doesn't replace the value in that position, it inserts into that
place.
How are items in a tuple accessed? - CORRECT ANSWER: By placing the index of the
item inside square brackets [] after the tuple name
How can a global variable be created inside a function in Python? - CORRECT
ANSWER: By declaring the variable with the 'global' keyword
How can multiple Python variables of different types be output using the print() function?
- CORRECT ANSWER: By separating each variable with a comma
What are the 3 common naming conventions used in Python, and what is their format? -
CORRECT ANSWER: Camel case: each word, except for the first word, starts with a
capital letter
Pascal case: each word starts with a capital letter
Snake case: each word in the variable is separated by an underscore.
, What are the 3 components of a string slice? - CORRECT ANSWER: string
[start:stop:step]
· Start: the index from which the slicing begins (inclusive)
· Stop: the index at which the slicing ends (exclusive)
· Step (optional): The step or stride between characters.
What are the 3 sequence types in Python? what do they represent/look like? -
CORRECT ANSWER: list: Ordered, mutable sequence; [1,23]
tuple: Ordered, immutable sequence; (1,2,3)
range: represents a range of values; e.g. range(5)
What are the 5 Variable name rules in Python? - CORRECT ANSWER: 1. can only
contain letters, numbers, or an underscore.
2. MUST start with either a letter or underscore
3. Cannot start with a number
4. Cannot contain special characters.
5. Cannot be a Python keyword (such as: and, as, def, else, etc)
What are the characteristics of a set? - CORRECT ANSWER: Unordered, mutable
collection of unique elements. {1,2,3}
What are the traits of Declarative Programming? - CORRECT ANSWER: describes
what the program should accomplish without specifying how to achieve it.
What are the traits of Event-Driven Programming? - CORRECT ANSWER: Reacts to
events and user actions, triggering corresponding functions.