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.

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

  1. I do not know if it’s just me or if perhaps everyone else encountering
    problems with your site. It appears like some of the written text on your content are running off the screen.
    Can somebody else please comment and let me know if this is happening to them too?
    This may be a problem with my web browser because I’ve had this happen before.
    Appreciate it

  2. I have learn a few excellent stuff here. Definitely worth
    bookmarking for revisiting. I surprise how much effort
    you place to make any such magnificent informative web site.

  3. Hey there! I simply would like to give you a huge thumbs up for the
    great information you’ve got right here on this post.
    I will be coming back to your blog for more soon.

  4. Hey there! I simply want to offer you a huge thumbs up for the excellent information you have right here on this
    post. I’ll be returning to your site for more soon.

  5. I loved as much as you’ll receive carried out right
    here. The sketch is tasteful, your authored material stylish.
    nonetheless, you command get got an edginess over that you wish
    be delivering the following. unwell unquestionably come
    more formerly again as exactly the same nearly very
    often inside case you shield this increase.

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

  7. Hello, I believe your blog may be having browser compatibility problems.
    When I look at your web site in Safari, it looks fine but when opening in Internet Explorer, it’s got some overlapping issues.
    I merely wanted to give you a quick heads up!

    Other than that, great site!

  8. I’ve been exploring for a bit for any high-quality articles or
    blog posts on this kind of house . Exploring in Yahoo I finally stumbled upon this web site.
    Studying this info So i am satisfied to convey that I’ve an incredibly just right uncanny feeling I discovered just what
    I needed. I so much indisputably will make certain to don?t fail to remember this site
    and give it a glance regularly.

  9. It is appropriate time to make a few plans for the longer term and it
    is time to be happy. I’ve learn this put up and if I may I desire
    to recommend you some fascinating issues or advice. Perhaps you could write next articles referring to this article.
    I want to learn even more issues approximately
    it!

  10. Pretty great post. I just stumbled upon your blog and wanted to mention that
    I have truly loved surfing around your blog
    posts. In any case I’ll be subscribing for your feed and I’m hoping you write again very soon!

  11. If some one wants expert view concerning running a blog after
    that i advise him/her to visit this blog, Keep
    up the nice job.

  12. It is not my first time to go to see this web site,
    i am visiting this site dailly and get good information from here
    everyday.

  13. I have been browsing online greater than 3 hours nowadays,
    yet I never found any interesting article like yours.
    It is pretty value enough for me. In my view, if all web owners and bloggers made
    excellent content material as you did, the internet will probably be a lot more helpful than ever before.

  14. Its like you learn my mind! You appear to know so much approximately this, like you wrote the e-book in it or something.
    I feel that you just could do with a few percent to drive the message house a little bit, but instead of that, that is magnificent blog.
    A great read. I’ll definitely be back.

  15. With havin so much content and articles do you ever run into
    any issues of plagorism or copyright infringement? My site has a lot of exclusive content
    I’ve either authored myself or outsourced but it appears a lot of it is
    popping it up all over the web without my permission. Do you
    know any solutions to help protect against content from
    being ripped off? I’d truly appreciate it.

  16. Terrific post but I was wanting to know if you
    could write a litte more on this topic? I’d be very grateful if
    you could elaborate a little bit more. Kudos!

  17. Howdy, 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 recommend? I get so much lately it’s driving
    me insane so any assistance is very much appreciated.

  18. I’m gone to inform my little brother, that he should also pay a quick
    visit this web site on regular basis to obtain updated from latest gossip.

  19. I feel this is one of the such a lot significant info for me.
    And i’m happy reading your article. However should commentary on some normal issues, The web site style is ideal,
    the articles is in reality nice : D. Good activity, cheers

Comments are closed.