Mis Cursos Quizzes
Mis Cursos Quizzes
/ Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript
Pregunta 1
Correcta
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
y = x[::-1]
print(y)
Seleccione una:
a. [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
b. 1 2 3 4 5
c. [1, 2, 3, 4, 5, 6, 7, 8, 9]
d. a e i o u
e. [1, 2, 3, 4, 5, 4, 3, 2, 1]
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 1/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 2
Correcta
Seleccione una:
a. <class 'float'>
b. <class 'int'>
c. 14.0
d. 20
e. 15.0
Pregunta 3
Correcta
Among the different ideas that have allowed the advance of computer hardware and software , one very important is the use of
different numerical systems for representing values, being the most famous the binary, hexadecimal, octal and decimal
representations.
Running the following Python 3 block of code has as result:
x=0o3701
print(x)
Seleccione una:
a. 1985
b. Exception Thrown --> Stack Trace: base 8 var printing not allowed as non String
c. -1
d. 0o3701
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 2/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 4
Correcta
Conceptually, what does running the line print(bin(10)) using a Python 3 enviroment do?
Seleccione una:
a. It accesses a registry in RAM called “bin” and stores there the decimal value 10. Exceptions are printed if syntax is wrong.
b. It reads “10” as a binary chain, then this chain is converted to a decimal value and printed.
c. No operation is done, an exception is thrown because Python 3 does not include any bin command or operator.
d. It gets a binary representation for the decimal 10 and then prints it.
La respuesta correcta es: It gets a binary representation for the decimal 10 and then prints it.
Pregunta 5
Incorrecta
How many times will the while loop of the following Python code be executed?:
ini = 0
fin = 128
x = 100
while(ini != x):
mid = int ( (ini + fin + 1)/2 )
if( mid < x):
fin = mid - 1
else:
ini = mid
Seleccione una:
a. It never Ends
b. 2
c. 0
d. 7
e. 1
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 3/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 6
Incorrecta
int a = 5;
int b = 3;
float c = a/b;
cout<< c << '\n';
Seleccione una:
a. -1757895751
b. 1
c. 121
d. y
e. Error
Pregunta 7
Incorrecta
set <int> s;
for(int i = 0; i < 10; i++){
s.insert(i%5);
}
cout<<s.size()<<endl;
Seleccione una:
a. 2
b. 5
c. 1
d. 10
e. 11
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 4/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 8
Incorrecta
What is the value of the variable foo in the following Javascript code segment?
lastname: 'C',
age: 66,
course: 'B1',
money: 1.375
}
Seleccione una:
a. 67
b. 66
c. B1
d. NaN
e. 1
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 5/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 9
Correcta
What is the final value of the variable foo in the following Javascript code segment?
var foo = 0;
Seleccione una:
a. 66
b. 55
c. 0
d. 45
e. 100
Pregunta 10
Correcta
What does the following Python code, with the help of Numpy, segment prints?
b = numpy.linspace(0,360,5)
print(b/90)
Seleccione una:
a. [ 1 1 9 64 25]
d. [ 2 2 6 16 10]
e. [0. 1. 2. 3. 4.]
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 6/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 11
Correcta
With that dataframe from Pandas called "data", what is the result of the following Python segment code
Seleccione una:
a. A 27
B 41
C 35
D 33
b. A 14
B -1
C 6
D -3
c.
A -27
B -41
C -35
D -33
d. A 41
B 40
C 41
D 30
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 7/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
e. A -41
B -40
C -41
D -30
B -41
C -35
D -33
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 8/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Pregunta 12
Correcta
What does the following Python code segment prints? (plt here is the name to use pyplot from Matplotlib)
names = ['group_a', 'group_b', 'group_c']
values = [1, 10, 100]
plt.plot(names, values)
plt.suptitle('Categorical Plotting')
plt.show()
Seleccione una:
a.
b.
c.
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 9/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
d.
e.
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 10/11
14/4/2021 Quiz 2 -Python, Ipython, Google Colab, Basic Data Types: Python, C/C++ and JavaScript: Revisión del intento
Ir a...
https://campus.virtual.unal.edu.co/mod/quiz/review.php?attempt=1319740&cmid=624631 11/11