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 for … in.

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.

16,626 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku”

  1. We are a bunch of volunteers and starting a new scheme in our community.
    Your site provided us with useful information to work on. You’ve done an impressive
    process and our entire community will likely be grateful to
    you.

  2. Hi, i feel that i noticed you visited my web site thus i came to go back the desire?.I am attempting to find issues to improve my web site!I assume its
    adequate to use a few of your ideas!!

  3. Nice blog here! Also your web site loads up very fast!
    What host are you using? Can I get your affiliate link to your host?
    I wish my web site loaded up as quickly as yours lol

  4. Hi there, 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 feedback?
    If so how do you reduce it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any help is very much appreciated.

  5. Everything posted made a ton of sense. But, what about this?
    suppose you added a little information? I am not suggesting your content isn’t solid., but suppose you
    added a headline that grabbed people’s attention? I mean Contoh Soal
    Pemrograman – Pola Segitiga Siku-siku – Umar faisol is kinda
    boring. You could look at Yahoo’s home page and watch how they create post titles to grab viewers to click.

    You might add a video or a picture or two to get readers interested about everything’ve written. In my
    opinion, it would bring your posts a little bit more interesting.

  6. Having read this I believed it was extremely informative.

    I appreciate you finding the time and energy to put this content 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!

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

    I have read this publish and if I may I wish to suggest you few fascinating things
    or tips. Perhaps you can write subsequent articles referring to this article.

    I wish to read even more issues approximately it!

  8. Wow that was strange. I just wrote an incredibly long
    comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again. Regardless, just wanted to say fantastic blog!

  9. Hello, i believe that i noticed you visited my site thus i got here to go back the want?.I am trying to find issues to
    improve my web site!I assume its ok to use some of your
    concepts!!

  10. Does your blog have a contact page? I’m having problems locating it but, I’d
    like to send you an e-mail. I’ve got some creative ideas for
    your blog you might be interested in hearing.
    Either way, great site and I look forward to seeing it improve
    over time.

  11. When I originally commented I seem to have clicked on the -Notify
    me when new comments are added- checkbox and from now on whenever
    a comment is added I get four emails with the exact same comment.
    Perhaps there is an easy method you are able to remove
    me from that service? Appreciate it!

  12. I like the valuable information you provide for your articles.

    I will bookmark your weblog and test once more right here frequently.
    I am moderately sure I will be told a lot of new stuff proper here!
    Best of luck for the next!

  13. We are a bunch of volunteers and starting a new scheme in our community.
    Your web site offered us with valuable information to work on. You have done a formidable process and our
    whole community shall be grateful to you.

  14. fascinating review. At the same time visit the site to find out agen slot pulsa.

    That site has received popularity right from agen slot deposit pulsa wagering
    individuals in Dalam negri. Truth be told there are generally lots of gorgeous promos in the event you join at
    present.

  15. Very great post. I simply stumbled upon your blog and wished to mention that I have truly enjoyed surfing around your blog posts.
    In any case I will be subscribing for your rss feed and I
    am hoping you write again soon!

  16. Someone essentially assist to make severely articles I might state.
    That is the first time I frequented your web page and
    thus far? I surprised with the research you made to make this
    actual publish amazing. Wonderful process!

  17. You have made some good points there. I checked on the
    net for more information about the issue and found most individuals will
    go along with your views on this web site.

  18. It’s in fact very complicated in this full of activity life to listen news on TV, therefore I only use internet for that reason, and
    get the latest information.

  19. Hmm is anyone else encountering problems with the images on this blog loading?

    I’m trying to figure out if its a problem on my end or if it’s the blog.
    Any suggestions would be greatly appreciated.

Comments are closed.