Entrance Test - Python
Entrance Test - Python
Which of the following code would best simulate a roll of one dice?
Select one:
a. x=np.random.shuffle(np.arange(1,7))
b. x=np.random.choice(np.arange(1,7))
c. x=np.random.rand(np.arange(1,7))
d. x=np.random.randn(np.arange(1,7))
Question 2
Not yet answered
Marked out of 1.00
Choose from the following expressions to make a dictionary variable, en2id, that contains mappings from English
words to their Indonesian equivalents.
Use these words: chair is kursi, table is meja, and cellphone is ponsel.
Select one:
a. en2id = print(’chair’: ’kursi’, ’table’ : ’meja’, ’cellphone’: ’ponsel’)
b. en2id = {‘chair’, ‘table’, ‘cellphone’ : ‘kursi’, ‘meja’, ‘ponsel’}
c. en2id = (’chair’: ’kursi’) + (’table’: ’meja’) + (’cellphone’: ’ponsel’)
d. en2id = {’chair’: ’kursi’, ’table’: ’meja’, ’cellphone’: ’ponsel’}
Question 3
Not yet answered
Marked out of 1.00
Select one:
a. del(my_list[2]) ; del(my_list[3])
b. del(my_list[A]) ; del(my_list[B])
c. del(my_list[2:4])
d. del(my_list[A, B])
https://www.iykra.com/mod/quiz/attempt.php?attempt=4279 1/5
9/15/2019 Entrance Test - Python
Question 4
Not yet answered
Marked out of 1.00
Shown below is a subset of df dataframe. What's the possible function to perform the subset?
Select one:
a. df.loc[['R1','R2'],['C1','C2']]
b. df.loc[('R1','R2'),('C1','C2')]
c. df[['R1','R2'],['C1','C2']]
d. All corrrect
https://www.iykra.com/mod/quiz/attempt.php?attempt=4279 2/5
9/15/2019 Entrance Test - Python
Question 5
Not yet answered
Marked out of 1.00
Let's say you want to drop the last row (R4). What's the possible function?
Select one:
a. df.drop(['R4'],axis=3)
b. df.drop('R4',axis=0)
c. df.drop('R4',axis=1)
d. df.drop('R3,axis=0')
Question 6
Not yet answered
Marked out of 1.00
Select one:
a. ch
b. s
c. t + ch
d. ch + t
https://www.iykra.com/mod/quiz/attempt.php?attempt=4279 3/5
9/15/2019 Entrance Test - Python
Question 7
Not yet answered
Marked out of 1.00
id_mat is an identitiy matrix as shown below. What's the possible function if you want to keep onlyu the top 2 rows?
Select one:
a. id_mat[:1,:]
b. id_mat[:2,:]
c. id_mat[0:1,:]
d. id_mat[1:2,:]
Question 8
Not yet answered
Marked out of 1.00
What do we call the optimization heuristic that involves iteratively checking to see if neighboring solutions improve
upon the current solution?
Select one:
a. Local optimum
b. Brute-force search
c. Hill climbing
d. Random search
https://www.iykra.com/mod/quiz/attempt.php?attempt=4279 4/5
9/15/2019 Entrance Test - Python
Question 9
Not yet answered
Marked out of 1.00
Select one:
a. greedy algorithm
b. partitioning algorithm
c. brute-force algorithm
d. fuzzing algorithm
Question 10
Not yet answered
Marked out of 1.00
Select one:
a. V = 1/3*mt.pi*r^2*t
b. V = 1/3*mt.pi*r**2*t
c. V = 1/3*pi*r^2*t
d. V = 1/3*pi*r**2*t
https://www.iykra.com/mod/quiz/attempt.php?attempt=4279 5/5