Quiz Catalog

Catalog of quizzes

words = ['python', 'programmer', 'quizzes']

for index, value in enumerate(words):
  if index % 2 == 0:
    print(value)
    break
python
  • built-in/enumerate
  • expression/operation/modulo

print(1.5 % 1)
0.5
  • expression/operation/modulo

m = 300
count = 0
while m <= 305:
  m = m + 1
  if m % 2 != 0:
  continue
  count += 1

print(count)
3
  • expression/operation/modulo

def check(x):
  if x % 2 == 0:
    return 1


lst = [2, 1, 4, 5, 3]

a = list(filter(check, lst))

print(a)
[2, 4]
  • build-in/filter
  • build-in/list
  • expression/operation/modulo
  • list/literal