(SKO1) TIPS FINAL TEST 2026 QUESTIONS
WITH CORRECT ANSWERS GRADED A+
◍ Python is.
Answer: readabledynamically typedextensive standard librarycross
platversatileinterpreted nature
◍ key value mappion.
Answer: dictionairies allow you to associate values with descriptive keys,
providing a convenient way to represent relationships between data.
◍ What is the output of the following code?print(“Hello” + “World”).
Answer: HelloWorld
◍ What does this Python code output?print(2 * 3 ** 2).
Answer: 18
◍ Which method is used to return the number of elements in a list?.
Answer: len()
◍ What does this Python code return?x = 7y = 5print(x % y).
Answer: 2
◍ you can combine lists together with.
Answer: + operatoralso by using extend ()
◍ sorted ().
Answer: returns a sorted list from an iterable
◍ Based on the Python snippet:devices = ["router01", "switch01",
"modem01", "gateway01", "printer01"]Which data structure is being used to
store the names for various types of devices within devices?.
Answer: List
,◍ What will this code return?my_str = “Hello World”print(my_str[0:5]).
Answer: Hello
◍ Which of the following Python keywords is used to create a loop?.
Answer: for
◍ set.
Answer: unordered, mutable collections of unique elements
◍ Return.
Answer: optionally provides a result
◍ event-driven programming.
Answer: reacts to events and user actions, triggering corresponding
functions
◍ membership operators.
Answer: in, not in
◍ Indexing ([]).
Answer: accessing individual characters by position. First pos is 0.
◍ pop ().
Answer: used to remove an item at a specified postion in a list and return in
◍ Variable.
Answer: used to store data, created by assigning a value to a name
◍ arbitrary arguments.
Answer: allow a function to accept any number of arguments.
◍ int (), float (), str ().
Answer: converts values to integers, floats, or strings
◍ list conductor.
Answer: a way to create a new list. used when you want to intialize a list
with predefined values or when you want to convert to a listlist ()
◍ Which of the following methods removes whitespaces from the beginning
, and the end of a string in Python?.
Answer: strip()
◍ extend ().
Answer: used to add multile items to the end of a list.
◍ Data Types.
Answer: integers, floats, strings, lists, tuples, dictionaries
◍ dict ().
Answer: creates an empty dictionarie
◍ set:.
Answer: unordered, mutable collection of unique elements
◍ What is the error in the following Python code?port = input(“Secure Web
access? Y/N: “)if port == “Y” print(“Use port 443.”)else print(“Use port
80.”).
Answer: Missing colons at the end of if and else lines
◍ How to run phython script in Python3.
Answer: python3 script.py
◍ floor division //.
Answer: performs division and rounds down to the nearest whole number.
◍ if statement.
Answer: runs a block of code when a condition is met
◍ modulus %.
Answer: returns the remainder
◍ How can you convert the string “123” into an integer in Python?.
Answer: int("123")
◍ list aretuples are.
Answer: mutableimmutable
◍ This Python code snippet returns a syntax error when run:def
multiply_numbers(num1, num2)result = num1 * num2return resultnum1 =