Pada posting sebelumnya sudah dicontohkan soal pemrograman dalam bahasa Python. Kali ini, akan ditampilkan lagi contoh berikutnya.
Soal:
Buatlah program Python untuk menampilkan pola segitiga siku-siku menggunakan for … in.
Jawab:
Pola 1
* * * * * * * * * * * * * * * * * * * * *
Jawab:
siku_siku_1.py |
tinggi = 6 for baris in range(0, tinggi): for kolom in range(0, tinggi-baris): print("*", end=" ") print("") |
Pola 2
* * * * * * * * * * * * * * * * * * * * *
Jawab:
siku_siku_2.py |
tinggi = 6 for baris in range(0, tinggi): for kolom in range(0, baris+1): print("*", end=" ") print("") |
Pola 3
* * * * * * * * * * * * * * * * * * * * *
Jawab:
siku_siku_3.py |
tinggi = 6 for baris in range(0, tinggi): for kolom in range(1, tinggi-baris): print(" ", end=" ") for bintang in range(0, baris+1): print("*", end=" ") print("") |
Demikian contoh pola segitiga dalam pemrograman Python. Semoga bermanfaat.
Way cool! Some extremely valid points! I appreciate you writing this
article plus the rest of the website is also very
good.
My spouse and I stumbled over here from a different web page and thought I might as well check things
out. I like what I see so i am just following you. Look forward to
finding out about your web page yet again.
order cyclobenzaprine pill
http://erythromycin1m.com/# api erythromycin
Thanks for your marvelous posting! I definitely enjoyed reading it, you might be a great author.
I will make certain to bookmark your blog and will eventually come
back in the future. I want to encourage you to ultimately continue your great work, have a nice holiday weekend!
http://erythromycin1m.com/# erythromycin vs azithromycin
how To Take Cialis Before Sex?
https://erythromycinn.com/# how to apply erythromycin
After going over a few of the articles on your web page, I truly
like your way of blogging. I book-marked it to my bookmark webpage list and
will be checking back soon. Please check out my website as well and let me know your opinion.