Contoh Soal Pemrograman – Pola Segitiga Siku-siku

Pemrograman Python

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 forin.

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.

48,210 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. Hi colleagues, how is everything, and what you would like to say on the
    topic of this article, in my view its in fact awesome in support
    of me.

  2. I’ve been surfing on-line more than three hours nowadays, yet I never discovered any interesting article like yours. It is beautiful worth enough for me. In my opinion, if all website owners and bloggers made good content material as you did, the web will be much more helpful than ever before.

  3. I’ve been surfing on-line greater than 3 hours nowadays, yet I by no means found any fascinating article like yours. It is pretty value enough for me. In my opinion, if all website owners and bloggers made excellent content material as you probably did, the internet will likely be a lot more helpful than ever before.

  4. You’re so interesting! I don’t think I’ve read through anything
    like that before. So nice to discover somebody with original thoughts on this topic.
    Really.. thanks for starting this up. This web site is something that is needed on the
    internet, someone with some originality!

  5. I am really enjoying the theme/design of your weblog.

    Do you ever run into any web browser compatibility issues?
    A handful of my blog readers have complained
    about my site not working correctly in Explorer but looks great
    in Opera. Do you have any suggestions to help fix this issue?

  6. I don’t know whether it’s just me or if everyone else encountering problems
    with your blog. It seems like some of the written text within your content are running off the screen. Can someone else please
    provide feedback and let me know if this is happening to them too?
    This may be a issue with my internet browser
    because I’ve had this happen previously. Thank you

  7. I’m not sure exactly why but this website is loading extremely slow for me.
    Is anyone else having this problem or is it
    a problem on my end? I’ll check back later and see if the problem still exists.

  8. Heya i’m for the first time here. I found this board and I find It really useful & it helped me out much.
    I hope to give something back and aid others like you aided me.

  9. I just could not go away your web site prior to suggesting that I actually enjoyed the standard information an individual supply
    on your guests? Is going to be back regularly in order to inspect new posts

  10. I believe what you posted was very reasonable. But, consider this,
    suppose you added a little information? I am not saying your
    information isn’t solid., however what if you added a headline to maybe get people’s attention? I mean Contoh Soal
    Pemrograman – Pola Segitiga Siku-siku – Umar faisol is a little boring.
    You might look at Yahoo’s home page and see how they write
    post headlines to grab people to click. You might add a related video or a related pic or two to grab readers interested about
    everything’ve got to say. In my opinion, it might make your posts a little
    livelier.

  11. Fantastic beat ! I wish to apprentice even as you amend your site,
    how could i subscribe for a blog site? The account aided me a appropriate deal.
    I had been a little bit acquainted of this your broadcast offered vibrant clear concept

  12. You could definitely see your enthusiasm in the article you write.
    The sector hopes for more passionate writers
    such as you who are not afraid to mention how they believe.

    Always follow your heart.

  13. It is appropriate time to make some plans
    for the future and it’s time to be happy.
    I’ve read this post and if I could I wish to suggest you few interesting things or advice.
    Maybe you could write next articles referring to this article.
    I want to read more things about it!

  14. I do not even know how I ended up here, but I thought this post was good.
    I don’t know who you are but definitely you’re going to a famous blogger if you are not already 😉 Cheers!

  15. Howdy, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam comments?
    If so how do you stop it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any help is very much appreciated.

  16. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
    You obviously know what youre talking about, why waste your intelligence on just posting videos
    to your blog when you could be giving us something informative to read?

Comments are closed.