Skip to content

Instantly share code, notes, and snippets.

@HilmiZul
Created May 26, 2025 06:33
Show Gist options
  • Select an option

  • Save HilmiZul/5a2c2b34c513a33047c7a3a1eb390335 to your computer and use it in GitHub Desktop.

Select an option

Save HilmiZul/5a2c2b34c513a33047c7a3a1eb390335 to your computer and use it in GitHub Desktop.

Revisions

  1. HilmiZul created this gist May 26, 2025.
    39 changes: 39 additions & 0 deletions latihan-dasar-problem-solv.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # 1. BUATLAH PROGRAM YANG DAPAT
    # MENENTUKAN BILANGAN POSITIF/NEGATIF!
    bilangan = 5

    if bilangan > 0:
    print("positif")
    else:
    print("negatif")


    # 2. BUATLAH PROGRAM YANG DAPAT
    # MENENTUKAN BILANGAN POSITIF/NEGATIF/NOL!
    bilangan = 5

    if bilangan > 0:
    print("positif")
    elif bilangan < 0:
    print("negatif")
    else:
    print("nol")


    # 3. BUATLAH PROGAM YANG DAPAT MENGULANG
    # ANGKA SEBANYAK n KALI

    n = int(input())

    for i in range(n):
    print(i)


    # 4. BUATLAH PROGAM YANG DAPAT MENGULANG
    # ANGKA SEBANYAK awal dan akhir

    awal = int(input())
    akhir = int(input())

    for i in range(awal, akhir):
    print(i)