Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. What is the output of the following?

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

  2. A.
    m, y, , n, a, m, e, , i, s, , x,
    B.
    m, y, , n, a, m, e, , i, s, , x
    C.
    my, name, is, x
    D.
    error

    View Answer

    Workspace

    Answer : Option C

    Explanation :

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


Be The First To Comment