Created
June 6, 2017 08:26
-
-
Save adzimzf/60f219851154b5668984bd8e249c2915 to your computer and use it in GitHub Desktop.
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
string = "" | |
x = 5 | |
bar = x | |
# Looping Baris | |
while bar >= 0: | |
# Looping Kolom Spasi Kosong | |
kol = bar | |
while kol > 0: | |
string = string + " " | |
kol = kol - 1 | |
# Looping Kolom Bintang Sisi Kiri | |
kiri = 1 | |
while kiri < (x - (bar-1)): | |
string = string + " "+str(kiri)+" " | |
kiri = kiri + 1 | |
# Looping Kolom Bintang Sisi Kanan | |
kanan = 1 | |
while kanan < kiri -1: | |
string = string + " "+str(kiri-1 - kanan)+" " | |
kanan = kanan + 1 | |
string = string + "\n\n" | |
bar = bar - 1 | |
print (string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment