# Struktur Data Python (Data Science & ML) > List, dictionary, set, tuple, list comprehension, generator, itertools - 20 pertanyaan wawancara - Junior - [Pertanyaan Wawancara: Data Science & ML](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara.md) ## 1. Apa perbedaan mendasar antara list dan tuple di Python? **Jawaban** List bersifat mutable (dapat dimodifikasi setelah dibuat) sedangkan tuple bersifat immutable (tidak dapat dimodifikasi). Sifat immutable ini membuat tuple menjadi hashable dan dapat digunakan sebagai key dictionary, tidak seperti list. Tuple juga sedikit lebih efisien dalam hal penggunaan memori dan kecepatan akses. ## 2. Metode mana yang harus digunakan untuk menambahkan elemen di akhir list Python? **Jawaban** Metode append() menambahkan satu elemen di akhir list. Metode ini memodifikasi list secara in-place dan mengembalikan None. Untuk menambahkan beberapa elemen, gunakan extend() atau operator +=. Metode insert() memungkinkan penambahan pada posisi tertentu. ## 3. Bagaimana cara membuat dictionary kosong di Python? **Jawaban** Dictionary kosong dapat dibuat dengan {} atau dict(). Sintaks {} lebih ringkas dan sedikit lebih cepat. Notasi {} membuat dictionary kosong, sedangkan set() membuat set kosong. Untuk set kosong, harus menggunakan set() karena {} dicadangkan untuk dictionary. ## 17 pertanyaan lagi tersedia - Apa hasil dari ekspresi [x**2 for x in range(5)]? - Karakteristik apa yang membedakan set dari koleksi Python lainnya? Daftar gratis: https://sharpskill.dev/id/login ## Topik wawancara Data Science & ML lainnya - [Dasar-dasar Python](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/python-basics.md): 25 pertanyaan, Junior - [Pemrograman Berorientasi Objek Python](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/python-oop.md): 20 pertanyaan, Junior - [Dasar-Dasar Git](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/git-fundamentals.md): 18 pertanyaan, Junior - [Dasar-dasar SQL](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/sql-basics.md): 20 pertanyaan, Junior - [Dasar-Dasar NumPy](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/numpy-fundamentals.md): 22 pertanyaan, Junior - [Dasar-dasar Pandas](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/pandas-basics.md): 22 pertanyaan, Junior - [Jupyter & Google Colab](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/jupyter-colab.md): 16 pertanyaan, Junior - [SQL Joins & Kueri Lanjutan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/sql-joins-advanced.md): 22 pertanyaan, Mid-Level - [Pandas Lanjutan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/pandas-advanced.md): 24 pertanyaan, Mid-Level - [Visualisasi dengan Matplotlib & Seaborn](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/matplotlib-seaborn.md): 20 pertanyaan, Mid-Level - [Visualisasi Interaktif dengan Plotly](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/plotly-interactive.md): 18 pertanyaan, Mid-Level - [Statistik Deskriptif](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/statistics-descriptive.md): 20 pertanyaan, Mid-Level - [Statistik Inferensial](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/statistics-inferential.md): 24 pertanyaan, Mid-Level - [Web Scraping](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/web-scraping.md): 18 pertanyaan, Mid-Level - [BigQuery & Cloud Data](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/bigquery-cloud.md): 18 pertanyaan, Mid-Level - [Feature Engineering](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/feature-engineering.md): 22 pertanyaan, Mid-Level - [ML Terbimbing: Regresi](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-supervised-regression.md): 24 pertanyaan, Mid-Level - [ML Terbimbing: Klasifikasi](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-supervised-classification.md): 24 pertanyaan, Mid-Level - [Pohon Keputusan & Ensemble](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-trees-ensembles.md): 24 pertanyaan, Mid-Level - [ML Tanpa Pengawasan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-unsupervised.md): 22 pertanyaan, Mid-Level - [Pipeline ML & Validasi](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-pipelines-validation.md): 22 pertanyaan, Mid-Level - [Deret Waktu & Peramalan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/time-series-forecasting.md): 22 pertanyaan, Mid-Level - [Dasar-Dasar Deep Learning](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/deep-learning-fundamentals.md): 24 pertanyaan, Senior - [TensorFlow & Keras](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/tensorflow-keras.md): 22 pertanyaan, Senior - [CNN dan klasifikasi gambar](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/cnn-image-classification.md): 24 pertanyaan, Senior - [RNN & Sekuens](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/rnn-sequences.md): 22 pertanyaan, Senior - [Transformers & Attention](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/transformers-attention.md): 24 pertanyaan, Senior - [NLP & Hugging Face](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/nlp-huggingface.md): 24 pertanyaan, Senior - [GenAI & LangChain](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/genai-langchain.md): 24 pertanyaan, Senior - [MLOps dan Deployment](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/mlops-deployment.md): 24 pertanyaan, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/python-data-structures