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. 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!

  2. 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!

  3. 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!

  4. 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.

  5. 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!!

  6. 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.

  7. 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.

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

  9. 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?

  10. 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..

  11. 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!

  12. 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?

  13. 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.

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

  15. Attractive section of content. I just stumbled upon your blog
    and in accession capital to assert that I acquire in fact enjoyed account your blog posts.
    Any way I’ll be subscribing to your feeds and even I achievement you access consistently rapidly.

  16. You could certainly see your skills in the article you write.
    The sector hopes for more passionate writers such as you who are not afraid to mention how they believe.
    All the time go after your heart.

  17. Hey there, You’ve done an incredible job. I’ll definitely digg it and personally suggest to my friends.
    I am confident they’ll be benefited from this site.

  18. With havin so much written content do you ever run into any issues of plagorism or copyright violation?
    My site has a lot of completely unique content I’ve either created myself or outsourced but it seems a lot of it is
    popping it up all over the internet without my authorization. Do you
    know any solutions to help prevent content from being ripped off?
    I’d truly appreciate it.

  19. Good information. Lucky me I ran across your blog by chance (stumbleupon).
    I’ve saved as a favorite for later!

  20. Having read this I thought it was very informative. I appreciate you finding
    the time and effort to put this informative 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!

  21. Hmm is anyone else having problems with the pictures on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.

    Any responses would be greatly appreciated.

  22. Hey! Do you know if they make any plugins to assist
    with SEO? 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!

  23. It’s going to be finish of mine day, except before finish I am reading this impressive piece of writing to improve my know-how.

  24. I’ve been browsing online more than three hours today, yet I
    never found any interesting article like yours. It’s pretty worth enough
    for me. In my opinion, if all web owners and
    bloggers made good content as you did, the
    net will be a lot more useful than ever before.

Comments are closed.