¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Sin título

raghu Katagall 8 preguntas

Hacer el test

Preguntas del test (8)

  1. 1What is the output of the following?

    print("Hello {1} and {0}".format('bin', 'foo'))
    1. AHello foo and bin
    2. BHello bin and foo
    3. CError
    4. DNone of the mentioned
  2. 27. What will be the output?

    >>>d = {"john":40, "peter":45}
    >>>d["john"]
    1. A40
    2. B45
    3. C“john”
    4. D“peter”
  3. 31. What is the output of the following?

    i = 2
    while True:
    if i%3 == 0:
    break
    print(i)
    i += 2
    1. A2 4 6 8 10
    2. B2 4
    3. C2 3
    4. Derror
  4. 4What is the output of the code shown below?

    def f(x):
    yield x+1
    print("test")
    yield x+2
    g=f(9)
    1. AError
    2. Btest
    3. Ctest1012
    4. DNo output
  5. 5What is the output of the functions shown below?

    divmod(10.5,5)
    divmod(2.4,1.2)
    1. A(2.00, 0.50)(2.00, 0.00)
    2. B(2, 0.5)(2, 0)
    3. C(2.0, 0.5)(2.0, 0.0)
    4. D(2, 0.5)(2)
  6. 6 What is the output of the following piece of code?

    class A():
    def disp(self):
    print("A disp()")
    class B(A):
    pass
    obj = B()
    obj.disp()
    1. AInvalid syntax for inheritance
    2. BError because when object is created, argument must be passed
    3. CC. Nothing is printed
    4. DA disp()
  7. 7Which of the following statements is true?
    1. AThe __new__() method automatically invokes the __init__ method
    2. BThe __init__ method is defined in the object class
    3. CThe __eq(other) method is defined in the object class
    4. DThe __repr__() method is defined in the object class
  8. 8What is the output of the code shown below?

    def f(x):
    def f1(a, b):
    print("hello")
    if b==0:
    print("NO")
    return
    return f(a, b)
    return f1
    @f
    def f(a, b):
    return a%b
    f(4,0)
    1. AhelloNO
    2. BhelloZero Division Error
    3. CNO
    4. Dhello

Información

Descripción
Test sobre Sin título, creado por raghu Katagall el 23/05/2018.
Idioma
English
Visitas
98
Etiquetas
puc
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?