(SKO1) TIPS COMPREHENSIVE STUDY
GUIDE 2026 FULL QUESTIONS AND
SOLUTIONS GRADED A+
◍ flipping a negative into a positive.
Answer: num = -5 abs_num = abs(num) print(abs_num) # Output: 5 - flips
negative to positive
◍ myPhone = (877, 435, 7948).
Answer: creates a tuple
◍ Converting from float to int.
Answer: Remember that when converting from a floating-point number to
an integer, the decimal part is truncated, not rounded. Be cautious about
potential loss of information when converting between numeric types,
especially when going from a floating-point type to an integer.#for
exampleint(13.9) = 13 (The Axe/Truncation)round(13.9) = 14 (The
Scale/Rounding)
◍ open('/my_path/my_file.txt','r').
Answer: opens a file object for reading
◍ Index-based Formatting.
Answer: feature of the str.format() method where you can specify the order
in which values should be formatted. This is done by placing index numbers
(which start from 0) inside the curly braces {} that serve as placeholders in
the original string.#example 1message = "{0} is a {1} programming
language.".format("Python", "versatile")print(message)# Output: "Python is
a versatile programming language."#Example 2 - you can also Swap 0 and 1
, text = "{1} is what {0} is.".format("Python", "versatile") print(text) #
Output: "versatile is what Python is."#example 3 - # Reuse index 0 text =
"{0} is great because {0} is easy.".format("Python") print(text) # Output:
"Python is great because Python is easy."
◍ write().
Answer: writes to open file
◍ mylist[1:3].
Answer: slices list including second and third element
◍ read().
Answer: reads data from open file
◍ mylist[0].
Answer: accesses first element from a list
◍ import pytz.
Answer: imports a package
◍ Boolean - T/F? "".
Answer: False - empty string
◍ pop(1).
Answer: removes second item from a list
◍ True and False.
Answer: False: and operation will always be false unless both sides are true
◍ .count().
Answer: # scans the entire string and tallies up every time it sees that exact
sequence of characters. It doesn't actually have to be a full "word." It can be
a single letter, a phrase, or even a piece of punctuation.#example 1 - output
is 1Var = "The cat sat on the mat."print(Var.count("cat")) #example 2 -#
Output: 4 (caT, saT, The, maT) "The" starts with a capital "T". # It only
found the lowercase 't's.print(Var.count("t")) #example 3- output is
5print(Var.count(" "))
◍ def.
, Answer: keyword used to create functions
◍ join().
Answer: joins values from a list using a defined separator
◍ else:.
Answer: else statement, used in conjunction with if statement or if/elif
statement
◍ get().
Answer: looks up value by key
◍ Assigning same value to multiple variables in a single line.
Answer: switch1 = switch2 = switch3 = "Juniper"
◍ int().
Answer: converts to integer object
◍ parameter v argument.
Answer: # 1. THE DEFINITION (The Blueprint)# The things in the
parentheses here are PARAMETERS.# They are just empty
placeholders/labels.def date_night(ai_name, location): # ^^^^^^^^ ^^^^^^^^
# PARAMETER PARAMETER itinerary = ai_name + " and I are going to "
+ location return itinerary# 2. THE CALL (The Action)# The things in the
parentheses here are ARGUMENTS.# They are the actual data (the "meat")
being sent in.our_date = date_night("Claude", "The Cloud")# ^^^^^^^^
^^^^^^^^^^^# ARGUMENT ARGUMENT
◍ Boolean - T/F? (), [], {}.
Answer: False - empty set
◍ Sequence types: list, tuple, range.
Answer: my_list = [1, 2, 3] # list, Ordered, mutable sequence (e.g., [1, 2,
3]).my_tuple = (1, 2, 3) # tuple Ordered, immutable sequence (e.g., (1, 2,
3)).my_range = range(5) # range Represents a range of values.
◍ mylist[:3].
Answer: slices list beginning with first element and including through the