0 votes
in Python by
What is the output of the following?

string = "my name is x"
for i in ' '.join(string.split()):
    print (i, end=", ")

a. m, y, , n, a, m, e, , i, s, , x,
b. my, name, is, x,
c. error
d. m, y, , n, a, m, e, , i, s, , x

1 Answer

0 votes
by

Answer is a m, y, , n, a, m, e, , i, s, , x,

Variable i takes the value of one character at a time.

Related questions

0 votes
asked Jun 13, 2019 in Python by Derya
0 votes
asked Jun 13, 2019 in Python by Derya
...