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. I have been exploring for a little for any high quality articles or blog posts on this kind of area .
    Exploring in Yahoo I at last stumbled upon this web site.
    Reading this info So i am happy to exhibit that I
    have an incredibly good uncanny feeling I discovered exactly what
    I needed. I such a lot certainly will make sure to don?t put out of your mind this site and
    provides it a look on a continuing basis.

  2. Wow, superb blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your
    web site is fantastic, as well as the content!

  3. Its such as you read my thoughts! You appear
    to know a lot approximately this, like you wrote the e-book in it
    or something. I believe that you simply can do with a few % to force the message home a bit, but
    other than that, that is fantastic blog. A fantastic read.
    I’ll definitely be back.

  4. hello there and thank you for your info – I have definitely picked up
    something new from right here. I did however expertise a few technical
    points using this web site, since I experienced to
    reload the web site many times previous to I could
    get it to load properly. 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 can damage your high-quality score if advertising
    and marketing with Adwords. Anyway I am adding this RSS to my
    email and could look out for a lot more of your respective intriguing content.
    Ensure that you update this again soon.

  5. I’m curious to find out what blog platform you’re utilizing?

    I’m experiencing some small security problems with my latest website and I’d like to find something more safeguarded.
    Do you have any suggestions?

  6. Thanks for a marvelous posting! I certainly enjoyed reading it, you happen to
    be a great author.I will be sure to bookmark your blog and will often come back from now on. I want to encourage you to ultimately continue your great work, have a nice evening!

  7. Good day! I know this is kinda off topic however , I’d figured I’d
    ask. Would you be interested in trading links or maybe guest writing a blog article or vice-versa?
    My site addresses a lot of the same subjects as yours and
    I feel we could greatly benefit from each other. If you are interested feel free to shoot me
    an e-mail. I look forward to hearing from you!
    Terrific blog by the way!

  8. I know this if off topic but I’m looking into starting my own blog
    and was wondering what all is required to get setup? I’m assuming having
    a blog like yours would cost a pretty penny? I’m not very web smart so
    I’m not 100% certain. Any suggestions or advice would be greatly appreciated.
    Kudos

  9. Hello there, I discovered your site by means of Google while searching for a related subject,
    your web site came up, it looks good. I have bookmarked it in my google bookmarks.

    Hello there, just become alert to your weblog thru Google, and located that it is really informative.
    I am gonna watch out for brussels. I will be grateful if you happen to
    continue this {in future}. A lot of folks will be benefited from your writing.
    Cheers!

  10. My partner and I absolutely love your blog and find a lot of
    your post’s to be precisely what I’m looking for. Would you offer guest writers
    to write content for you personally? I wouldn’t mind producing a post or elaborating on a few of the subjects you write in relation to here.
    Again, awesome site!

  11. I think that what you published made a lot of sense.
    However, think about this, what if you were to write
    a killer title? I ain’t suggesting your information isn’t good., but
    what if you added a title that makes people desire more?
    I mean Contoh Soal Pemrograman – Pola
    Segitiga Siku-siku – Umar faisol is a little vanilla.
    You might peek at Yahoo’s front page and note how they create news headlines to grab people
    interested. You might add a video or a related pic
    or two to get readers interested about what you’ve written. In my opinion, it
    might bring your blog a little livelier.

  12. Hello! I could have sworn I’ve been to this web site before but after going through many of the articles I realized it’s new to me.
    Anyways, I’m definitely pleased I discovered it and I’ll
    be book-marking it and checking back frequently!

  13. You really make it seem so easy with your presentation but I find this matter to be really something which I think I would never understand.
    It seems too complex and extremely broad for me.
    I’m looking forward for your next post, I will try to get
    the hang of it!

  14. It’s truly very complicated in this busy life to listen news
    on Television, thus I only use web for that reason, and
    take the most up-to-date information.

  15. Oh my goodness! Awesome article dude! Thank you so much, However I am
    encountering problems with your RSS. I don’t understand the reason why I cannot join it.

    Is there anybody getting identical RSS issues?
    Anyone who knows the solution can you kindly respond?
    Thanx!!

  16. Hey! Quick question that’s totally off topic. Do you
    know how to make your site mobile friendly?
    My web site looks weird when browsing from my apple iphone.
    I’m trying to find a template or plugin that might be able to fix this
    problem. If you have any suggestions, please share.
    With thanks!

  17. Hey there! I know this is somewhat off-topic however
    I needed to ask. Does managing a well-established blog like yours
    take a large amount of work? I’m brand new to running a blog but I do
    write in my journal everyday. I’d like to start a blog
    so I can easily share my own experience and views online.
    Please let me know if you have any ideas or tips for new aspiring
    bloggers. Appreciate it!

  18. I like the helpful info you provide for your
    articles. I’ll bookmark your weblog and take a look at once more here frequently.
    I’m moderately certain I’ll learn many new stuff proper right
    here! Good luck for the next!

  19. Sweet blog! I found it while surfing around on Yahoo News.
    Do you have any suggestions on how to get listed in Yahoo
    News? I’ve been trying for a while but I never seem to get there!
    Cheers

  20. Yesterday, while I was at work, my sister stole my apple ipad and tested to see if it can survive a thirty foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has
    83 views. I know this is totally off topic but I had to share it with
    someone!

  21. Hey, I think your website might be having browser compatibility issues.
    When I look at your website in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, amazing blog!

Comments are closed.