1) What function is used to open a file in Python? a) open('fruit.txt', 'r+') b) open('fruit.txt', 'a+') c) open('frut.txt', 'a') d) none of the above 2) What is the best approach to guarantee that a file object is correctly closed after use whenever possible? a) Using close() at the end of the code b) Using try and finally blocks c) Using the with keyword d) None of the above 3) What function is used to get a list of all lines in a file? a) read() b) readlines() c) write() d) None of the above 4) Which of the following file types can be opened with notepad as well as ms excel? a) Binary Files b) Text Files c) CSV Files d) none of the above 5) . To open a file c:\scores.txt for writing, we use ____________ a) outfile = open(“c:\scores.txt”, “w”) b) outfile = open(“c:\\scores.txt”, “w”) c) outfile = open(file = “c:\scores.txt”, “w”) d) outfile = open(file = “c:\\scores.txt”, “w”)
0%
python panchayat
Delen
Delen
Delen
door
Freeuse6669
Inhoud Bewerken
Afdrukken
Embedden
Meer
Toewijzingen
Scorebord
Meer weergeven
Minder weergeven
Dit scoreboard is momenteel privé. Klik op
Delen
om het publiek te maken.
Dit scoreboard is uitgeschakeld door de eigenaar.
Dit scoreboard is uitgeschakeld omdat uw opties anders zijn dan die van de eigenaar.
Opties Herstellen
Quiz
is een open template. Het genereert geen scores voor een scoreboard.
Inloggen vereist
Visuele stijl
Lettertypen
Abonnement vereist
Opties
Template wisselen
Alles weergeven
Er zullen meer templates verschijnen terwijl je de activiteit gebruikt.
Open resultaten
Kopieer link
QR-code
Verwijderen
Automatisch opgeslagen activiteit "
" herstellen?