Ayúdanos a dar forma a GoConqr. ¿Qué deberíamos añadir?

Test

Python PCAP Zertifizierung Quiz (241-280)

Marko Luzanin 40 preguntas

Hacer el test

Este test tiene tiempo límite, así que se abre en el reproductor de siempre.

Preguntas del test (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

Información

Descripción
Test sobre Python PCAP Zertifizierung Quiz (241-280), creado por Marko Luzanin el 11/09/2024.
Idioma
Deutsch
Visitas
6
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Más sobre Python Functions

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué deberíamos añadir?