Question

    What is the output for the below code

    MyList = ["New York", "London", "Paris", "New Delhi"] MyFile=open('output.txt','w')   for element in MyList:     print >>MyFile, element MyFile.close()

    A New York Paris New Delhi London Correct Answer Incorrect Answer
    B London Paris New Delhi New York Correct Answer Incorrect Answer
    C New York London Paris New Delhi Correct Answer Incorrect Answer
    D None of these Correct Answer Incorrect Answer
    E All of these Correct Answer Incorrect Answer

    Solution

    The correct answer is C

    Practice Next