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. 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 throw away your intelligence on just posting videos to your site when you could be giving us something informative to read?

  2. First of all I want to say awesome blog! I had a quick question in which I’d like to ask
    if you don’t mind. I was curious to find out how
    you center yourself and clear your thoughts prior to writing.
    I have had a difficult time clearing my mind in getting my thoughts out.
    I do enjoy writing but it just seems like the first 10 to 15 minutes are generally lost just
    trying to figure out how to begin. Any ideas or tips?
    Cheers!

  3. Yesterday, while I was at work, my cousin stole my iPad and tested to see if it can survive a 30 foot drop, just so she can be
    a youtube sensation. My iPad is now broken and she has 83 views.

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

  4. What’s up all, here every one is sharing these familiarity, thus it’s good to read this web site, and I used to pay
    a visit this website every day.

  5. I just like the helpful information you provide for your
    articles. I’ll bookmark your weblog and take a look at again here frequently.
    I am slightly certain I’ll learn many new stuff proper right here!
    Good luck for the next!

  6. I’ve been browsing online more than three hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. Personally, if all site owners and bloggers made
    good content as you did, the web will be a lot more useful than ever
    before.

  7. That is a great tip particularly to those fresh to the blogosphere.

    Short but very accurate info… Thanks for sharing this
    one. A must read article!

  8. After checking out a number of the blog articles on your web site, I truly appreciate your technique of blogging.
    I added it to my bookmark webpage list and will be checking back in the near future.

    Take a look at my web site too and tell me your opinion.

  9. I’m curious to find out what blog platform you have been working with?
    I’m having some minor security issues with my latest
    site and I would like to find something more safe.
    Do you have any solutions?

  10. I am really loving the theme/design of your web site.
    Do you ever run into any browser compatibility issues?
    A couple of my blog readers have complained about my blog not
    operating correctly in Explorer but looks great in Opera.
    Do you have any suggestions to help fix this problem?

  11. I was recommended this blog by way of my cousin. I am no longer positive whether
    or not this post is written through him as no one else
    recognize such certain about my problem. You’re amazing!
    Thank you!

  12. Today, while I was at work, my cousin stole my iPad and tested to see if it can survive a 40 foot drop, just
    so she can be a youtube sensation. My iPad is now broken and she has 83 views.
    I know this is completely off topic but I had to share
    it with someone!

  13. Hello I am so happy I found your web site, I really found you by accident, while I was searching on Yahoo for something else,
    Regardless I am here now and would just like to say thanks for a tremendous post and a all round entertaining
    blog (I also love the theme/design), I don’t have time to read it all at the minute but I have saved it and also included your RSS feeds, so when I have time I will be back to
    read a lot more, Please do keep up the great b.

  14. Hmm it seems like your website ate my first comment (it was extremely
    long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog writer but I’m still new to the whole thing.
    Do you have any tips for beginner blog writers? I’d certainly appreciate
    it.

  15. I’m curious to find out what blog system you happen to be working with?

    I’m having some minor security problems with my latest blog and
    I would like to find something more safeguarded.
    Do you have any recommendations?

  16. Everything published was actually very reasonable.
    But, what about this? what if you added a little information? I am
    not saying your content is not good., however suppose you added something
    to maybe get people’s attention? I mean Contoh Soal Pemrograman – Pola
    Segitiga Siku-siku – Umar faisol is a
    little plain. You should peek at Yahoo’s front page and see how they create news titles to grab viewers interested.
    You might add a related video or a related pic or
    two to grab readers interested about what you’ve written. Just my opinion, it would make
    your posts a little bit more interesting.

  17. Greetings! This is my 1st comment here so I just wanted to give
    a quick shout out and say I truly enjoy reading your blog posts.
    Can you recommend any other blogs/websites/forums that cover the same subjects?
    Thanks a lot!

  18. Hi, I do think this is a great website. I stumbledupon it 😉 I’m going to revisit once again since i have
    book-marked it. Money and freedom is the greatest way to change, may you be rich and continue to
    guide others.

  19. Hello! I just wanted to ask if you ever have any trouble with
    hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no data backup.
    Do you have any solutions to prevent hackers?

  20. Howdy, I do think your website could be having web browser compatibility
    problems. Whenever I look at your site in Safari,
    it looks fine however when opening in IE, it has some overlapping
    issues. I simply wanted to provide you with a quick heads up!
    Apart from that, great blog!

  21. Asking questions are truly pleasant thing if you are not understanding something fully,
    except this piece of writing provides pleasant understanding yet.

  22. I love what you guys tend to be up too. This kind of clever work and exposure!
    Keep up the fantastic works guys I’ve incorporated you guys to my blogroll.

  23. Thanks for your marvelous posting! I genuinely enjoyed reading it, you could be
    a great author.I will ensure that I bookmark your blog
    and definitely will come back at some point. I want to encourage
    you to definitely continue your great job, have a nice morning!

  24. Howdy! Someone in my Myspace group shared this website with us so I
    came to give it a look. I’m definitely loving
    the information. I’m bookmarking and will be tweeting
    this to my followers! Great blog and superb design and style.

  25. Hello There. I found your blog using msn. This is a very well written article.
    I’ll be sure to bookmark it and return to read more of your useful info.
    Thanks for the post. I’ll certainly return.

  26. You’ve made some really good points there. I checked on the internet to find out more about the issue and
    found most individuals will go along with your views on this
    site.

Comments are closed.