
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
Computer Network Questions
Quiz
•
1st Grade
20 questions
Worksheet 3
Quiz
•
1st - 5th Grade
20 questions
Library Python Pert-12
Quiz
•
1st Grade
20 questions
UTS MA KLS 1 PONPES DQM
Quiz
•
1st Grade
15 questions
Kelas 3 Bab 2 Bagian D,E Pengenalan Presentasi
Quiz
•
1st Grade
15 questions
kuis Bab 1 Bagian D-E Pengenalan Informatika
Quiz
•
1st Grade
15 questions
Kuis Perakitan Komputer
Quiz
•
1st Grade
17 questions
Quiz Instance Store dan Amazon Elastic Block Store (Amazon EBS)
Quiz
•
1st Grade - University
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
4 questions
Activity set 10/24
Lesson
•
6th - 8th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
30 questions
October: Math Fluency: Multiply and Divide
Quiz
•
7th Grade
Discover more resources for Information Technology (IT)
6 questions
Gravity
Quiz
•
1st Grade
4 questions
What is Red Ribbon Week
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
18 questions
Pushes & Pulls
Quiz
•
1st - 4th Grade
20 questions
Multiplication Mastery Checkpoint
Quiz
•
1st - 5th Grade
16 questions
Halloween Candy
Quiz
•
KG - 12th Grade
25 questions
Week 1 Memory Builder 1 (2-3-4 times tables) Term 2
Quiz
•
1st - 5th Grade
10 questions
Exploring Common and Proper Nouns
Interactive video
•
1st - 5th Grade
