Pertanyaan dan Jawaban Wawancara Paling Populer & Tes Online
Platform edukasi untuk persiapan wawancara, tes online, tutorial, dan latihan langsung

Bangun keterampilan dengan jalur belajar terfokus, tes simulasi, dan konten siap wawancara.

WithoutBook menghadirkan pertanyaan wawancara per subjek, tes latihan online, tutorial, dan panduan perbandingan dalam satu ruang belajar yang responsif.

Prepare Interview

Ujian Simulasi

Jadikan Beranda

Bookmark halaman ini

Langganan Alamat Email

Python Coding Pertanyaan dan Jawaban Wawancara

Ques 11. Write a Python function to check if a given year is a leap year.

def is_leap_year(year):

return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)

Example:

is_leap_year(2024)  # Output: True

Apakah ini membantu? Add Comment View Comments
 

Ques 12. Implement a function to find the maximum element in a list.

def find_max_element(lst):

return max(lst)

Example:

find_max_element([3, 7, 2, 8, 5])  # Output: 8

Apakah ini membantu? Add Comment View Comments
 

Ques 13. Write a Python program to count the occurrences of each element in a list.

from collections import Counter

def count_occurrences(lst):

  return Counter(lst)

Example:

count_occurrences([1, 2, 1, 3, 2, 4, 1])  # Output: {1: 3, 2: 2, 3: 1, 4: 1}

Apakah ini membantu? Add Comment View Comments
 

Ques 14. Create a function to check if a given string is an anagram of another string.

def is_anagram(str1, str2):

  return sorted(str1) == sorted(str2)

Example:

is_anagram(\'listen\', \'silent\')  # Output: True

Apakah ini membantu? Add Comment View Comments
 

Ques 15. Implement a function to remove duplicates from a list.

def remove_duplicates(lst):

  return list(set(lst))

Example:

remove_duplicates([1, 2, 2, 3, 4, 4, 5])  # Output: [1, 2, 3, 4, 5]

Apakah ini membantu? Add Comment View Comments
 

Most helpful rated by users:

Hak Cipta © 2026, WithoutBook.