Test
Sin título
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (8)
1What is the output of the following?
print("Hello {1} and {0}".format('bin', 'foo'))
- AHello foo and bin
- BHello bin and foo
- CError
- DNone of the mentioned
27. What will be the output?
>>>d = {"john":40, "peter":45}
>>>d["john"]- A40
- B45
- C“john”
- D“peter”
31. What is the output of the following?
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2- A2 4 6 8 10
- B2 4
- C2 3
- Derror
4What is the output of the code shown below?
def f(x):
yield x+1
print("test")
yield x+2
g=f(9)- AError
- Btest
- Ctest1012
- DNo output
5What is the output of the functions shown below?
divmod(10.5,5)
divmod(2.4,1.2)- A(2.00, 0.50)(2.00, 0.00)
- B(2, 0.5)(2, 0)
- C(2.0, 0.5)(2.0, 0.0)
- D(2, 0.5)(2)
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()- AInvalid syntax for inheritance
- BError because when object is created, argument must be passed
- CC. Nothing is printed
- DA disp()
7Which of the following statements is true?
- AThe __new__() method automatically invokes the __init__ method
- BThe __init__ method is defined in the object class
- CThe __eq(other) method is defined in the object class
- DThe __repr__() method is defined in the object class
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)- AhelloNO
- BhelloZero Division Error
- CNO
- Dhello
Información
- Descripción
- Test sobre Sin título, creado por raghu Katagall el 23/05/2018.
- Autor
- raghu Katagall
- Idioma
- English
- Visitas
- 98
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test