In Sanskrit “Vasudhaiva Kutumbakam” means “The world is one family”. The…
2026
In Sanskrit “Vasudhaiva Kutumbakam” means “The world is one family”. The following Python program generates an encrypted code of this quote. Carefully analyze the program and determine the output produced during program execution by answering the questions that follow.
Quote = "Vasudhaiva Kutumbakam"
L = len(Quote)
Code = ""
for i in range(0, L):
if (Quote[i] >= 'a' and Quote[i] <= 'k'):
Code = Code + Quote[i].upper()
elif (Quote[i] >= 'n' and Quote[i] <= 'z'):
Code = Code + Quote[i-1]
elif (Quote[i].isupper()):
Code = Code + Quote[i].lower()
else:
Code = Code + '@'
print(Code)(A) What encrypted code will be generated for the substring “Vasudha” in the output?
(B) What encrypted code will be generated in the output for the substring “iva”?
(C) What encrypted code will be generated in the output for the blank space between “Vasudhaiva” and “Kutumbakam”?
(D) What encrypted code will be generated for the substring “Kutumbakam” in the output?
Attempted by 61 students.
Show answer & explanation
(A) Encrypted code for “Vasudha”:
V → v (uppercase → lowercase)
a → A (a–k → uppercase)
s → a (n–z → previous character)
u → s (n–z → previous character)
d → D (a–k → uppercase)
h → H (a–k → uppercase)
a → A (a–k → uppercase)
Output: vAasDHA
(B) Encrypted code for “iva”:
i → I (a–k → uppercase)
v → i (n–z → previous character)
a → A (a–k → uppercase)
Output: IiA
(C) Encrypted code for space:
Space does not satisfy any condition → @
Output: @
(D) Encrypted code for “Kutumbakam”:
K → k, u → K, t → u, u → t, m → @, b → B, a → A, k → K, a → A, m → @
Output: kKut@BAKA@