(SKO1) TIPS ACTUAL EXAM PAPER 2026
QUESTIONS WITH ANSWERS GRADED A+
◍ TypeError.
Answer: An error raised by Python when the wrong number of arguments is
passed to a function.
◍ A network administrator has been asked to create a new configuration file to
deploy a device to the network. An error should be raised if the file already
exists to avoid overwriting existing information.Which open() function
parameter should the network administrator use to create the file?.
Answer: open('config.conf', 'x')
◍ sys.path.
Answer: A list in Python that contains the directories Python looks in for
modules.
◍ Based on the Python code snippet:import matha = 12b = math.sqrt(121)if a
> b: print("Greater than b")elif a < b: print("Less than b") else:
print("Equal")Which output is provided when the snippet is executed?.
Answer: Greater than b
◍ leading/trailing whitespace.
Answer: Leading/trailing whitespace includes spaces and newline characters
at the beginning or end of a string.
◍ json.
Answer: A library for parsing and generating JSON data, commonly used in
config files or APIs.
◍ local variable.
, Answer: Defined inside a function and exists only within that function's
scope.
◍ Pythonic approach.
Answer: Using enumerate is considered more Pythonic and clearer than
manually managing an index counter.
◍ Modulo with Negative Numbers.
Answer: Python's result will have the same sign as the divisor.
◍ Based on the Python code snippet:sum = 0values = [2,4,6,8]for number in
values: if sum < 20: sum = sum + numberprint(sum)What is the output of
print(sum)?.
Answer: 20
◍ Test cases.
Answer: Specific conditions under which a unit test is run to verify that the
code behaves as expected.
◍ 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 -= 5Which replacement line of code will fix the logic
error while still providing an output?.
Answer: router_id += 5
◍ A network configuration file needs to be updated frequently. Because the
device uses a dynamic IP address, the previous content in the file is no
longer necessary and should be removed.Which mode of open() achieves
this operation?.
Answer: w
◍ memory-efficient file reading.
Answer: Reading a file line by line to avoid loading the entire file into
memory at once.
,◍ with open(...) as f:.
Answer: This syntax is a context manager in file handling that ensures the
file is closed when exiting the block.
◍ This Python snippet checks the new processing speed of an updated
computer. However, the snippet throws an error when ran.def
check_processing_speed(current_speed,
threshold_speed):is_fast_processing = current_speed > threshold_speedif
is_fast_processing:print(f"The processing speed of {current_speed} GHz is
fast.")else:print(f"The processing speed of {current_speed} GHz is not fast
enough. Consider an upgrade.")current_speed = 4threshold_speed =
2check_processing_speed(current_speed, threshold_speed)Which code
adjustment will provide the intended response by addressing the error?.
Answer: Decrease the indentation of the else statement.
◍ in operator.
Answer: Used to check if a key exists in a dictionary before accessing it.
◍ Based on the Python code snippet:total = 0count = 0while total < 15: count
+= 1 total += countHow many iterations must be completed for the variable
total to equal 15?.
Answer: 5
◍ dict.get(key, default).
Answer: A method that returns a default value instead of raising an
exception if the key is missing.
◍ Logical OR.
Answer: or returns True if at least one operand is True.
◍ Based on the Python code snippet:def check_device_status(device, ping): if
ping: print(f"The device {device} is responding to pings. It's operational.")
else: print(f"The device {device} is not responding to pings. Investigate the
issue.")device_name = input("Enter the name of the network device:
")ping_success = input("Did the device respond to pings? (yes/no): ") ==
"yes"Which line of code will provide an appropriate device status based on
, user values?.
Answer: check_device_status(device_name, ping_success)
◍ Order of items in a dict.
Answer: In Python 3.7+, the order of items in a dictionary is preserved.
◍ The Python snippet is intended to create directories that correspond to the
names in a list.import osdef automate_system_tasks(directory_names): for
name in directory_names: if os.path.exists(name): print(f"Directory
'{name}' already exists.") else: try: os.makedirs(name) print(f"Directory
'{name}' created successfully.") with open(os.path.join(name,
'router_configs.txt'), 'w') as file: file.write("Router configurations.")
print(f"Router Config file created in '{name}'.") except OSError as e:
print(f"Error creating directory '{name}': {e}")directory_names =
['01_routers_bldg_1010', '02_routers_bldg_2020',
'03_routers_bldg_3030']automate_system_tasks(directory_names)Which
code adjustment will provide the expected behavior?.
Answer: Increase the indentation of the except block to match the try block.
◍ source env/bin/activate.
Answer: A command to activate a virtual environment on Linux/Mac.
◍ Based on the following Python code snippet:device = { "device_type":
"cisco_ios", "ip": "192.168.1.1", "username": "admin", "password":
"password",}config_commands = [ "interface GigabitEthernet0/1", "ip
address 192.168.1.1 255.255.255.0", "no shutdown",]with
ConnectHandler(**device) as net_connect:
net_connect.send_config_set(config_commands) output =
net_connect.send_command("show interfaces GigabitEthernet0/1")
print(output)Which library and package should be imported prior to the first
line of code to connect to the remote network device and apply a
configuration change?.
Answer: from netmiko import ConnectHandler
◍ Indexing.
Answer: Indexing is how you access elements in ordered sequences, starting