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. It is the best time to make some plans for the future and it is time to be happy.
    I’ve learn this submit and if I could I wish to counsel you some interesting issues or tips.
    Maybe you could write next articles regarding this article.
    I want to read even more things approximately it!

  2. Hello friends, its impressive piece of writing regarding tutoringand completely defined, keep it up all the time.

  3. I do not know if it’s just me or if perhaps everyone else experiencing issues with your site.
    It seems like some of the text on your posts are running off the
    screen. Can somebody else please provide feedback and
    let me know if this is happening to them too?
    This might be a issue with my internet browser because I’ve had
    this happen before. Kudos

  4. Thanks for another great post. Where else could anybody
    get that kind of info in such an ideal way of writing? I’ve
    a presentation subsequent week, and I’m on the look for such information.

  5. An outstanding share! I have just forwarded this onto a friend who had been conducting a little homework on this.
    And he actually ordered me lunch because I stumbled upon it for him…
    lol. So let me reword this…. Thanks for the meal!! But yeah,
    thanks for spending some time to discuss this
    subject here on your site.

  6. Someone essentially assist to make seriously posts I might state.

    That is the first time I frequented your web page and thus far?
    I surprised with the analysis you made to create this particular submit
    extraordinary. Great job!

  7. Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s difficult to get that “perfect balance” between user friendliness and appearance.
    I must say you’ve done a fantastic job with this. Also, the blog loads very
    fast for me on Chrome. Exceptional Blog!

  8. Wow that was odd. I just wrote an extremely long
    comment but after I clicked submit my comment didn’t appear.

    Grrrr… well I’m not writing all that over again. Anyway, just wanted to say great blog!

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

    I have read this post and if I could I desire to suggest you some interesting things or advice.
    Perhaps you can write next articles referring to this article.
    I want to read more things about it!

  10. It’s the best time to make some plans for the long run and it’s time to be happy.

    I have learn this post and if I may I desire to counsel
    you few interesting issues or advice. Maybe you could write subsequent articles referring to this article.
    I wish to learn even more issues approximately
    it!

  11. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the costs. But he’s tryiong none the less.
    I’ve been using Movable-type on various websites
    for about a year and am anxious about switching to another platform.
    I have heard fantastic things about blogengine.net.
    Is there a way I can import all my wordpress posts into
    it? Any kind of help would be really appreciated!

  12. This is the right web site for everyone who wants to find out about this topic.
    You understand so much its almost tough to argue with you (not that I personally
    will need to…HaHa). You certainly put a brand new spin on a topic that’s been written about for many years.

    Great stuff, just excellent!

  13. Hello would you mind letting me know which hosting company you’re
    working with? I’ve loaded your blog in 3 different internet browsers and I must say this blog
    loads a lot faster then most. Can you recommend a good hosting provider at a reasonable price?
    Thank you, I appreciate it!

  14. Hello very nice blog!! Man .. Excellent
    .. Amazing .. I will bookmark your site and take the feeds also?
    I am glad to find so many helpful info here within the put up, we’d like develop more strategies on this regard, thank
    you for sharing. . . . . .

  15. What’s up it’s me, I am also visiting this web site daily, this web page is in fact good and
    the users are in fact sharing nice thoughts.

  16. Hi there it’s me, I am also visiting this web site on a regular basis,
    this web site is truly good and the people are really sharing pleasant thoughts.

  17. The other day, while I was at work, my sister stole my
    iPad and tested to see if it can survive a 40 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!

  18. I’m not sure why but this website is loading incredibly slow for me.

    Is anyone else having this problem or is it a problem on my end?
    I’ll check back later on and see if the problem still exists.

  19. We are a bunch of volunteers and opening a brand new scheme in our community.
    Your site provided us with valuable information to work on. You have done an impressive task and
    our entire community can be thankful to you.

  20. I think everything said made a ton of sense. But, think about this, suppose you added a
    little information? I mean, I don’t want to tell you how to run your blog, but what if you added a post title
    that grabbed people’s attention? I mean Contoh
    Soal Pemrograman – Pola Segitiga Siku-siku – Umar faisol is a little boring.

    You might look at Yahoo’s home page and see how they
    create news headlines to grab people to open the links.
    You might add a video or a pic or two to get people excited about
    what you’ve written. Just my opinion, it might make your blog a little livelier.

  21. Hi there I am so grateful I found your web site, I really found you by error, while I was looking on Digg for something else, Nonetheless I am here now and would just
    like to say thank you for a marvelous post and a all round thrilling blog (I also love the theme/design), I don’t have time to browse 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 a lot more, Please do keep up the excellent jo.

  22. Fantastic beat ! I wish to apprentice while you amend your web site, how could i subscribe for a blog site?
    The account aided me a acceptable deal. I had been a little bit acquainted
    of this your broadcast provided bright clear idea

  23. An impressive share! I’ve just forwarded this onto a coworker who has been doing
    a little research on this. And he actually ordered me dinner
    simply because I found it for him… lol. So allow me to reword this….
    Thanks for the meal!! But yeah, thanx for spending the time to talk about this matter here
    on your web page.

  24. I like what you guys tend to be up too. This sort of clever work and exposure!

    Keep up the excellent works guys I’ve added you guys to my own blogroll.

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

  26. This is a great tip particularly to those fresh to the blogosphere.
    Short but very precise information… Thank you for sharing this one.
    A must read post!

Comments are closed.