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

  1. great put up, very informative. I ponder why the other specialists of this sector don’t realize this.
    You should continue your writing. I am sure, you’ve a huge readers’
    base already!

  2. A motivating discussion is worth comment. I think that you ought
    to write more on this topic, it may not be a taboo matter but generally folks don’t speak about these issues.
    To the next! Many thanks!!

  3. My partner and I stumbled over here coming from a
    different website and thought I might check things out.
    I like what I see so i am just following you. Look forward to checking out your web page again.

  4. I blog quite often and I really appreciate your information. Your article
    has really peaked my interest. I will bookmark your site
    and keep checking for new details about once a week. I subscribed to your RSS feed as well.

  5. I’m really enjoying the theme/design of your
    site. Do you ever run into any web browser compatibility issues?

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

  6. You really make it seem so easy along with your presentation but I in finding this topic to be
    actually one thing which I believe I might by no
    means understand. It sort of feels too complicated and very large for me.
    I am having a look forward for your next submit,
    I will try to get the dangle of it!

  7. hey there and thank you for your information – I have definitely picked
    up anything new from right here. I did however expertise a few technical issues using this website, since I experienced to reload
    the web site lots of times previous to I could get it to load properly.

    I had been wondering if your web host is OK? Not that I’m complaining, but slow loading instances times will very
    frequently affect your placement in google and
    could damage your quality score if advertising and marketing with Adwords.
    Anyway I am adding this RSS to my e-mail and could look out for a
    lot more of your respective interesting content. Make sure
    you update this again very soon.

  8. Hey I know this is off topic but I was wondering if you knew of
    any widgets I could add to my blog that automatically tweet my
    newest twitter updates. I’ve been looking for a plug-in like this
    for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything.

    I truly enjoy reading your blog and I look forward to your new updates.

  9. I loved as much as you will receive carried out right here.

    The sketch is tasteful, your authored material stylish.
    nonetheless, you command get got an shakiness over that you wish be delivering the
    following. unwell unquestionably come further formerly again since exactly the same nearly a
    lot often inside case you shield this hike.

  10. Hiya! I know this is kinda off topic however I’d figured I’d ask.

    Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa?
    My blog covers a lot of the same topics as yours and I believe we
    could greatly benefit from each other. If you might be interested
    feel free to shoot me an email. I look forward to hearing from you!
    Fantastic blog by the way!

  11. May I just say what a relief to discover someone that genuinely knows what
    they are talking about online. You definitely understand how to bring a
    problem to light and make it important. More people have to check this out and understand this side of the story.
    I can’t believe you are not more popular given that you certainly possess the gift.

  12. Hmm it seems like your site ate my first comment (it was extremely long)
    so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog blogger but I’m still new to
    the whole thing. Do you have any helpful hints for novice
    blog writers? I’d certainly appreciate it.

  13. Do you mind if I quote a few of your articles as long as I provide
    credit and sources back to your blog? My blog site is in the very same area of interest as
    yours and my visitors would truly benefit from some of the information you provide here.
    Please let me know if this okay with you. Thanks!

  14. Excellent blog you have here but I was wanting to know if
    you knew of any forums that cover the same topics talked about in this
    article? I’d really like to be a part of group where I can get comments from other knowledgeable individuals
    that share the same interest. If you have any recommendations, please let me know.
    Thanks a lot!

  15. Hey there! I know this is sort of off-topic however I needed to ask.
    Does managing a well-established website like yours take a lot
    of work? I am brand new to blogging but I do write
    in my diary daily. I’d like to start a blog so I can easily share my personal experience and views online.
    Please let me know if you have any kind of ideas or tips for brand new aspiring bloggers.
    Appreciate it!

  16. Link exchange is nothing else except it is just placing the other person’s website link on your page
    at appropriate place and other person will also do similar in support of you.

  17. Great beat ! I would like to apprentice while you amend your web site,
    how could i subscribe for a blog website? The account aided
    me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered
    bright clear idea

  18. Heya just wanted to give you a brief heads up and
    let you know a few of the images aren’t loading correctly.
    I’m not sure why but I think its a linking issue.

    I’ve tried it in two different browsers and both show the same results.

  19. Everyone loves what you guys are up too. This kind of clever work and coverage!
    Keep up the very good works guys I’ve included you guys to my blogroll.

  20. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your next write ups thanks once again.

  21. Woah! I’m really loving the template/theme of this
    site. It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between superb usability and visual appearance.
    I must say you have done a fantastic job with this. In addition, the
    blog loads extremely quick for me on Chrome.

    Excellent Blog!

  22. It’s wonderful that you are getting ideas from this post as well as
    from our discussion made at this place.

  23. Howdy, I do believe your website could possibly be having web browser compatibility issues.
    When I look at your site in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping issues.
    I merely wanted to provide you with a quick heads up!
    Apart from that, excellent site!

  24. Link exchange is nothing else but it is only placing the other
    person’s website link on your page at proper place and other person will also do same in favor of you.

  25. Greetings! Quick question that’s totally off topic.
    Do you know how to make your site mobile friendly?
    My blog looks weird when viewing from my iphone.

    I’m trying to find a template or plugin that might be able to correct
    this problem. If you have any recommendations, please share.
    Many thanks!

  26. Heya terrific website! Does running a blog like this take a
    lot of work? I have very little understanding of programming however I was
    hoping to start my own blog in the near future.
    Anyhow, should you have any recommendations or tips for new blog
    owners please share. I know this is off subject however I simply had to ask.
    Thanks!

  27. Admiring the commitment you put into your website and in depth information you
    present. It’s great to come across a blog every once in a while that isn’t the same unwanted rehashed material.
    Excellent read! I’ve bookmarked your site and
    I’m including your RSS feeds to my Google account.

  28. Good post however , I was wondering if you could
    write a litte more on this subject? I’d be very thankful if you could elaborate a little bit further.
    Kudos!

  29. Have you ever thought about adding a little bit more than just your
    articles? I mean, what you say is fundamental and everything.

    Nevertheless think about if you added some
    great visuals or videos to give your posts more, “pop”!
    Your content is excellent but with images and videos, this website could undeniably be one of the very best in its niche.
    Very good blog!

  30. What’s Going down i’m new to this, I stumbled upon this
    I have found It positively useful and it has aided me out loads.
    I hope to give a contribution & aid other users like
    its aided me. Great job.

Comments are closed.