
PythonMembaca dan Menulis File Pert-11
Quiz
•
Information Technology (IT)
•
1st Grade
•
Hard
ricky noviansyah
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang dimaksud dengan file dalam pemrograman?
Sebuah perangkat keras komputer
Kumpulan data yang disimpan di dalam komputer dan diberi nama tertentu.
Sebuah alat untuk menggambar garis dalam program
Sebuah jenis makanan dalam bahasa tertentu
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa perbedaan antara mode 'r' dan 'w' saat membuka file?
Mode 'r' is for writing only, while mode 'w' is for reading.
Mode 'r' is for reading and writing, while mode 'w' is for reading only.
Mode 'r' is for reading only, while mode 'w' is for writing and will overwrite existing content.
Mode 'r' allows appending to a file, while mode 'w' does not.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Jelaskan langkah-langkah untuk menulis ke dalam sebuah file menggunakan Python.
file = open('data.txt', 'r')
file = open('nama_file.txt', 'w') file.write('Data yang ingin ditulis') file.close()
file.close('nama_file.txt')
file.write('Data yang ingin ditulis')
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apakah fungsi 'open()' digunakan untuk membaca atau menulis file?
Mengompres
Mengedit
Menulis
Menghapus
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang akan terjadi jika mencoba membuka file yang tidak ada dalam mode 'r'?
FileNotFoundError tidak akan terjadi.
FileNotFoundError akan diabaikan.
Error FileNotFoundError akan terjadi.
FileNotFoundError akan diatasi secara otomatis.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Bagaimana cara menutup file setelah selesai membacanya?
file.close()
file.end()
file.stop()
file.finish()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Bagaimana cara menambahkan teks ke dalam file yang sudah ada tanpa menghapus isinya?
Buka file dengan mode 'a' (append) kemudian tulis teks yang ingin ditambahkan.
Hapus seluruh isi file sebelum menambahkan teks baru.
Gunakan mode 'w' (write) untuk menambahkan teks ke dalam file.
Buka file dengan mode 'r' (read) kemudian tulis teks baru di atasnya.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
Quiz Microsoft Word 2007 by Jho
Quiz
•
1st - 5th Grade
17 questions
Komputer
Quiz
•
1st Grade
15 questions
Bab 4 Bagian D-E Pengenalan Word
Quiz
•
1st Grade
20 questions
TailwindCSS Transisi Durasi Pert-11
Quiz
•
1st Grade
20 questions
Tugas Pembatik Level 2
Quiz
•
1st - 5th Grade
20 questions
TailwindCSS Font Weight & Text Indent Pert-4
Quiz
•
1st Grade
15 questions
Pengenalan Perangkat Keras dan Lunak
Quiz
•
1st Grade
15 questions
Kuis Interaksi Sosial dan Proses Desain
Quiz
•
1st Grade
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Information Technology (IT)
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
4 questions
What is Red Ribbon Week
Interactive video
•
1st - 5th Grade
10 questions
History of Halloween
Interactive video
•
1st - 5th Grade
18 questions
It's Halloween!
Quiz
•
1st - 4th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
21 questions
Halloween
Quiz
•
KG - 5th Grade
18 questions
Pushes & Pulls
Quiz
•
1st - 4th Grade
28 questions
Halloween Trivia
Quiz
•
1st - 5th Grade
