Ajude a dar forma ao GoConqr. O que a gente deve adicionar?

Quiz

Python PCAP Zertifizierung Quiz (241-280)

Marko Luzanin 40 perguntas

Fazer o quiz

Este quiz tem tempo limite, por isso abre no player de sempre.

Perguntas do quiz (40)

  1. 1Aufgabe 1 (Buch 241)

    What is the output of the following code?
    def spam(x, sum):
    return sum if x == 0 else sum + spam(x-1, sum)
    print(spam(3, 0))
    1. AA. SyntaxError: invalid syntax
    2. BB. 0
    3. CC. 6
    4. DD. RecursionError: maximum recursion depth exceeded in comparison
  2. 2Aufgabe 2 (Buch 242)

    What do you call end in the print function call below?
    print(x, end='')
    1. AA. named argument
    2. BB. positional argument
    3. CC. keyword argument
    4. DD. arbitrary argument
  3. 3Aufgabe 3 (Buch 243)

    How will you call the code below if you want to print 1, 2, 3?
    def spam(a, b, c=3):
    print(a, b, c)
    1. AA. spam(1,2)
    2. BB. spam(1,2,3)
    3. CC. spam(b=2,a=1)
    4. DD. spam(a=1,2,c=3)
    5. EE. spam(a=1,2,3)
  4. 4Aufgabe 4 (Buch 244)
    Which of the option(s) is valid based on the following code?
    1 def spam(a, b, c=3):
    2 print(a, b, c)
    3 spam(1, 2, c=3,)
    1. AA. a, b are positional arguments
    2. BB. 1, 2 are positional arguments
    3. CC. 1 2 3 will be printed
    4. DD. 3 is a positional argument
    5. EE. Invalid Syntax on Line 3
  5. 5Aufgabe 5 (Buch 245)

    What is the output of the following code?
    123
    456
    789
    1. AA. No output
    2. BB. 123456789
    3. CC. SyntaxError: invalid syntax
    4. DD. NameError: name 123 is not defined
  6. 6>>> 2 ** 3 ** 2 #1 3**2=9
    512
    >>> 2 ** 9
    512

    What is the output of the following code?
    >>> 2 ** 3 ** 2
    1. AA. SyntaxError: invalid syntax
    2. BB. 12
    3. CC. 64
    4. DD. 128
    5. EE. 256
    6. FF. 512
  7. 7Aufgabe 7 (Buch 247)

    What is the output of the following code?
    >>> 5 ** 0 ** 0
    1. AA. SyntaxError: invalid syntax
    2. BB. 1
    3. CC. 5
    4. DD. 0
  8. 8Aufgabe 8 (Buch 248)

    i = 10
    while len(str(i)) > 5:
    i-=1
    print(i, end='')
    else:
    i+=1
    print(i, end='')
    1. AA. 98765
    2. BB. 987656
    3. CC. 11
    4. DD. 11 .. 99999 will be printed
  9. 9Aufgabe 9 (Buch 249)

    What is the output of the following code?
    >>> i = 0
    >>> while i != 0: i -= 1
    ... else: i += 1
    >>> i
    1. AA. SyntaxError: invalid syntax
    2. BB. 0
    3. CC. 1
    4. DD. 2
  10. 10Aufgabe 10 (Buch 250)

    What is the output of the following code?
    i = 30
    while i > 0 :
    i -= 10
    print('loop', end=' ')

    if i <= 10:
    print('break', end=' ')
    break
    else:
    print("else", end=' ')
    1. AA. loop loop break
    2. BB. loop loop loop break
    3. CC. loop loop break else
    4. DD. loop loop loop break else

Informações

Descrição
Quiz sobre Python PCAP Zertifizierung Quiz (241-280), criado por Marko Luzanin em 11-09-2024.
Idioma
Deutsch
Visualizações
6
Avaliação
Ainda sem avaliações
Avalie este quiz
Avalie este quiz

Mais sobre Python Functions

Fale Conosco

Sobre o que é sua mensagem?

O que a gente deve adicionar?