Created
June 3, 2022 01:09
-
-
Save dirumahrafif/ad5053fe0ec8593bdc30dc0a0bc8f035 to your computer and use it in GitHub Desktop.
Cara membuat piramid sederhana di python
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
| import time | |
| baris = int(input("masukkan tinggi piramid:")) | |
| spasi = baris - 1 | |
| for a in range(baris): | |
| kali = 2*a+1 | |
| for j in range(spasi): | |
| print(end=" ") | |
| spasi = spasi - 1 | |
| time.sleep(1) | |
| for c in range(kali): | |
| print("*",end="") | |
| print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment