Skip to content

Instantly share code, notes, and snippets.

@solanoize
Created October 9, 2023 09:29
Show Gist options
  • Select an option

  • Save solanoize/79e2235287e8fb86c7cbebd536e69c16 to your computer and use it in GitHub Desktop.

Select an option

Save solanoize/79e2235287e8fb86c7cbebd536e69c16 to your computer and use it in GitHub Desktop.
tugasHarian = []
## Menambahkan tugas baru ke dalam tugasHarian
tugasHarian.append("Tugas memasak!")
## Cetak seluruh tugas
print(tugasHarian)
# Mengubah tugas memasak menjadi tugas menyapu
tugasHarian[0] = "Tugas menyapu!"
## Cetak seluruh tugas
print(tugasHarian)
## Tambahkan tugas baru bernama tugas beli galon
## Prioritas nomor 1 (important!)
tugasHarian.insert(0, "Beli galon!")
## Cetak seluruh tugas
print(tugasHarian)
## Menghapus tugas yang sudah selesai,
## asumsikan tugas yang selesai ini adalah tugas
## membeli galon
arsip = tugasHarian.pop(0)
## Cetak seluruh tugas
print(tugasHarian)
## Merestore arsip ke tugasHarian
tugasHarian.append(arsip)
## Cetak seluruh tugas
print(tugasHarian)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment