Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In python, you have file called "test.txt", write code to print out all the lines from "test.txt" and use approach where you do not need to worry about closing file handles.
Answer
with open("test.txt") as f:
    for line in f:
        print line

Question
In python, you have file called "test.txt", write code to print out all the lines from "test.txt" and use approach where you do not need to worry about closing file handles.
Answer
?

Question
In python, you have file called "test.txt", write code to print out all the lines from "test.txt" and use approach where you do not need to worry about closing file handles.
Answer
with open("test.txt") as f:
    for line in f:
        print line

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.