Quiz Catalog

Catalog of quizzes

tuple1 = (1, 2, 3)
tuple2 = tuple(1, 2, 3)

print(tuple1 == tuple2)
TypeError: tuple expected at most 1 argument, got 3
  • tuple/literal
  • build-in/tuple

st = {1, 5, 6, 5}

a = tuple(st)

print(a)
(1, 5, 6)
  • build-in/tuple
  • set/literal

def func(*args):
  return args

test = func(1, 2, 3, 'abc')

print(test)
(1, 2, 3, 'abc')
  • function
  • build-in/tuple

def func(*args):
  return args
  
print(func())
()
  • function
  • build-in/tuple

lst = [3, 1, 4, 'a', 2]

a = tuple(reversed(lst))

print(a)
(2, 'a', 4, 1, 3)
  • build-in/reversed
  • build-in/tuple
  • list/literal