Automation 2026/2027 Questions and Answers
| Complete Study Guide with Detailed
Rationales | Updated Exam Prep Guaranteed
Pass (GRADED A+)
Question 1
Which Python data type is used to store an ordered, mutable
collection of items?
A. Tuple
B. Set
C. List
D. Dictionary
Answer: C. List
Rationale: Lists are ordered and mutable, meaning elements can
be added, removed, or modified after creation. They are
commonly used in automation scripts to store collections of
data.
Question 2
Which function is used to determine the length of a list or
string?
A. size()
B. length()
,C. count()
D. len()
Answer: D. len()
Rationale: The len() function returns the number of items in a
sequence such as a string, list, tuple, or dictionary.
Question 3
What is the output of the following code?
x = 5
y = 3
print(x + y)
A. 53
B. 8
C. 15
D. Error
Answer: B. 8
Rationale: The + operator performs arithmetic addition when
used with numeric values.
Question 4
Which statement is used to create a function in Python?
A. function
B. define
C. def
D. func
,Answer: C. def
Rationale: Functions in Python are defined using the def
keyword followed by the function name and parentheses.
Question 5
What is the correct way to open a file for reading?
A. open("file.txt","r")
B. open("file.txt","w")
C. open("file.txt","a")
D. open("file.txt","x")
Answer: A. open("file.txt","r")
Rationale: The "r" mode opens a file for reading without
modifying its contents.
Question 6
Which loop is best used when the number of iterations is
known?
A. while loop
B. if statement
C. for loop
D. try loop
Answer: C. for loop
Rationale: A for loop iterates through a sequence and is ideal
when the number of iterations is predetermined.
Question 7
, What will be the output?
print(type(10))
A. str
B. float
C. bool
D. int
Answer: D. int
Rationale: The value 10 is an integer, so type() returns int.
Question 8
Which operator checks equality between two values?
A. =
B. ==
C. !=
D. >=
Answer: B. ==
Rationale: The == operator compares two values and returns
True if they are equal.
Question 9
Which data structure stores key-value pairs?
A. List
B. Tuple
C. Dictionary
D. Set