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,273 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. Hi there, I discovered your site by way of Google at
    the same time as searching for a related matter,
    your site came up, it seems to be good. I’ve bookmarked it in my google bookmarks.

    Hello there, simply became alert to your blog through Google, and located that it is really informative.
    I’m gonna be careful for brussels. I’ll be grateful in the event
    you continue this {in future}. A lot of other folks will be
    benefited out of your writing. Cheers!

  2. obviously like your website however you have to test the spelling on several of your posts.
    Several of them are rife with spelling problems and I find it very bothersome to tell
    the reality however I’ll definitely come back again.

  3. Attractive portion of content. I simply stumbled upon your web site and in accession capital to assert that I get actually enjoyed account
    your weblog posts. Any way I’ll be subscribing in your feeds or even I fulfillment you access persistently fast.

  4. Hi there just wanted to give you a quick heads up.
    The words in your content seem to be running off the screen in Internet explorer.
    I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d
    post to let you know. The design and style look great though!
    Hope you get the problem solved soon. Kudos

  5. Magnificent beat ! I would like to apprentice while you amend your
    site, how can i subscribe for a blog website? The account aided me a acceptable deal.
    I had been tiny bit acquainted of this your broadcast offered bright clear concept

  6. Hey there I am so delighted I found your website, I really found you by mistake, while I was browsing on Askjeeve for something else, Nonetheless I am here now
    and would just like to say thanks a lot for a tremendous post and a all round interesting blog
    (I also love the theme/design), I don’t have time to browse
    it all at the minute but I have bookmarked it and also added your RSS feeds,
    so when I have time I will be back to read a lot more, Please do keep up
    the awesome work.

  7. I’m really enjoying the theme/design of your site.
    Do you ever run into any web browser compatibility problems?
    A small number of my blog audience have complained about my
    website not operating correctly in Explorer but looks great in Safari.

    Do you have any solutions to help fix this issue?

  8. I really love your website.. Great colors & theme. Did you develop this amazing
    site yourself? Please reply back as I’m looking to create my
    own personal website and would like to find out where you got this from or just what
    the theme is called. Thanks!

  9. 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 some interesting things or tips. Maybe you
    could write next articles referring to this article.

    I desire to read more things about it!

  10. My brother recommended I might like this blog. He was entirely right.

    This post actually made my day. You can not imagine just
    how much time I had spent for this information! Thanks!

  11. Please let me know if you’re looking for a writer for your blog.
    You have some really great articles and I think I would be a good asset.
    If you ever want to take some of the load off, I’d
    absolutely love to write some articles for your blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Thank
    you!

  12. Fantastic beat ! I wish to apprentice at the same time as you amend
    your website, how can i subscribe for a blog site? The account aided me a appropriate deal.
    I have been a little bit acquainted of this your broadcast provided vivid transparent concept

  13. Howdy! Do you know if they make any plugins to safeguard against hackers?

    I’m kinda paranoid about losing everything I’ve worked hard
    on. Any suggestions?

  14. Good day very nice website!! Guy .. Excellent ..
    Wonderful .. I will bookmark your site and take the feeds also?

    I am happy to find numerous useful information right here
    in the post, we’d like work out extra strategies in this regard,
    thank you for sharing. . . . . .

  15. exhilarating review. Also visit the site to experiment with
    slot pulsa tanpa potongan. This web site has received acceptance from agen slot deposit pulsa gambling associates in Dalam negeri.
    At this time there are generally plenty of stunning promos if you ever join at this time.

  16. I’m more than happy to find this site. I need to to thank
    you for ones time due to this wonderful read!! I definitely really liked every bit of it and I
    have you saved as a favorite to look at new things in your site.

  17. It’s the best time to make some plans for the future and it’s time to be happy.

    I have read this post and if I could I want to suggest you some interesting things or suggestions.
    Maybe you could write next articles referring to this article.
    I want to read even more things about it!

  18. Thanks for the auspicious writeup. It actually was
    a enjoyment account it. Look advanced to more delivered
    agreeable from you! By the way, how can we keep in touch?

  19. Hey I am so happy I found your site, I really found you by accident, while I
    was looking on Yahoo for something else, Anyhow I
    am here now and would just like to say many thanks for a incredible post and a all round thrilling blog (I
    also love the theme/design), I don’t have time to look
    over it all at the moment but I have bookmarked it and also added in your RSS feeds, so when I have time I will be
    back to read more, Please do keep up the awesome jo.

  20. Having read this I believed it was really informative.
    I appreciate you taking the time and energy to put this informative article
    together. I once again find myself personally spending
    a lot of time both reading and commenting. But
    so what, it was still worth it!

  21. Hi, Neat post. There’s a problem along with your web
    site in internet explorer, could check this? IE still is the marketplace leader and a large portion of people will pass over your fantastic writing due to this problem.

  22. Thanks for finally talking about > Contoh Soal Pemrograman –
    Pola Segitiga Siku-siku – Umar faisol < Loved it!

Comments are closed.