CBSE Class 11 Computer Science Question 37 of 80

Conditional and Looping Constructs — Question 7

Back to all questions
7
Question

Question 7(i)

Write the output of the following:

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

The for loop iterates over each character in the string '123'. For each character, it prints "guru99" followed by the character. The comma after i in the print() function ensures a space between "guru99" and each character.