Quiz Catalog

Catalog of quizzes

def double_print(func):
  def wrapper():
    func()
    func()
  return wrapper

@double_print
def greeting(name):
  print(f'Hello {name}', end=' ')
  
greeting("Vladimir")
TypeError: wrapper() takes 0 positional arguments but 1 was given
  • decorator
  • function/inner

def double_print(func):
  def wrapper(*args, **kwargs):
    func(*args, **kwargs)
    func(*args, **kwargs)
  return wrapper

@double_print
def greeting(name):
  print(f'Hello {name}', end=' ')
  
greeting("Vladimir")
Hello Vladimir Hello Vladimir
  • decorator
  • function/inner