Haha, these answers are great. I'm just picturing some poor student frantically clicking through all the options, hoping they get it right. Good luck, my friend!
This is a classic Python file handling question. I bet the exam writer is just trying to trip us up with that 'rt' mode. Who even uses that anymore? Everyone knows 'r' is the way to go!
Hmm, I'm not sure about C. I've never seen a file get created automatically like that. And D, really? Why would you think you can't write to the file? That's just silly.
I think C is also correct. If the file doesn't exist, it will be created when you try to open it. But D is wrong - you can definitely write to the file using the 'str' variable.
A and B are correct. The 'rt' mode stands for 'read text', which means the file will be opened for reading and any newline characters will be translated.
Freida
2 months agoMarquetta
1 months agoMarquetta
1 months agoBrice
2 months agoDoug
2 months agoAlishia
8 days agoTawna
9 days agoNakisha
10 days agoShanice
11 days agoElizabeth
12 days agoEttie
13 days agoMalika
14 days agoMelissa
18 days agoNichelle
19 days agoFidelia
22 days agoSerina
2 months agoMiesha
2 months agoStephane
2 months agoMayra
2 months agoMarjory
2 months agoGracia
3 months agoCarmen
3 months agoJulian
3 months agoLavonne
3 months agoLeah
3 months agoAllene
2 months agoSamira
2 months ago