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.
Marlon
2 months agoAbel
2 months agoTamesha
2 months agoMarjory
3 months agoEmmanuel
3 months agoSarah
3 months agoShawna
3 months agoYolando
4 months agoWillard
4 months agoNarcisa
4 months agoPete
4 months agoLizette
4 months agoAshlyn
5 months agoLaquita
5 months agoFreida
10 months agoMarquetta
9 months agoMarquetta
10 months agoBrice
11 months agoDoug
11 months agoAlishia
9 months agoTawna
9 months agoNakisha
9 months agoShanice
9 months agoElizabeth
9 months agoEttie
9 months agoMalika
9 months agoMelissa
9 months agoNichelle
9 months agoFidelia
9 months agoSerina
10 months agoMiesha
10 months agoStephane
11 months agoMayra
11 months agoMarjory
11 months agoGracia
11 months agoCarmen
11 months agoJulian
11 months agoLavonne
11 months agoLeah
11 months agoAllene
11 months agoSamira
11 months ago