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. Fantastic web site. Plenty of useful info here.
    I am sending it to some buddies ans additionally sharing in delicious.
    And of course, thanks to your sweat!

  2. Thank you for some other excellent post. The place else may anyone get that type of information in such a
    perfect means of writing? I have a presentation next
    week, and I am on the look for such information.

  3. Hey there! I’m at work browsing your blog from my new iphone!
    Just wanted to say I love reading through your blog and look
    forward to all your posts! Carry on the fantastic work!

  4. I think this is one of the such a lot important information for me.
    And i am glad studying your article. However wanna statement on some general things, The web site
    style is ideal, the articles is truly excellent : D.

    Just right process, cheers

  5. You really make it seem so easy along with your presentation however I to find this matter to be actually one
    thing which I think I might by no means understand. It kind
    of feels too complex and extremely huge for me.

    I’m having a look forward to your subsequent submit,
    I’ll try to get the hold of it!

  6. hello!,I like your writing very so much! percentage we communicate extra approximately your post on AOL?
    I need a specialist on this house to resolve my problem.
    May be that is you! Taking a look forward to look you.

  7. The other day, while I was at work, my sister stole my apple ipad and tested
    to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83
    views. I know this is totally off topic but I had to share it with someone!

  8. Hi there! I could have sworn I’ve been to this web site before but
    after looking at many of the articles I realized it’s new to me.
    Anyhow, I’m definitely happy I discovered it and I’ll be bookmarking it and checking back regularly!

  9. Sweet blog! I found it while browsing on Yahoo News. Do
    you have any tips on how to get listed in Yahoo
    News? I’ve been trying for a while but I never seem to get there!
    Thanks

  10. Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam
    comments? If so how do you reduce it, any plugin or
    anything you can advise? I get so much lately it’s driving me insane so any assistance is very much
    appreciated.

  11. Appreciating the commitment you put into your website and
    in depth information you offer. It’s great to
    come across a blog every once in a while that isn’t the same
    old rehashed material. Excellent read! I’ve saved your
    site and I’m adding your RSS feeds to my Google account.

  12. I think that what you posted was very reasonable.
    However, consider this, what if you added a little content?

    I mean, I don’t want to tell you how to run your blog, but what
    if you added a title that grabbed folk’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga
    Siku-siku – Umar faisol is kinda plain. You could
    glance at Yahoo’s front page and watch how they create post
    titles to grab viewers to click. You might add a related video
    or a picture or two to get readers interested about everything’ve got to
    say. Just my opinion, it would make your blog a little livelier.

  13. Thanks a bunch for sharing this with all folks you
    actually realize what you’re speaking approximately!
    Bookmarked. Kindly also visit my website =).
    We will have a link change agreement among us

  14. Hello! I could have sworn I’ve visited your blog before but
    after going through a few of the articles I realized it’s new to me.
    Regardless, I’m certainly pleased I discovered it and I’ll be bookmarking
    it and checking back often!

  15. Attractive element of content. I simply stumbled
    upon your site and in accession capital to assert that I get in fact enjoyed account your blog
    posts. Any way I will be subscribing in your feeds or even I fulfillment you get right of entry to persistently fast.

  16. Heya are using WordPress for your site platform?
    I’m new to the blog world but I’m trying to get started and create my own. Do you require any coding expertise
    to make your own blog? Any help would be really appreciated!

  17. Hi there, 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 prevent it, any
    plugin or anything you can recommend? I get so much lately it’s driving me mad so any help is very
    much appreciated.

  18. Yesterday, while I was at work, my cousin stole my iPad and tested to see
    if it can survive a twenty five foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views.

    I know this is completely off topic but I had to share it with someone!

  19. Thanks , I have just been searching for information approximately this subject for
    a while and yours is the best I’ve discovered so far.
    However, what about the conclusion? Are you certain concerning
    the supply?

  20. It is appropriate time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I desire to suggest you few interesting things or suggestions.
    Perhaps you can write next articles referring to this article.

    I want to read more things about it!

  21. It is the best time to make some plans for the future and it’s
    time to be happy. I have read this submit and if I may just I want to suggest
    you some attention-grabbing things or tips. Perhaps you could write subsequent articles relating to this article.
    I wish to read even more things approximately it!

  22. I’m impressed, I must say. Seldom do I come across a blog that’s both educative and amusing, and without a doubt, you’ve hit the nail on the head.
    The issue is an issue that not enough people are speaking intelligently about.
    Now i’m very happy that I found this in my hunt for something relating to this.

  23. I’m extremely impressed with your writing skills and also with the layout on your
    weblog. Is this a paid theme or did you modify it yourself?

    Either way keep up the excellent quality writing, it is rare to
    see a nice blog like this one these days.

  24. I’m really enjoying the theme/design of your website. Do you ever run into any web browser compatibility issues?
    A small number of my blog audience have complained about
    my site not working correctly in Explorer but looks great in Opera.
    Do you have any advice to help fix this problem?

  25. Good day! Would you mind if I share your blog with my myspace group?
    There’s a lot of folks that I think would really enjoy your content.

    Please let me know. Thanks

  26. Hi, i feel that i saw you visited my web site thus i came to go back the desire?.I’m trying to to
    find things to improve my web site!I suppose its adequate to
    make use of some of your ideas!!

Comments are closed.