Kompetensi Kejuruan RPL & TKJ • Paket 1 (30 Butir Soal)
total = 0 for i in range(1, 5): total += i print(total)
nilai = [65, 80, 75, 90, 55] lulus = 0 for n in nilai: if n >= 70: lulus += 1 print(lulus)
class Kendaraan: def info(self): return "Kendaraan" class Mobil(Kendaraan): def info(self): return "Mobil" class Motor(Kendaraan): def info(self): return "Motor" def tampil(obj): return obj.info() for item in [Kendaraan(), Mobil(), Motor()]: print(tampil(item))
def kali(a, b): return a * b def tambah(x): return x + 1 nilai = ...... print(nilai)
Apakah Anda yakin ingin mengakhiri sesi latihan ini dan melihat rekap hasil beserta pembahasan?