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

  1. I’m impressed, I have to admit. Rarely do I come across a blog that’s equally educative and amusing,
    and without a doubt, you have hit the nail on the head. The problem is something that too few men and women are speaking intelligently
    about. I’m very happy I stumbled across this in my search for something relating
    to this.

  2. It’s perfect time to make a few plans for the future and it’s time to
    be happy. I’ve read this publish and if I may I wish to recommend you few attention-grabbing things or advice.
    Maybe you could write subsequent articles relating to this article.
    I wish to learn even more things about it!

  3. Do you have a spam problem on this blog; I also am a blogger, and
    I was wanting to know your situation; many
    of us have developed some nice practices and we are looking to trade strategies
    with other folks, please shoot me an email if interested.

  4. Excellent blog here! Additionally your web site so much up very
    fast! What web host are you the usage of? Can I get your associate hyperlink to your host?
    I wish my web site loaded up as fast as yours lol

  5. Can I simply say what a comfort to uncover someone that truly understands what they are discussing over the internet.
    You definitely understand how to bring an issue to light and make it important.

    More people need to check this out and understand this side
    of the story. I was surprised you are not more popular since you
    definitely possess the gift.

  6. Good day! I know this is kinda off topic but I was wondering if you
    knew where I could get a captcha plugin for
    my comment form? I’m using the same blog platform as yours and I’m
    having difficulty finding one? Thanks a lot!

  7. Hey there! This is my 1st comment here so I just wanted to
    give a quick shout out and tell you I really enjoy reading your articles.
    Can you recommend any other blogs/websites/forums that
    cover the same topics? Thanks a lot!

  8. Wow that was strange. I just wrote an really long comment but after I clicked submit my
    comment didn’t show up. Grrrr… well I’m not writing
    all that over again. Anyway, just wanted to say great blog!

  9. Hello, i read your blog from time to time and i own a similar
    one and i was just wondering if you get a lot of spam remarks?
    If so how do you prevent it, any plugin or anything you can suggest?
    I get so much lately it’s driving me crazy so any help is very much appreciated.

  10. Way cool! Some very valid points! I appreciate you penning this
    write-up and also the rest of the website is very good.

  11. Having read this I thought it was rather enlightening.
    I appreciate you finding the time and effort to put this short article together.
    I once again find myself personally spending a
    significant amount of time both reading and posting comments.

    But so what, it was still worth it!

  12. We stumbled over here different website and thought I may as well check things out.
    I like what I see so now i am following you. Look forward to looking over your web page for a second time.

  13. Hi! Someone in my Myspace group shared this website with us so I came to
    look it over. I’m definitely enjoying the information. I’m
    bookmarking and will be tweeting this to my followers!
    Superb blog and great design.

  14. Hello! Do you use Twitter? I’d like to follow you if that would be okay.

    I’m absolutely enjoying your blog and look forward to new posts.

  15. I must thank you for the efforts you’ve put in penning this website.
    I really hope to view the same high-grade content from you
    later on as well. In truth, your creative writing abilities has inspired me to get my own website now 😉

  16. I have been exploring for a little bit for any high quality articles or
    blog posts in this sort of house . Exploring in Yahoo I at
    last stumbled upon this site. Reading this info So i am glad to show that I’ve an incredibly good uncanny feeling I found out exactly what I
    needed. I most definitely will make certain to don?t forget this web site and provides it a
    look on a constant basis.

  17. Just wish to say your article is as amazing. The clearness in your post is simply cool and i
    could assume you’re an expert on this subject.
    Fine with your permission allow me to grab your
    RSS feed to keep up to date with forthcoming post.
    Thanks a million and please continue the rewarding work.

  18. Do you have a spam problem on this website; I also am a blogger, and I was wondering your situation; many of us have developed
    some nice practices and we are looking to swap techniques with other folks,
    please shoot me an e-mail if interested.

  19. Hello! I know this is kinda off topic nevertheless
    I’d figured I’d ask. Would you be interested in exchanging
    links or maybe guest writing a blog post or vice-versa?
    My website addresses a lot of the same topics as
    yours and I believe we could greatly benefit from each other.
    If you might be interested feel free to send me an email.
    I look forward to hearing from you! Awesome blog by the way!

  20. You really make it seem really easy with your presentation however I in finding this topic to be actually one
    thing that I think I’d never understand. It seems too complicated and very huge for me.
    I’m taking a look forward for your subsequent put up, I’ll attempt to get the hold of it!

  21. It is appropriate time to make a few plans for the future
    and it’s time to be happy. I’ve read this post and if I may I desire to counsel you some
    fascinating issues or advice. Maybe you could write next articles regarding this article.
    I desire to learn more things about it!

  22. What’s up everyone, it’s my first visit at this site, and post is really fruitful designed for me, keep up posting these types of content.

Comments are closed.