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