Created
May 26, 2025 06:33
-
-
Save HilmiZul/5a2c2b34c513a33047c7a3a1eb390335 to your computer and use it in GitHub Desktop.
latihan sebelum ujian praktik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment