Question
Consider the following Python code: Â Â def
mystery(a, b):     if a == 0:       return b     else:       return mystery(b % a, a)   print(mystery(15, 20))   What is the output of this code?Solution
This is the Euclidean algorithm for finding the Greatest Common Divisor (GCD). Â Â 1. mystery(15, 20): a is not 0. Calls mystery(20 % 15, 15) which is mystery(5, 15). Â Â 2. mystery(5, 15): a is not 0. Calls mystery(15 % 5, 5) which is mystery(0, 5). Â Â 3. mystery(0, 5): a is 0. Returns b, which is 5. Â Â The final output is 5.
Refer to the given number, symbol series and answer the question that follows. Counting is to be done from left to right only.Â
(Left) 7 7 % ...
If in a certain code, SWITCH is written as TVJSDG, then BREAD will be written as________________
Select the option in which the number-pair does NOT share the same relationship as that shared by the given number-pair.
7 : 216
What should come in place of the question mark (?) in the given series ?
40  ?  18  10  4  0
Read the given statements and conclusions carefully. Assuming that the information given in the statements is true, even if it appears to be at variance...
Ten people are sitting in two parallel rows 1 and 2. A, B, C, D and E are sitting in row 1 facing south, and V, W, X, Y and Z are sitting in row 2 facin...
Ketan starts from Point Y and drives 24 km towards the north. He then turns left and drives 23 km, takes a left and drives 91 km. He then takes a left t...
Read the directions carefully and answer the question based on them.
Rohit is looking for his brother. He started from a point and went 110 m t...
If '+' means '×', '×' means '–', '–' means '÷' and '÷' means '+', then what will come in place of the (?) in the following equation?
9 + ...
If ROME is coded as 6821, PARIS is coded as 94657 and SHAME is coded as 73421, what will be the code for MISHAP?