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. fascinating review. Also visit the particular site that happen to be played out slot pulsa tanpa potongan. This specific web site has received name received from
    slot online wagering persons in Indonesia. Truth be told there tend to be many very helpful
    promos in the event you join presently.

  2. Hey there! This is kind of off topic but I need some advice from an established blog.
    Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast.

    I’m thinking about creating my own but I’m not sure where to begin. Do you have
    any points or suggestions? Many thanks

  3. I was wondering if you ever considered changing the layout of your site?
    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?

  4. Great blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple tweeks would really make my
    blog shine. Please let me know where you got your theme.
    Thanks

  5. This design is wicked! You definitely know how to keep a reader amused.
    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!

  6. Hey! I understand this is somewhat off-topic however I needed to ask.
    Does managing a well-established website like yours take a large
    amount of work? I’m brand new to running a blog however I do write in my journal everyday.
    I’d like to start a blog so I can share my personal experience
    and feelings online. Please let me know if you have any ideas or tips for
    new aspiring blog owners. Thankyou!

  7. 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 throw away your intelligence on just posting videos to your
    weblog when you could be giving us something enlightening to read?

  8. My brother recommended I might like this blog. He was entirely right.
    This post actually made my day. You can not imagine simply how much time I had spent
    for this information! Thanks!

  9. Hey there! This is my first visit to your
    blog! We are a group of volunteers and starting a new project in a
    community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!

  10. I have been exploring for a little bit for any high quality articles or weblog posts in this kind
    of area . Exploring in Yahoo I ultimately stumbled upon this
    site. Reading this information So i’m satisfied
    to exhibit that I have a very good uncanny feeling I
    discovered just what I needed. I such a lot for sure will make certain to don?t overlook this web site and provides it
    a glance on a constant basis.

  11. Pretty section of content. I just stumbled upon your site and in accession capital to
    assert that I acquire in fact enjoyed account your blog posts.
    Anyway I will be subscribing to your augment and even I
    achievement you access consistently fast.

  12. 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.

  13. Oh my goodness! Incredible article dude! Thank you, However I am experiencing issues with your RSS.
    I don’t know why I am unable to subscribe to it.
    Is there anybody else having the same RSS problems? Anybody who knows the answer will you kindly respond?

    Thanx!!

  14. I do agree with all the ideas you have introduced in your post.
    They are very convincing and can definitely work. Nonetheless, the posts are very brief for newbies.
    May just you please extend them a little from next time?
    Thank you for the post.

  15. Excellent beat ! I wish to apprentice while you amend
    your site, how could i subscribe for a blog site?

    The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided vivid clear idea

  16. Thanks for another fantastic post. The place else could
    anyone get that kind of information in such a perfect means of
    writing? I’ve a presentation subsequent week, and I’m on the look for such info.

  17. Tremendous issues here. I’m very happy to look your post.
    Thanks so much and I am taking a look ahead to
    contact you. Will you please drop me a e-mail?

  18. Have you ever considered about adding a little bit more than just your
    articles? I mean, what you say is valuable 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 blog could
    certainly be one of the very best in its field. Fantastic blog!

  19. An outstanding share! I’ve just forwarded this onto a co-worker who has been conducting a little research on this.
    And he actually ordered me lunch due to the fact that I found it
    for him… lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanx for spending some time to talk about this
    matter here on your web site.

  20. Excellent weblog here! Also your website loads up very fast!
    What web host are you using? Can I am getting your associate hyperlink for your host?
    I wish my site loaded up as quickly as yours lol

  21. obviously like your web site but you need to test the spelling on quite a few of
    your posts. Several of them are rife with spelling issues and I in finding it very troublesome to inform the truth on the
    other hand I’ll surely come back again.

  22. Hey just wanted to give you a quick heads up. The words in your content seem
    to be running off the screen in Chrome. I’m not sure if this is a formatting issue or
    something to do with internet browser compatibility but I figured I’d post to
    let you know. The layout look great though!

    Hope you get the issue solved soon. Cheers

  23. Hello There. I discovered your weblog the use of msn. That is
    an extremely well written article. I’ll be sure to bookmark it
    and come back to learn more of your helpful information. Thank you for the post.

    I will certainly comeback.

  24. My programmer is trying to convince me to move to .net from
    PHP. I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on numerous websites for about a
    year and am worried about switching to another platform.
    I have heard excellent things about blogengine.net.
    Is there a way I can import all my wordpress content into
    it? Any kind of help would be greatly appreciated!

Comments are closed.