CBSE Class 12 Computer Science
Question 89 of 105
Python Revision Tour — Question 15
Back to all questionsapple
PEAR
PEACH
grapefruit
x.split(', ') breaks up string x into a list of strings so y becomes ['apple', 'pear', 'peach', 'grapefruit']. The for loop iterates over this list. apple and grapefruit are less than m (since a and g comes before m) so they are converted to lowercase and printed whereas pear and peach are converted to uppercase and printed.