CBSE Class 11 Informatics Practices Question 18 of 36

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.

Get the Bright Tutorials app Stuck on a question? Ask Bright Buddy — your AI tutor — for step-by-step help in the app.