Quiz Catalog

Catalog of quizzes

word1 = 'welcome'
word2 = 'home'
r = list()

for x in word1:
  for x in word2:
    r.append(x)

print(r[2] + r[1] + r[2])
mom
  • statement/for

numbers = [2, 3, 1, -2, 0]

for i in enumerate(numbers):
  if i[0] == 0:
    if i[1] == 0:
      print(i)
  else:
    continue

print(i)
(4,0)
  • statement/for
  • build-in/enumerate

a = [0, 2, -4, -2, 1]

for i in a:
  if i < 0:
    a.append(abs(i))
  x = i

print(x)
2
  • statement/for

a = 0

for i in range(10):
  if i == 0:
    a = 13
  else:
    a =- 1

print(a)
-1
  • statement/for

a = {(13, 3), "qwer", 67, 1, 5, 33, 2, 7, "youths"}
b = ["python"]

for el in a:
  b.append(el)
else:
  a.union(b)
  
print(a)
{1, 2, 67, 33, 5, 'python', 7, (13, 3), 'youths', 'qwer'}
  • statement/for

odd = [1, 5, 7, 9]
even = [i + 1 for i in odd if i % 2 == 1]

print(even[2])
8
  • statement/for

values = []

for i in range(10):
  if i < 4:
  continue
  values.append(i)

print(values)
[4, 5, 6, 7, 8, 9]
  • statement/for
  • statement/continue
  • expression/operation/smaller