Quiz Catalog

Catalog of quizzes

num = 32 // 3
phrase = 'Hello' if num == 10 else 'World'

print('-'.join(phrase[::-1]))
o-l-l-e-H
  • list/operation/slice
  • string/operation/join

lst_1 = [1, 2, 3, 4, 5]
lst_2 = lst_1[:2]
lst_1[2:] = lst_2[:]

print(lst_1, end=" ")
print(lst_2)
[1, 2, 1, 2] [1, 2]
  • list/operation/slice

lst1 = [2, 5, 8, 0, 4, 1]
lst2 = lst1[:]

print(lst1 is lst2, lst1 == lst2)
False True
  • list/operation/slice
  • expression/operation/is
  • expression/operation/equality

furniture = ['TV', 'Projector', 'Playstation', 'Fridge', 'Cooker', 'Toster']
furniture.reverse()

print(*furniture[::-1])
'TV' 'Projector' 'Playstation' 'Fridge' 'Cooker' 'Toster'
  • list/operation/reverse
  • list/operation/slice

a = list(range(6))
a[2:10] = []

print(a)
[0, 1]
  • list/operation/slice