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. Currently it looks like Movable Type is the preferred blogging platform available right now.

    (from what I’ve read) Is that what you’re using on your blog?

  2. Great blog here! Also your 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

  3. Its like you read my mind! You seem to know a lot about this, like you wrote
    the book in it or something. I think that you could do with a few pics to drive the message home a bit, but instead of that,
    this is wonderful blog. A fantastic read. I’ll certainly be back.

  4. certainly like your web-site but you have to take a look at the spelling on several of
    your posts. Several of them are rife with spelling issues
    and I to find it very troublesome to inform the truth nevertheless
    I’ll surely come again again.

  5. Appreciating the time and energy you put into your blog and in depth information you provide.
    It’s nice to come across a blog every once in a while that isn’t the same out of date rehashed information. Great read!
    I’ve saved your site and I’m including your RSS feeds
    to my Google account.

  6. Pretty component to content. I simply stumbled upon your weblog and
    in accession capital to assert that I acquire actually enjoyed account your
    blog posts. Anyway I will be subscribing for your feeds and
    even I achievement you get right of entry to consistently fast.

  7. I’m amazed, I must say. Seldom do I come across a blog that’s both educative and
    entertaining, and let me tell you, you’ve hit the
    nail on the head. The problem is an issue that not enough
    folks are speaking intelligently about. I’m very happy I came across this
    during my hunt for something relating to this.

  8. Hi, I do think this is a great web site. I stumbledupon it 😉 I may come
    back once again since i have saved as a favorite it.
    Money and freedom is the best way to change, may you be
    rich and continue to help others.

  9. I just couldn’t leave your site prior to suggesting
    that I actually loved the usual information an individual provide on your visitors?
    Is going to be again continuously to investigate cross-check new posts

  10. I delight in, result in I discovered just what I was taking a look for.
    You’ve ended my 4 day lengthy hunt! God Bless you man. Have a great day.
    Bye

  11. Having read this I believed it was very informative.
    I appreciate you spending some time and effort to put this article together.
    I once again find myself personally spending way too much
    time both reading and posting comments. But so what, it was still
    worthwhile!

  12. We’re a bunch of volunteers and opening a new scheme in our community.
    Your web site provided us with helpful info to work on. You’ve done a formidable job and our whole
    group can be grateful to you.

  13. Today, I went to the beach with my kids. I found a sea shell
    and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed.
    There was a hermit crab inside and it pinched her ear.

    She never wants to go back! LoL I know this is completely off topic but
    I had to tell someone!

  14. I believe this is one of the so much significant information for me.
    And i’m happy studying your article. But wanna remark on few
    common things, The web site taste is great, the articles is in reality great :
    D. Just right process, cheers

  15. Admiring the time and energy you put into your site and detailed information you offer.
    It’s nice to come across a blog every once in a while that isn’t the same old rehashed information. Excellent read!
    I’ve saved your site and I’m including your RSS feeds to my
    Google account.

  16. I think that everything composed was actually very reasonable.
    However, consider this, suppose you added a little information? I ain’t saying your content is not
    solid., but suppose you added a post title to possibly get people’s attention? I
    mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku –
    Umar faisol is a little vanilla. You could peek at Yahoo’s home page and see how they write post titles to get viewers interested.
    You might add a video or a picture or two to grab readers interested about everything’ve written. In my opinion, it
    might make your blog a little bit more interesting.

Comments are closed.