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.

17,247 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. of course like your web-site however you have to take a look at the spelling on quite a few of your posts.

    Many of them are rife with spelling issues and I in finding it very troublesome to tell the reality nevertheless I will certainly
    come again again.

  2. constantly i used to read smaller articles which also clear their motive, and
    that is also happening with this post which I am reading here.

  3. I do not even understand how I stopped up here, however I thought this publish was
    good. I don’t realize who you are but definitely you
    are going to a well-known blogger for those who are not already.

    Cheers!

  4. Hi i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought
    i could also create comment due to this brilliant post.

  5. I do not even know how I ended up here, but I thought this post was great.
    I don’t know who you are but definitely you’re going to a
    famous blogger if you are not already 😉 Cheers!

  6. We stumbled over here coming from a different page and thought I might check things out.
    I like what I see so i am just following you. Look forward to finding out about your
    web page again.

  7. Hello, I think your blog might be having browser compatibility issues.
    When I look at your blog site in Opera, it looks fine
    but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, great blog!

  8. Howdy! Someone in my Myspace group shared this site 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 great design.

  9. I think that everything said made a ton of sense.
    But, consider this, what if you added a little information?
    I am not saying your information is not good, however suppose
    you added something that grabbed people’s attention? I mean Contoh
    Soal Pemrograman – Pola Segitiga Siku-siku –
    Umar faisol is kinda boring. You ought to glance at Yahoo’s home
    page and note how they create news titles to grab viewers interested.
    You might add a video or a related picture or two to
    get people interested about everything’ve got to say.
    Just my opinion, it would make your posts a little livelier.

  10. Pretty portion of content. I simply stumbled upon your web
    site and in accession capital to say that I acquire actually enjoyed account your
    weblog posts. Anyway I will be subscribing on your feeds
    or even I success you get admission to consistently quickly.

  11. 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 impatience over that you wish be delivering
    the following. unwell unquestionably come further formerly again since exactly the same nearly a lot often inside case you shield this increase.

  12. Have you ever considered about adding a little bit more than just your articles?
    I mean, what you say is valuable and everything.
    Nevertheless imagine if you added some great images or videos
    to give your posts more, “pop”! Your content is excellent
    but with images and clips, this blog could undeniably be one of the best in its niche.
    Terrific blog!

  13. I get pleasure from, cause I found exactly what I was having a
    look for. You’ve ended my four day lengthy hunt!
    God Bless you man. Have a great day. Bye

  14. 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. Anyhow, just wanted to say excellent blog!

Comments are closed.