#!/usr/bin/python # title : segitiga # author : poticous n = input("Masukan n: "); i = 0 j = n print " " * j + "*" while(1<=n): print " " * (n-1) + "*" * (i+1) + "*" + "*" * (i+1) n = n-1 i = i+1
Langganan:
Posting Komentar (Atom)
<?php echo "Hello World !"; ?>
#!/usr/bin/python # title : segitiga # author : poticous n = input("Masukan n: "); i = 0 j = n print " " * j + "*" while(1<=n): print " " * (n-1) + "*" * (i+1) + "*" + "*" * (i+1) n = n-1 i = i+1
gan, kalo bintangnya diganti dengan angka, gimana caranya?
BalasHapus