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.

48,273 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. Hey! This post could not be written any better!
    Reading through this post reminds me of my
    old room mate! He always kept talking about this.
    I will forward this write-up to him. Pretty sure he will have a good read.

    Thank you for sharing!

  2. Hmm is anyone else encountering problems with the images on this blog
    loading? I’m trying to determine if its a problem on my end or if it’s the blog.

    Any responses would be greatly appreciated.

  3. certainly like your web-site however you need to check the spelling on quite a few of your posts.
    Many of them are rife with spelling problems and I in finding it
    very troublesome to inform the truth nevertheless I’ll definitely come again again.

  4. You actually make it seem really easy along with your presentation but
    I in finding this topic to be actually something
    that I feel I might never understand. It kind of feels too complex and
    very wide for me. I am having a look ahead to your next post, I’ll try to get the cling of it!

  5. Thank you for every other wonderful post. The place else may anyone get that kind of
    information in such a perfect approach of writing? I’ve a presentation next week, and I’m at
    the search for such info.

  6. Hi, Neat post. There’s an issue with your web
    site in web explorer, could check this? IE still is the market chief and a big element
    of people will omit your great writing because of this problem.

  7. I am sure this paragraph has touched all the internet
    visitors, its really really nice piece of writing on building up new website.

  8. I just like the valuable info you supply to your articles.
    I’ll bookmark your blog and check once more here frequently.
    I am somewhat certain I will be told a lot of new stuff right here!

    Good luck for the next!

  9. Your method of describing everything in this post is in fact nice, all be capable of easily know
    it, Thanks a lot.

  10. With havin so much written content do you ever run into any issues of plagorism or copyright
    violation? My website has a lot of unique content I’ve either
    authored myself or outsourced but it seems a lot of it is popping it up all over the internet without my agreement.

    Do you know any techniques to help stop content from being ripped off?
    I’d genuinely appreciate it.

  11. hello there and thank you for your info – I’ve certainly
    picked up anything new from right here. I did however
    expertise several technical points using this web site, since I experienced to reload the website many times previous to I could
    get it to load correctly. I had been wondering if your web
    hosting is OK? Not that I am complaining, but slow loading instances times will very frequently affect your placement
    in google and can damage your high quality score if ads and marketing with Adwords.
    Well I’m adding this RSS to my e-mail and can look out
    for much more of your respective exciting content. Make sure you
    update this again very soon.

  12. I blog frequently and I seriously appreciate your
    information. Your article has truly peaked my interest.

    I’m going to bookmark your site and keep checking for new details about once per week.
    I subscribed to your Feed too.

  13. Awesome things here. I am very happy to look your post.
    Thanks a lot and I am taking a look forward to touch you.
    Will you kindly drop me a mail?

  14. Hi! I could have sworn I’ve visited your blog before
    but after going through some of the articles I realized it’s new to me.
    Anyways, I’m definitely happy I stumbled upon it and I’ll be bookmarking it and checking back frequently!

  15. Having read this I believed it was very enlightening.
    I appreciate you finding the time and energy to put
    this short article together. I once again find myself personally spending a significant amount of time both reading and leaving comments.
    But so what, it was still worth it!

  16. It’s appropriate time to make some plans for the longer term and it’s time to be happy.
    I’ve learn this post and if I may just I desire to suggest you few attention-grabbing things or suggestions.
    Perhaps you can write next articles relating to this article.
    I want to learn even more things about it!

  17. Wonderful post but I was wanting to know if you could write a litte more on this subject?

    I’d be very thankful if you could elaborate a little bit further.
    Thanks!

  18. I think everything wrote made a lot of sense. However, consider this, suppose you were to write a
    killer headline? I mean, I don’t wish to tell you how to run your blog, however
    what if you added a headline that makes people want more?

    I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku
    – Umar faisol is kinda plain. You might look at Yahoo’s home page and see how they
    create news titles to get people interested. You might add a related video or a picture
    or two to grab readers excited about what you’ve got to say.

    Just my opinion, it might bring your website a little livelier.

  19. I like the valuable info you provide on your articles.

    I’ll bookmark your weblog and test once more right here frequently.

    I am moderately certain I’ll be told many new stuff
    right here! Good luck for the next!

  20. Hi! Do you know if they make any plugins
    to protect against hackers? I’m kinda paranoid about losing
    everything I’ve worked hard on. Any suggestions?

  21. This is very fascinating, You’re an overly skilled blogger.
    I’ve joined your rss feed and look forward to seeking extra of your excellent post.
    Additionally, I’ve shared your web site in my social networks

  22. What i don’t realize is in reality how you’re not actually much more well-appreciated
    than you may be now. You are so intelligent. You understand therefore considerably in the
    case of this subject, made me in my opinion believe it from so many
    various angles. Its like men and women are not interested until it is one thing to accomplish with Girl gaga!
    Your personal stuffs nice. Always deal with it up!

  23. First of all I would like to say superb blog! I had a quick question which I’d like to ask if you do not mind.
    I was interested to know how you center yourself and clear your thoughts prior to writing.

    I have had a difficult time clearing my thoughts in getting
    my ideas out. I truly do take pleasure in writing however
    it just seems like the first 10 to 15 minutes tend to be wasted just
    trying to figure out how to begin. Any suggestions or hints?
    Many thanks!

  24. Hey there! 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. Many thanks!

  25. Undeniably believe that that you said. Your favourite reason appeared to be on the net the easiest factor
    to consider of. I say to you, I definitely get
    irked whilst people think about issues that they just do not
    recognise about. You controlled to hit the nail upon the top and also
    defined out the whole thing with no need side effect , people could take a signal.
    Will likely be back to get more. Thank you

  26. Do you mind if I quote a few of your articles as long
    as I provide credit and sources back to your website?
    My blog site is in the exact same area of interest as yours
    and my users would definitely benefit from a lot of the information you provide here.

    Please let me know if this ok with you. Thanks a lot!

Comments are closed.