Computer Science

Write the output of the following:

for i in '123':
    print("guru99",i,)

Python

Python Control Flow

3 Likes

Answer

guru99 1
guru99 2
guru99 3

Working

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.

Answered By

1 Like


Related Questions