'Incredible India!' is a popular promotional slogan used by the Tourism…
PYQ EMRS TGT/PGT (ESSE) 2025
'Incredible India!' is a popular promotional slogan used by the Tourism Department. The following Python program generates an encrypted version of the slogan. Carefully analyze the given Python program and determine the outputs produced at different stages of program execution.
Original = "'Incredible India!'"
print(Original) # Output A1
Original = Original.strip("'")
print(Original) # Output A2
Encrypted = ""
Temp = ""
for Ch in Original:
if Ch.isupper():
Temp += Ch.lower()
else:
Temp += Ch.upper()
print(Temp) # Output B
Encrypted = Temp
Temp = ""
for i in range(1, len(Encrypted), 2):
Temp += Encrypted[i] + Encrypted[i-1]
print(Temp) # Output C
if len(Encrypted) % 2 != 0:
Temp += Encrypted[-1]
Encrypted = Temp
print(Encrypted) # Output D(A) What will be the outputs of the print statements marked Output A1 and Output A2?
(B) What will be the output marked Output B?
(C) What will be the output marked Output C?
(D) What will be the output marked Output D?
Sign up free to check your answer
Sign up freeLoading lesson…

