in Python by
Q:
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.

Click here to read more about Python
Click here to read more about Insurance

Related questions

0 votes
asked Jun 13, 2019 in Python by Derya
0 votes
asked Jun 13, 2019 in Python by Derya
0 votes
asked Jun 13, 2019 in Python by Derya
0 votes
asked May 17, 2019 in Python by Derya
0 votes
asked May 16, 2020 in Python by AdilsonLima
0 votes
...