Python-Quizzes | Python String Quiz | Question 3

Question 3: What is the output of the following program?

filter_none

edit
close

play_arrow

link
brightness_4
code

line = "I'll come by then."
eline = "" 
for i in line: 
    eline += chr(ord(i)+3
print(eline)     

chevron_right


(A) L*oo frph e| wkhq1
(B) L*oo#frph#e|#wkhq1
(C) l*oo@frph@e|$wkhq1
(D) O*oo#Frph#E|#wKhq1


Answer: (B)

Explanation: This piece of code ciphers the plain text. Each character is moved to its 3rd next character by increasing the ASCII value. ‘I’ becomes ‘L’, thus option (c) and (d) are ruled out. ‘ ‘ has an ASCII value of 32, thus it’ll become 35(‘#’), thus option (a) is ruled out as, ‘ ‘ cannot remain to be ‘ ‘ in the ciphered text.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.