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. you’re truly a excellent webmaster. The web site loading pace is amazing.
    It seems that you’re doing any distinctive trick. Furthermore, The contents are masterpiece.
    you’ve performed a excellent process on this topic!

  2. Its such as you read my mind! You seem to grasp a lot approximately this,
    like you wrote the guide in it or something. I think that you just can do
    with some % to drive the message home a bit, but other than that, this is wonderful blog.
    A fantastic read. I’ll certainly be back.

  3. It’s a shame you don’t have a donate button! I’d certainly donate to this
    superb blog! I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will share this blog
    with my Facebook group. Chat soon!

  4. I’m not sure exactly why but this weblog is loading
    extremely slow for me. Is anyone else having this issue or is it a issue on my end?

    I’ll check back later on and see if the problem still exists.

  5. fantastic points altogether, you just won a new
    reader. What may you recommend about your submit that
    you just made some days ago? Any positive?

  6. Howdy! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog
    to rank for some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Kudos!

  7. Why viewers still make use of to read news papers when in this technological world everything is existing on net?

  8. I like the valuable info you supply on your articles.
    I will bookmark your blog and take a look at again here regularly.
    I’m slightly certain I’ll be told plenty of new stuff right
    here! Best of luck for the following!

  9. I’m truly enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more pleasant for me to come
    here and visit more often. Did you hire out a designer
    to create your theme? Exceptional work!

  10. Good day! I could have sworn I’ve been to this web site before but after browsing through some of
    the posts I realized it’s new to me. Anyways, I’m certainly happy I discovered it and I’ll be bookmarking it and
    checking back often!

  11. Link exchange is nothing else except it is just placing the other person’s weblog link
    on your page at proper place and other person will also do same in favor of you.

  12. Hello, i think that i saw you visited my web site thus i got
    here to go back the want?.I’m attempting to find issues
    to improve my site!I guess its adequate to use a few
    of your ideas!!

  13. Howdy, i read your blog occasionally and i own a similar
    one and i was just wondering if you get a lot of spam
    remarks? If so how do you reduce 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.

  14. What’s Going down i am new to this, I stumbled upon this I have discovered It positively helpful
    and it has helped me out loads. I am hoping to
    contribute & aid other customers like its aided me.
    Good job.

  15. Asking questions are truly good thing if you are not understanding something completely, but this
    piece of writing offers nice understanding yet.

  16. Write more, thats all I have to say. Literally, it seems as though
    you relied on the video to make your point. You obviously know what youre talking about, why waste your intelligence on just posting videos to your weblog when you
    could be giving us something informative to read?

  17. I am extremely impressed along with your writing talents and also with the structure in your
    blog. Is this a paid subject or did you customize it yourself?
    Anyway stay up the nice quality writing, it is uncommon to see
    a nice weblog like this one today..

  18. Greetings! This is my first visit to your blog!

    We are a group of volunteers and starting a new project in a community
    in the same niche. Your blog provided us valuable information to work on. You have done a marvellous
    job!

  19. I was wondering if you ever considered changing the
    layout of your blog? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.

    Youve got an awful lot of text for only having one or two images.
    Maybe you could space it out better?

  20. Its such as you learn my mind! You appear to know a lot approximately this, such
    as you wrote the ebook in it or something.
    I think that you simply can do with a few
    p.c. to drive the message home a little bit, but other than that,
    this is wonderful blog. A great read. I’ll definitely be back.

  21. As the admin of this site is working, no uncertainty very
    quickly it will be well-known, due to its quality contents.

Comments are closed.