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

  1. Hello everyone, it’s my first go to see at this web site, and
    article is truly fruitful for me, keep up posting
    these types of articles or reviews.

  2. Hmm it appears like your blog ate my first comment (it was extremely long) so I
    guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog writer but I’m still new to everything.
    Do you have any helpful hints for newbie blog writers?
    I’d certainly appreciate it.

  3. Nice post. I learn something totally new and
    challenging on sites I stumbleupon every day. It’s always interesting to read through articles from other authors and practice a little something from other web sites.

  4. Thank you a lot for sharing this with all of us you
    really understand what you are talking approximately!
    Bookmarked. Kindly also visit my site =). We will have a hyperlink change contract between us

  5. Hey There. I found your weblog the use of msn. This is an extremely well
    written article. I’ll be sure to bookmark it and come back to read more
    of your helpful information. Thank you for the post. I will certainly return.

  6. I like the helpful info you provide in your articles.
    I will bookmark your weblog and check again here frequently.

    I’m quite certain I’ll learn many new stuff right here!

    Good luck for the next!

  7. Hello! I simply would like to offer you a huge thumbs up for the excellent information you’ve got here
    on this post. I am returning to your website for more soon.

  8. Hello! This is kind of off topic but I need some guidance from an established blog.
    Is it very hard to set up your own blog? I’m not very techincal but I can figure things out
    pretty quick. I’m thinking about creating my own but I’m not sure where to start.
    Do you have any tips or suggestions? Cheers

  9. Good day! This post could not be written any better!
    Reading through this post reminds me of my old room mate!
    He always kept chatting about this. I will forward this write-up to him.
    Pretty sure he will have a good read. Many thanks for sharing!

  10. Hi there very nice website!! Man .. Excellent .. Superb ..
    I’ll bookmark your blog and take the feeds additionally? I’m satisfied to seek out so many useful information here within the put up, we need develop extra
    techniques in this regard, thank you for sharing.
    . . . . .

  11. naturally like your website but you need to test the spelling on quite a few of your posts.
    Several of them are rife with spelling problems and I in finding it very bothersome to inform the truth
    however I’ll surely come back again.

  12. Hey there! I realize this is kind of off-topic however
    I had to ask. Does managing a well-established blog such as yours take
    a large amount of work? I am brand new to blogging but I do write
    in my diary everyday. I’d like to start a blog so I can easily share my
    own experience and feelings online. Please let me know if
    you have any kind of recommendations or tips for brand new
    aspiring bloggers. Appreciate it!

  13. Hello! I know this is kinda off topic however I’d figured I’d ask.
    Would you be interested in trading links or maybe guest authoring a blog
    article or vice-versa? My site goes over a lot of the same topics as yours and I
    believe we could greatly benefit from each other.
    If you happen to be interested feel free to send me an e-mail.

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

  14. Good way of explaining, and fastidious post to obtain data concerning my
    presentation subject, which i am going to convey in university.

  15. Heya i’m for the first time here. I came across 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.

  16. Pretty nice post. I just stumbled upon your blog and wanted
    to say that I’ve really enjoyed browsing your blog posts.
    In any case I will be subscribing to your rss feed and I hope you write again very soon!

  17. Hey excellent website! Does running a blog similar to this take a massive amount work?
    I’ve virtually no expertise in computer programming but I
    had been hoping to start my own blog soon. Anyway, if you
    have any suggestions or techniques for new blog owners please
    share. I understand this is off subject however I just needed to ask.
    Cheers!

  18. Hello! I just wanted to ask if you ever have any problems with
    hackers? My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no data backup.
    Do you have any methods to protect against hackers?

  19. May I just say what a comfort to uncover an individual who really understands what they’re
    talking about on the internet. You definitely understand how
    to bring an issue to light and make it important. More and more people
    really need to look at this and understand this side of the story.
    It’s surprising you’re not more popular because you most certainly possess the gift.

  20. First of all I would like to say fantastic blog!
    I had a quick question which I’d like to ask if you don’t
    mind. I was interested to know how you center yourself and clear your mind prior to writing.

    I’ve had a hard time clearing my mind in getting my ideas out there.
    I do take pleasure in writing however it just seems like the first
    10 to 15 minutes are generally lost just trying to figure out how to begin. Any suggestions or tips?

    Thank you!

  21. Hello there! This article couldn’t be written any better! Reading through this post reminds
    me of my previous roommate! He continually kept talking about this.
    I am going to send this post to him. Pretty sure he will have a good read.
    Thanks for sharing!

  22. When some one searches for his necessary thing, so he/she desires
    to be available that in detail, therefore that thing is maintained over here.

  23. With havin so much written content do you ever run into any issues of
    plagorism or copyright infringement? My site has a lot of unique content I’ve either created myself or outsourced but it looks like a lot of it is popping
    it up all over the web without my agreement. Do
    you know any ways to help reduce content from being ripped off?
    I’d really appreciate it.

  24. When I initially left a comment I seem to have clicked
    on the -Notify me when new comments are added- checkbox and now
    each time a comment is added I get 4 emails with the
    exact same comment. Is there a means you can remove
    me from that service? Thank you!

Comments are closed.