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. excellent put up, very informative. I wonder why the opposite specialists of
    this sector do not understand this. You must proceed your writing.
    I’m sure, you’ve a great readers’ base already!

  2. Its like you read my mind! You seem to know so much about this,
    like you wrote the book in it or something.
    I think that you could do with some pics to drive the message home a bit, but instead of that, this is great blog.

    An excellent read. I will definitely be back.

  3. What’s up i am kavin, its my first time to commenting anyplace, when i read this article i thought i could also create comment due to this good post.

  4. It’s truly very complicated in this active life to listen news on TV,
    thus I only use web for that reason, and take the most up-to-date
    news.

  5. Attractive section of content. I simply stumbled upon your
    blog and in accession capital to say that I acquire
    actually enjoyed account your weblog posts. Anyway I’ll be subscribing in your feeds and even I achievement you access persistently quickly.

  6. Hey there! Someone in my Myspace group shared this
    site with us so I came to check it out. I’m definitely loving
    the information. I’m book-marking and will be tweeting this to my followers!
    Wonderful blog and great design and style.

  7. Howdy! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading
    through your posts. Can you suggest any other blogs/websites/forums that cover the same topics?
    Thank you so much!

  8. I know this if off topic but I’m looking into starting my own weblog and was curious
    what all is needed to get set up? I’m assuming having a blog like yours would cost a pretty penny?

    I’m not very internet smart so I’m not 100% positive.
    Any recommendations or advice would be greatly appreciated.

    Thanks

  9. It is perfect time to make some plans for the future and it is
    time to be happy. I’ve learn this publish and if I may just I wish
    to counsel you few fascinating issues or tips. Perhaps you can write next articles regarding this
    article. I desire to read even more things about it!

  10. Hey There. I found your blog using msn. This is a very well written article.
    I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post.
    I’ll certainly return.

  11. I’m really inspired with your writing skills and
    also with the format for your blog. Is this a paid subject matter or did you
    modify it your self? Anyway stay up the excellent quality writing, it is uncommon to look a nice blog like this one these days..

  12. Good post but I was wanting to know if you could write a litte more on this topic?
    I’d be very grateful if you could elaborate a little bit
    more. Cheers!

  13. I think this is among the most important info
    for me. And i’m glad reading your article.
    But want to remark on some general things, The website style is perfect, the articles
    is really nice : D. Good job, cheers

  14. I am really impressed with your writing skills and also with the layout
    on your blog. Is this a paid theme or did you customize it yourself?
    Either way keep up the nice quality writing, it is rare to see
    a great blog like this one today.

  15. It’s very trouble-free to find out any matter on net as compared
    to books, as I found this article at this web site.

  16. I simply couldn’t go away your web site before suggesting that I actually
    enjoyed the standard information an individual supply for your visitors?

    Is gonna be again often in order to investigate cross-check new posts

  17. Hi! I understand this is kind of off-topic but I had to ask.
    Does building a well-established blog like yours require a
    large amount of work? I’m completely new to operating a blog but I do write in my diary on a daily basis.
    I’d like to start a blog so I can easily share my own experience and thoughts online.
    Please let me know if you have any kind of suggestions or tips for new aspiring blog owners.
    Thankyou!

  18. I just like the valuable info you provide in your articles.
    I’ll bookmark your weblog and test once more here regularly.
    I’m rather certain I will be told a lot of new stuff proper here!

    Best of luck for the following!

  19. You are so interesting! I don’t believe I have read something like that
    before. So great to discover somebody with genuine thoughts on this subject matter.

    Seriously.. thanks for starting this up. This site is one thing that is required on the internet, someone with a bit of originality!

  20. Hi, i think that i saw you visited my weblog so
    i came to “return the favor”.I am trying to find things to improve my web site!I suppose its ok to use some of your
    ideas!!

  21. Wow, wonderful blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your web site
    is great, as well as the content!

  22. Howdy! I know this is kinda off topic nevertheless I’d figured I’d ask.

    Would you be interested in exchanging links or maybe
    guest authoring a blog post or vice-versa? My site discusses a lot of the same subjects as yours
    and I believe we could greatly benefit from each other.

    If you might be interested feel free to shoot me an email.

    I look forward to hearing from you! Terrific blog
    by the way!

  23. Its such as you learn my thoughts! You appear to understand a lot about this, like you wrote the book in it
    or something. I feel that you could do with a few p.c.
    to force the message house a bit, but other than that,
    this is great blog. A fantastic read. I will certainly be back.

  24. Hi there it’s me, I am also visiting this web page on a regular
    basis, this web page is truly nice and the users are actually sharing nice thoughts.

Comments are closed.