Saved Bookmarks
| 1. |
Raghav is trying to write a tuple tup1 = (1,2,3,4,5) on a binary file test.bin. Consider the following code written by him. import pickle tup1 = (1,2,3,4,5) myfile = open("test.bin",'wb') pickle........ #Statement 1 myfile.close() Identify the missing code in Statement 1. a. dump(myfile,tup1) b. dump(tup1, myfile) c. write(tup1,myfile) d. load(myfile,tup1) |
|
Answer» b. dump(tup1, myfile) |
|