(SKO1) TIPS PRACTICE EXAMINATION
2026 QUESTIONS WITH ANSWERS
GRADED A+
◍ numbers[3].
Answer: Based on the Python list: numbers = [10, 20, 30, 40]What is the
index position of the element "40"?
◍ What does Python syntax refer to?.
Answer: The set of rules that dictate the combinations of symbols and
keywords that form valid Python programs
◍ What does this built in Python function do?: dir().
Answer: lists the names in the current scope or attributes of an object
◍ Profiling.
Answer: Which Python debugging technique would be most useful for
identifying bottlenecks in the code that may be causing performance issues?
◍ How can a global variable be created inside a function in Python?.
Answer: By declaring the variable with the 'global' keyword
◍ It rounds x to n decimal places.
Answer: What does the round(x, n) function do in Python?
◍ write().
Answer: Which function should be used to add data to a file, such as a
network configuration file?
◍ Linters.
Answer: Which Python debugging tool is best suited for identifying
, potential issues in the code that might lead to errors?
◍ What is the purpose of the // operator in Python?.
Answer: It performs floor division operation; performs division and rounds
down to the nearest whole number and discards the decimal part
◍ It means variable types in Python are determined at runtime..
Answer: What does it mean to say that Python is dynamically typed?
◍ What are the 5 Variable name rules in Python?.
Answer: 1. can only contain letters, numbers, or an underscore.2. MUST
start with either a letter or underscore3. Cannot start with a number4.
Cannot contain special characters.5. Cannot be a Python keyword (such as:
and, as, def, else, etc)
◍ What is the scope of a variable that is defined inside a function in Python?.
Answer: Local Scope
◍ Consider the following Python code:colors = ['red', 'blue', 'green']
colors.insert(1, 'yellow')What will be the value of colors after executing this
code?.
Answer: ['red', 'yellow', 'blue', 'green']when using the .insert(), it doesn't
replace the value in that position, it inserts into that place.
◍ The + operator creates a new list, while the extend() method adds elements
to the end of the original list.
Answer: What is the difference between using the + operator and the
extend() method to concatenate lists in Python?
◍ What is the primary use of whitespace in Python?.
Answer: To define the structure and hierarchy of the code
◍ What are the 3 common naming conventions used in Python, and what is
their format?.
Answer: Camel case: each word, except for the first word, starts with a
capital letterPascal case: each word starts with a capital letterSnake case:
each word in the variable is separated by an underscore.
, ◍ router_id += 5.
Answer: The Python snippet has a logic error causing an infinite loop.
router_id = 100while router_id <= 100: if router_id % 8 == 0: print(f"Router
{router_id}: Configuration audit passed. No security vulnerabilities found.")
else: print(f"Router {router_id}: Security alert - Action required.") router_id
-= 5 Which replacement line of code will fix the logic error while still
providing an output?
◍ ip_addresses.sort(reverse=True).
Answer: In a network automation script written in Python, a list of IP
addresses is sorted in descending order using the sort() method. Which of
the line of code correctly achieves this?
◍ Python allows administrators to automate repetitive tasks, saving valuable
time and reducing the potential for manual errors.
Answer: What is one of the reasons administrators often choose to automate
tasks using Python?
◍ It empties a set, removing all items.
Answer: What does the clear() method do in Python?
◍ what does the += operator do in Python string manipulation?.
Answer: It is used as a shorthand for concatenation and assignment
◍ What are the characteristics of a set?.
Answer: Unordered, mutable collection of unique elements. {1,2,3}
◍ What does this built in Python function do?: map(), filter().
Answer: applies a function to elements or filters elements based on a
function
◍ What is the purpose of indentation in Python?.
Answer: To define blocks of code
◍ If the first condition is False, the second condition will not be checked.
Answer: In Python, what is the behavior of the and keyword in the context
of short-circuit evaluation?