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

  1. Hey there I am so happy I found your webpage, I really found you by error,
    while I was looking on Digg for something else, Anyhow I am
    here now and would just like to say thanks for a incredible post
    and a all round enjoyable blog (I also love the theme/design), I
    don’t have time to look over it all at the minute but I have saved it and also included your RSS
    feeds, so when I have time I will be back to read much more, Please do keep up the awesome job.

  2. I think this is among the most vital information for me. And i’m glad reading
    your article. But wanna remark on some general things, The website style is great, the
    articles is really nice : D. Good job, cheers

  3. really interesting review. Inside a similar fashion visit the site to be able to game slot.

    This specific web-site has received identification from the video slot machine gambling contributors in Indonesia.

    At this time there are several interesting promos if you
    happen to join here.

  4. An outstanding share! I have just forwarded this onto a coworker
    who had been doing a little research on this.
    And he actually bought me breakfast simply because I discovered it for him…
    lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending the time to discuss this subject here on your web page.

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

  6. Wow, marvelous weblog layout! How lengthy have you been running a blog
    for? you make blogging look easy. The total glance of your website is
    magnificent, as well as the content!

  7. Howdy! This blog post couldn’t be written much better!
    Going through this post reminds me of my previous roommate!
    He always kept talking about this. I most certainly will send this
    information to him. Fairly certain he will have a very good read.

    I appreciate you for sharing!

  8. Greetings from California! I’m bored to death at work so I decided
    to check out your site on my iphone during lunch break.
    I enjoy the info you present here and can’t wait to take a
    look when I get home. I’m amazed at how fast your blog loaded
    on my cell phone .. I’m not even using WIFI, just 3G ..
    Anyhow, wonderful site!

  9. Attractive section of content. I just stumbled upon your site
    and in accession capital to assert that I get
    actually enjoyed account your blog posts. Any way I’ll be subscribing to your augment and
    even I achievement you access consistently quickly.

  10. When I originally commented I seem to have clicked the -Notify me
    when new comments are added- checkbox and now each time a comment
    is added I get four emails with the same comment.

    Perhaps there is a way you can remove me from that
    service? Appreciate it!

  11. I am regular visitor, how are you everybody?
    This paragraph posted at this web page is truly pleasant.

  12. We are a gaggle of volunteers and starting a new scheme in our community.
    Your site offered us with valuable information to work
    on. You have performed an impressive task and our whole
    community will be grateful to you.

  13. This is a really good tip particularly to those new
    to the blogosphere. Simple but very precise info… Thanks
    for sharing this one. A must read article!

  14. I was curious if you ever considered changing the structure of
    your blog? 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 1 or two images.
    Maybe you could space it out better?

  15. Yesterday, while I was at work, my cousin stole my iphone and tested to see
    if it can survive a twenty five foot drop, just so she can be a youtube sensation. My iPad is now destroyed and she has
    83 views. I know this is entirely off topic but I had to share
    it with someone!

  16. Hello there, I found your website by the use of Google at the same time as
    looking for a comparable subject, your web site got here up, it looks good.
    I have bookmarked it in my google bookmarks.
    Hello there, simply turned into alert to your weblog thru
    Google, and found that it is really informative.
    I am going to watch out for brussels. I will be grateful
    in case you proceed this {in future}. Lots of other people will
    probably be benefited from your writing. Cheers!

  17. I am curious to find out what blog system you happen to be working with?
    I’m having some small security issues with my latest website
    and I’d like to find something more safeguarded. Do you have any solutions?

  18. I have been browsing online more than three hours today, yet I never found any interesting article like yours.
    It’s pretty worth enough for me. In my opinion, if all site
    owners and bloggers made good content as you did, the web will
    be a lot more useful than ever before.

  19. My family every time say that I am wasting my time here
    at net, however I know I am getting knowledge everyday
    by reading thes pleasant articles or reviews.

  20. Have you ever considered writing an e-book or guest authoring
    on other blogs? I have a blog based on the same information you discuss and would love to have you share some stories/information. I know my
    viewers would appreciate your work. If you are even remotely interested, feel free to send me an e-mail.

  21. Its like you read my mind! You seem to know a lot about this, like you wrote the book
    in it or something. I think that you could do with a few pics to drive the message home
    a bit, but other than that, this is excellent blog.

    A great read. I’ll certainly be back.

  22. I’m not sure why but this blog is loading incredibly slow for
    me. Is anyone else having this problem or is it a issue on my end?
    I’ll check back later and see if the problem still exists.

  23. Hello! This is my first visit to your blog! We are a collection 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 outstanding job!

  24. fantastic post, very informative. I’m wondering why the opposite specialists of
    this sector don’t understand this. You must proceed your writing.
    I’m sure, you’ve a huge readers’ base already!

  25. After I originally left a comment I appear to have clicked the -Notify me when new
    comments are added- checkbox and from now on each time a comment is added
    I recieve 4 emails with the same comment. Perhaps there
    is an easy method you are able to remove me from
    that service? Many thanks!

  26. I think everything wrote was very reasonable.
    However, think on this, suppose you wrote a catchier post title?
    I mean, I don’t want to tell you how to run your blog, 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 boring. You could glance at Yahoo’s front page
    and watch how they create post headlines to grab viewers to open the links.
    You might add a related video or a related pic or two to get
    readers interested about what you’ve written. Just my opinion, it could make your blog a little bit more interesting.

Comments are closed.