logo

Crowdly

Browser

Add to Chrome

Questions Bank (1514236 total)

Let a = [10, 20, 30, 40, 50]. Match each expression with its value (§1.4).

Gestel a = [10, 20, 30, 40, 50]. Pas elke uitdrukking by sy waarde.

View this question

What does this program write (§1.3)?

count = 0

for i in range(1, 6):

for j in range(i, 6):

if (i + j) % 3 == 0:

continue

if j == 4:

break

count += 1

print(count)

Wat skryf hierdie program? Gee 'n heelgetal.

View this question

Evaluate this postfix (reverse Polish) expression with a single stack, as described in §4.3:

5 1 2 + 4 * + 3 -

Evalueer hierdie postfix-uitdrukking (omgekeerde Poolse notasie) met een stapel. Gee 'n getal.

View this question

Match each Python 3 expression with its value (§1.2).

Pas elke Python 3-uitdrukking by sy waarde.

View this question

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).

100%
0%
0%
100%
100%
0%
0%
0%
View this question

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).

View this question

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).

100%
100%
0%
0%
0%
View this question

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).

0%
0%
100%
100%
100%
100%
0%
100%
View this question

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?

0%
0%
100%
0%
0%
View this question

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?

0%
0%
0%
0%
100%
View this question