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! Quick question that’s entirely off topic. Do you know how to make your site
    mobile friendly? My blog looks weird when browsing from my iphone 4.
    I’m trying to find a theme or plugin that might be able to fix this issue.
    If you have any suggestions, please share.
    Cheers!

  2. It’s a pity you don’t have a donate button! I’d certainly donate to this
    superb blog! I guess for now i’ll settle for bookmarking 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.
    Talk soon!

  3. Hi there, i read your blog occasionally and i own a
    similar one and i was just wondering if you get a lot of spam
    responses? If so how do you prevent it, any plugin or anything you can suggest?
    I get so much lately it’s driving me crazy so any support is very much appreciated.

  4. I simply could not leave your site prior to suggesting that I extremely loved the usual
    information an individual supply to your visitors? Is gonna be
    back continuously in order to investigate cross-check new posts

  5. I think this is among the most important information for
    me. And i am glad reading your article. But should remark on few general things, The site style is
    perfect, the articles is really excellent : D. Good job,
    cheers

  6. You actually make it seem so easy with your presentation but I find
    this topic to be really something that I think I would
    never understand. It seems too complicated and very broad for me.

    I am looking forward for your next post, I’ll try to get the hang
    of it!

  7. hello there and thank you for your info – I’ve certainly picked up anything new from right
    here. I did however expertise a few technical issues using this web site,
    as I experienced to reload the web site 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 sluggish loading instances times will often affect your placement in google and could damage your high quality score if ads and marketing with Adwords.
    Anyway I am adding this RSS to my email and could look out for a lot more of your respective interesting content.
    Make sure you update this again soon.

  8. I don’t even understand how I stopped up right here,
    however I thought this publish was once good.
    I do not know who you might be however definitely you’re going to a well-known blogger when you
    are not already. Cheers!

  9. appealing review. Also visit the particular site which are often played
    out slot pulsa online. These kinds of web page has received endorsement
    out of slot wagering folks in Negara sendiri.
    So there are generally many attractive promos scenario join today.

  10. I think the admin of this website is genuinely working hard in support
    of his web site, as here every material is quality based information.

  11. Hiya! Quick question that’s entirely off topic.
    Do you know how to make your site mobile friendly?
    My website looks weird when browsing from my iphone 4.
    I’m trying to find a template or plugin that might be able to resolve this issue.
    If you have any recommendations, please share. Cheers!

  12. I was curious if you ever thought of changing the structure
    of your website? 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 2 images.
    Maybe you could space it out better?

  13. Hi! This is my first visit to your blog! We are a group of volunteers and
    starting a new initiative in a community
    in the same niche. Your blog provided us useful information to work on. You have done a wonderful job!

  14. That is a great tip particularly to those new to
    the blogosphere. Brief but very accurate information… Many thanks for sharing this one.
    A must read post!

  15. wonderful put up, very informative. I’m wondering why the opposite experts of
    this sector do not notice this. You must continue your writing.
    I am confident, you’ve a great readers’ base already!

  16. Magnificent beat ! I wish to apprentice whilst you amend your website,
    how can i subscribe for a weblog web site? The account helped me a applicable deal.

    I had been a little bit familiar of this your broadcast offered vibrant transparent
    idea

  17. significant review. In addition visit our site to see judi slot.
    This excellent site has received likability originating from slot deposit pulsa video
    games players in Negara sendiri. There will be loads of advisable promos if you ever join presently.

  18. Thanks for the auspicious writeup. It in reality used to be a
    entertainment account it. Look advanced to more added agreeable from you!
    However, how could we keep up a correspondence?

  19. Thank you a bunch for sharing this with all people you
    actually know what you’re talking approximately! Bookmarked.

    Please also talk over with my website =). We may have
    a link trade contract between us

  20. Link exchange is nothing else however it is just placing the other person’s web site link on your
    page at suitable place and other person will also do similar
    in favor of you.

  21. This is really interesting, You’re a very skilled blogger.
    I have joined your feed and look forward to seeking more
    of your fantastic post. Also, I have shared your site
    in my social networks!

  22. Have you ever thought about including a little bit more than just your articles?
    I mean, what you say is fundamental and all.
    But just imagine if you added some great graphics or videos to give your posts more, “pop”!
    Your content is excellent but with images and videos, this blog could certainly
    be one of the greatest in its field. Excellent blog!

  23. Hi there! This is kind of off topic but I need some advice from an established blog.

    Is it very difficult to set up your own blog?
    I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where
    to start. Do you have any ideas or suggestions? Thanks

  24. excellent points altogether, you just received a new reader.
    What would you suggest about your put up that you made some days ago?
    Any sure?

  25. It’s genuinely very difficult in this active life to listen news on Television, therefore I simply use web for that reason, and obtain the most up-to-date news.

  26. Superb post but 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 more. Thanks!

  27. I loved as much as you’ll receive carried out right here.

    The sketch is attractive, your authored subject matter stylish.

    nonetheless, you command get got an edginess over that you wish
    be delivering the following. unwell unquestionably come further formerly again since exactly
    the same nearly very often inside case you shield this increase.

  28. We are a gaggle of volunteers and opening a new scheme in our community.
    Your site provided us with valuable information to work on. You’ve done an impressive
    task and our entire community can be thankful to
    you.

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

  30. great submit, very informative. I ponder why the opposite specialists of this sector don’t notice this.
    You should proceed your writing. I’m confident, you have a huge readers’ base already!

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

Comments are closed.