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. An outstanding share! I’ve just forwarded this onto a colleague who has
    been conducting a little research on this. And he
    in fact bought me dinner simply because I found it for him…
    lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanx for spending time to discuss this topic
    here on your site.

  2. I think this is among the most important info for me. And i am glad reading your article.
    But wanna remark on some general things, The web site style is great, the articles is really nice : D.
    Good job, cheers

  3. I think everything published was actually very reasonable.
    But, what about this? suppose you added a little information? I mean, I don’t want to
    tell you how to run your website, however what if you
    added something to possibly grab folk’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku
    – Umar faisol is a little vanilla. You might glance at
    Yahoo’s home page and note how they create news headlines to grab viewers to click.
    You might add a video or a picture or two to grab readers excited about everything’ve
    got to say. Just my opinion, it might make your posts a little livelier.

  4. I feel that is one of the most significant info for me.
    And i’m happy studying your article. But want to statement on some common things, The website taste is
    wonderful, the articles is in point of fact excellent : D.
    Just right task, cheers

  5. The other day, while I was at work, my sister stole my iPad and tested to see if it can survive a forty foot
    drop, just so she can be a youtube sensation. My iPad is now destroyed and she has 83 views.

    I know this is completely off topic but I had to share it with
    someone!

  6. Hmm it appears like your site ate my first comment (it was super
    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 the whole thing.
    Do you have any suggestions for novice blog writers? I’d
    certainly appreciate it.

  7. I’m gone to say to my little brother, that he should also go
    to see this weblog on regular basis to obtain updated from most up-to-date reports.

  8. Asking questions are truly fastidious thing if you are not understanding anything entirely, except this paragraph provides good understanding even.

  9. Hi 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 outcome.

  10. Please let me know if you’re looking for a author for your weblog.
    You have some really good articles and I feel I would be a good asset.
    If you ever want to take some of the load off, I’d absolutely love to
    write some articles for your blog in exchange
    for a link back to mine. Please blast me an e-mail if interested.
    Regards!

  11. When I initially left a comment I seem to have clicked the
    -Notify me when new comments are added- checkbox
    and now whenever a comment is added I receive 4 emails with the
    exact same comment. Is there an easy method you are able to remove
    me from that service? Thanks a lot!

  12. We absolutely love your blog and find the majority of your post’s to be just what I’m looking for.
    Do you offer guest writers to write content for yourself?
    I wouldn’t mind writing a post or elaborating on many of the subjects you write related to here.
    Again, awesome web log!

  13. It’s a pity you don’t have a donate button! I’d definitely donate to this brilliant blog!
    I guess for now i’ll settle for book-marking and adding your RSS feed to
    my Google account. I look forward to new updates
    and will share this site with my Facebook group. Talk soon!

  14. Woah! I’m really digging the template/theme of this blog.
    It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and
    appearance. I must say you’ve done a excellent
    job with this. In addition, the blog loads very fast for me on Internet explorer.

    Outstanding Blog!

  15. Howdy! 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 valuable information to work on. You have
    done a marvellous job!

  16. whoah this blog is great i really like studying your posts.
    Stay up the good work! You realize, a lot of people are looking round for
    this information, you could aid them greatly.

  17. Hi, I do believe this is an excellent blog. I
    stumbledupon it 😉 I am going to come back once again since i have book-marked it.
    Money and freedom is the best way to change, may you be rich and continue to guide other people.

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

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

  19. What’s Happening i’m new to this, I stumbled upon this I have found
    It absolutely helpful and it has helped me out loads. I am hoping to give a contribution & aid
    different customers like its helped me. Good job.

  20. Hello! I know this is kind of off topic but I was wondering if you knew
    where I could find 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!

  21. Having read this I thought it was very enlightening. I appreciate you taking the time and energy to put this short article together.

    I once again find myself spending a lot of
    time both reading and leaving comments. But so what, it was still worthwhile!

  22. It’s a pity you don’t have a donate button! I’d most certainly donate to this outstanding 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 site with my Facebook group. Chat soon!

  23. Howdy! I could have sworn I’ve been to this
    site before but after browsing through some of the post I realized it’s new
    to me. Anyways, I’m definitely glad I found it and I’ll
    be bookmarking and checking back often!

  24. It’s in reality a great and useful piece of information. I
    am happy that you shared this useful information with us.
    Please keep us informed like this. Thank you for sharing.

Comments are closed.