CBSE Class 11 Informatics Practices Question 46 of 75

Conditional and Looping Constructs — Question 18

Back to all questions
18
Question

Question 7(a)

Write the output of the following:

for i in '123' :
   print ("Message",i,)
Answer
Output
Message 1
Message 2
Message 3
Explanation

The code uses a for loop to iterate over each character in the string '123'. During each iteration, it prints the string "Message" followed by the current character i.