
PythonMembaca dan Menulis File Pert-11
Authored by ricky noviansyah
Information Technology (IT)
1st Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
15 questions
Understanding Greedy Algorithms
Quiz
•
1st Grade
20 questions
Tinkercad CodeBlocks III
Quiz
•
1st - 5th Grade
20 questions
Belajar Microsoft Excel
Quiz
•
1st Grade
21 questions
"ИНФО 2-АЙ 1-АПТА VPS"
Quiz
•
1st - 5th Grade
15 questions
Kuis Robotik
Quiz
•
1st - 5th Grade
15 questions
Fun with Computer Networks
Quiz
•
1st Grade
20 questions
TailwindCSS Margin dan Padding Dasar Pert-4
Quiz
•
1st Grade
20 questions
Understanding Dark Mode in Tailwind CSS
Quiz
•
1st Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
13 questions
Fractions
Quiz
•
1st - 2nd Grade
20 questions
CVC Words
Quiz
•
KG - 1st Grade
15 questions
Place Value tens and ones
Quiz
•
1st Grade
16 questions
Money - Coins
Lesson
•
1st - 2nd Grade
20 questions
Halves and Fourths
Quiz
•
1st Grade