Sail E0 Webinar
Question
What is the output of the following?x = 'abcd'for i in range(len(x)):    x[i].upper()print (x)
Options:
A .  abcd
B .  ABCD
C .  error
D .  none of the mentioned
Answer: Option A


Changes do not happen in-place, rather a new instance of the string is returned.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers