Most Tested Exam Topics 2026
Convert pairs of values in a csv row into a dictionary - ANSWER ✔✨---for row in csv_reader:
row_dict = dict(zip(row[::2], row[1::2]))
print(row_dict)
Extract words listed alphabetically by line from a text file and create a dictionary with the first letter of
the words comprising the key, and the words themselves in a list as the corresponding value. -
ANSWER ✔✨---with open(<file>, 'r') as f:
dic = {}
lines = f.readlines()
for line in lines:
dic[line[0]] = line.split()
Given a ten-digit integer, isolate the first three, next three and last four digits using floor and modulo. -
ANSWER ✔✨---#shear right 7 digits
first_three = ten_digits // 10000000
#shear right 4 digits then shear left 3 digits