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,219 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. Thank you for every other informative web site.
    Where else may just I get that kind of info written in such
    a perfect approach? I have a undertaking that I am simply now running on, and I have been on the
    glance out for such info.

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

  3. With havin so much content do you ever run into any problems of plagorism or
    copyright violation? My site has a lot of completely unique content I’ve either authored myself or outsourced but it
    appears a lot of it is popping it up all over the internet without my agreement.
    Do you know any solutions to help protect against content from being
    stolen? I’d certainly appreciate it.

  4. You actually make it seem really easy together with your presentation however I find this topic to be actually
    one thing that I think I might never understand. It sort of feels
    too complicated and very wide for me. I’m having a look ahead in your next publish, I
    will try to get the dangle of it!

  5. you’re in reality a just right webmaster. The web site loading velocity is incredible.
    It kind of feels that you’re doing any distinctive trick. In addition, The
    contents are masterpiece. you’ve done a wonderful task in this topic!

  6. Hmm it looks like your website ate my first comment (it was extremely long) so I guess I’ll
    just sum it up what I had written and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog blogger but I’m still new to everything.

    Do you have any recommendations for novice blog writers?

    I’d genuinely appreciate it.

  7. I’m impressed, I must say. Rarely do I come across a blog that’s
    both equally educative and amusing, and let me tell you, you’ve hit the
    nail on the head. The problem is something too
    few folks are speaking intelligently about. I am very happy I stumbled across this in my search for something regarding
    this.

  8. Thanks for ones marvelous posting! I truly enjoyed reading it,
    you will be a great author. I will be sure to bookmark your blog and will
    come back from now on. I want to encourage one to continue your great posts,
    have a nice holiday weekend!

  9. This design is spectacular! You most certainly
    know how to keep a reader entertained. Between your wit and your videos, I
    was almost moved to start my own blog (well, almost…HaHa!) Excellent job.

    I really enjoyed what you had to say, and more than that,
    how you presented it. Too cool!

  10. I would like to thank you for the efforts you’ve put in writing this website.
    I am hoping to see the same high-grade content by you in the future as well.
    In truth, your creative writing abilities has encouraged me to get my own, personal
    site now 😉

  11. Having read this I thought it was very informative. I appreciate you spending some time and energy to put this content together.

    I once again find myself spending way too much time both reading
    and posting comments. But so what, it was still worthwhile!

  12. Aw, this was an extremely good post. Taking the time and actual effort
    to create a superb article? but what can I say? I procrastinate a lot and don’t manage to get nearly anything done.

    my web page: 23.95.102.216

  13. Good post. I learn something new and challenging on sites I stumbleupon on a daily
    basis. It will always be exciting to read through content from other authors and use
    something from other sites.

  14. Nice post. I was checking constantly this blog and I’m inspired!
    Extremely useful info specifically the ultimate phase 🙂 I
    take care of such information much. I was seeking this certain information for a very lengthy
    time. Thanks and best of luck.

  15. I like the valuable information you provide in your
    articles. I will bookmark your weblog and check
    again here frequently. I am quite sure I’ll learn plenty of new stuff right here!
    Good luck for the next!

  16. Hmm is anyone else experiencing problems with the images on this blog
    loading? I’m trying to figure out if its a problem on my end or
    if it’s the blog. Any responses would be greatly appreciated.

  17. I just couldn’t leave your website before suggesting
    that I really loved the usual info an individual provide on your visitors?

    Is going to be again regularly in order to check up on new posts

  18. It’s really a great and useful piece of information. I’m
    satisfied that you shared this useful info with us. Please
    stay us informed like this. Thanks for sharing.

  19. Hmm is anyone else encountering problems with the pictures on this blog loading?

    I’m trying to figure out if its a problem on my end or if it’s
    the blog. Any suggestions would be greatly appreciated.

  20. I like the helpful info you provide in your articles.
    I’ll bookmark your weblog and check again here regularly.

    I am quite certain I will learn a lot of new stuff right here!
    Good luck for the next!

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

  22. I have been surfing on-line more than three hours these days, yet I never discovered any attention-grabbing article like yours.
    It’s pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you
    did, the net will probably be a lot more useful than ever
    before.

  23. Have you ever thought about including a little bit more than just your
    articles? I mean, what you say is valuable and all.
    However think of if you added some great pictures or video clips to give
    your posts more, “pop”! Your content is excellent but with
    images and video clips, this site could definitely be one of the most beneficial in its field.

    Superb blog!

  24. continuously i used to read smaller articles that also
    clear their motive, and that is also happening with
    this piece of writing which I am reading now.

  25. Hey there! I know this is kind of off topic but I was wondering if you knew where I could
    locate a captcha plugin for my comment form? I’m using
    the same blog platform as yours and I’m having trouble
    finding one? Thanks a lot!

  26. Howdy! This article could not be written any better!
    Going through this article reminds me of my previous roommate!
    He always kept talking about this. I’ll forward this post to him.
    Pretty sure he’ll have a good read. Many thanks for sharing!

    My site :: skin care tips

  27. An outstanding share! I’ve just forwarded this onto a coworker
    who had been doing a little homework on this. And he actually bought me
    lunch due to the fact that I stumbled upon it for him…
    lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending time to talk about this topic here
    on your blog.

  28. Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again. Anyways, just wanted
    to say excellent blog!

  29. I am really loving the theme/design of your website.
    Do you ever run into any web browser compatibility problems?

    A number of my blog readers have complained about my website not working
    correctly in Explorer but looks great in Firefox.
    Do you have any ideas to help fix this problem?

Comments are closed.