Looking for Computer Science / Rekenaarwetenskap - 144 test answers and solutions? Browse our comprehensive collection of verified answers for Computer Science / Rekenaarwetenskap - 144 at stemlearn.sun.ac.za.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Match each Python 3 expression with its value (§1.2).
Pas elke Python 3-uitdrukking by sy waarde.
Which statements about running Python programs (§1.1, §1.2) are true? Select all that apply. Wrong choices reduce your mark (not below 0).
Watter stellings oor die uitvoer van Python-programme is waar? Kies al die korrekte opsies. Verkeerde keuses verminder jou punt (nie onder 0 nie).
stdio.writef() formats its arguments with the % operator (§1.5). Match each expression with the string it produces (spaces matter).
Pas elke uitdrukking by die string wat dit gee (spasies tel).
A BST (§4.4) holds integer keys between 1 and 1000, and a search for 500 succeeds. Which of these cannot be the sequence of keys examined by that search? Select all that apply. Wrong choices reduce your mark (not below 0).
'n Binêre soekboom bevat heelgetalsleutels tussen 1 en 1000, en 'n soektog na 500 slaag. Watter van hierdie kan nie die ry sleutels wees wat die soektog ondersoek nie? Kies al die korrekte opsies. Verkeerde keuses verminder jou punt (nie onder 0 nie).
Which statements about the random surfer model and PageRank (§1.6) are true? Select all that apply. Wrong choices reduce your mark (not below 0).
Watter stellings oor die ewekansige-blaaier-model en PageRank is waar? Kies al die korrekte opsies. Verkeerde keuses verminder jou punt (nie onder 0 nie).
What does this code write (§1.4)?
row = [0, 0, 0]
grid = [row, row]
grid[0][1] = 5
other = []
for i in range(2):
other += [[0] * 3]
other[0][1] = 5
print(grid[1][1], other[1][1], len(grid), len(other[0]))
Wat skryf hierdie kode?
What does this code write (§2.1)?
def add(item, bag=[]):
bag += [item]
return bag
x = add(1)
y = add(2)
z = add(3, [])
print(x, y, z)
Wat skryf hierdie kode?
The luminance of a Color (§3.1) is Y = 0.299r + 0.587g + 0.114b. What is the luminance of Color(100, 150, 200)? Give 2 decimal places, using a decimal point.
Die luminansie van 'n Color is Y = 0.299r + 0.587g + 0.114b. Wat is die luminansie van Color(100, 150, 200)? Gee 2 desimale plekke met 'n desimale punt.
What does this code write (§2.3)?
def mystery(n):
if n <= 0:
return 0
return n + mystery(n - 2)
print(mystery(9))
Wat skryf hierdie kode? Gee 'n heelgetal.
Using the text's memory model, how many bytes does Python use for the string 'algorithms' (10 characters)?