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. Great post. I was checking continuously this blog and
    I am impressed! Extremely helpful information specifically the
    last part 🙂 I care for such info a lot. I was looking for
    this certain info for a long time. Thank you and best of
    luck.

  2. Thank you, I have just been looking for info approximately this topic for a long time and yours is the best I’ve came upon so far.

    But, what about the bottom line? Are you positive about the supply?

  3. It is appropriate time to make some plans for the future and
    it’s time to be happy. I’ve read this post and if I could I want to suggest you some
    interesting things or suggestions. Maybe you could write next articles referring to this article.
    I wish to read even more things about it!

  4. Wonderful goods from you, man. I have understand your stuff previous to and you are just too wonderful.
    I really like what you have acquired here, certainly like what you’re saying and the way in which
    you say it. You make it entertaining and you still take
    care of to keep it wise. I cant wait to read much more from you.
    This is really a great site.

  5. I think this is among the most significant information for me.

    And i’m glad reading your article. But wanna remark on some
    general things, The site style is perfect, the articles is really excellent : D.
    Good job, cheers

  6. It’s nearly impossible to find educated people for this topic, but you sound like you know what
    you’re talking about! Thanks

  7. I was recommended this website by my cousin. I’m not sure whether this
    post is written by him as nobody else know such detailed about my problem.
    You are wonderful! Thanks!

  8. Hey! I’m at work surfing around your blog from my new apple
    iphone! Just wanted to say I love reading through your blog and look forward to all your posts!
    Keep up the outstanding work!

  9. Hello There. I found your weblog using msn. This is a really well written article.
    I’ll make sure to bookmark it and return to learn more of your useful info.
    Thank you for the post. I’ll definitely return.

  10. Excellent post. I was checking constantly this blog and I am impressed!

    Very useful information specifically the last part 🙂 I care
    for such info much. I was seeking this particular information for a
    long time. Thank you and good luck.

  11. Hi my loved one! I want to say that this post is awesome, nice written and include
    approximately all significant infos. I would like to see extra posts like this .

  12. hi!,I really like your writing very a lot! proportion we keep up a correspondence extra approximately your post on AOL?

    I need a specialist on this house to resolve my problem.
    May be that’s you! Taking a look ahead to peer you.

  13. Hello there, I found your web site via Google while
    looking for a comparable topic, your website got here up, it appears to be
    like good. I’ve bookmarked it in my google bookmarks.

    Hi there, simply was alert to your weblog through Google, and found that it is truly
    informative. I am gonna be careful for brussels. I’ll
    be grateful for those who continue this {in future}.
    Lots of people will probably be benefited out of your writing.
    Cheers!

  14. I simply couldn’t leave your site before suggesting that I
    actually loved the usual information an individual provide for your visitors?
    Is going to be again regularly to investigate
    cross-check new posts

  15. Nice weblog right here! Additionally your website quite
    a bit up very fast! What web host are you the usage of?
    Can I am getting your associate hyperlink for your host?
    I want my web site loaded up as fast as yours lol

  16. Every weekend i used to go to see this web page, because i wish for enjoyment, for the reason that this this web
    page conations actually pleasant funny data too.

  17. First off I want to say great blog! I had a quick
    question which I’d like to ask if you don’t mind. I was interested
    to find out how you center yourself and clear your mind before writing.
    I’ve had trouble clearing my mind in getting my thoughts out.
    I truly do take pleasure in writing however
    it just seems like the first 10 to 15 minutes tend to be lost just trying to figure out how to begin. Any recommendations or
    tips? Many thanks!

  18. Simply want to say your article is as astounding. The clearness in your post is just cool and i could assume you
    are an expert on this subject. Well with your permission allow me to
    grab your RSS feed to keep up to date with forthcoming post.
    Thanks a million and please carry on the enjoyable work.

  19. You are so awesome! I don’t think I have read a single thing like that before.
    So great to discover someone with a few original thoughts on this issue.
    Seriously.. thank you for starting this up.
    This web site is something that’s needed on the internet,
    someone with some originality!

  20. I don’t know whether it’s just me or if perhaps everyone else encountering issues with
    your blog. It looks like some of the written text
    within your content are running off the screen. Can someone else please comment and let me know if this is happening to them too?
    This could be a problem with my browser because I’ve had this happen before.
    Many thanks

  21. 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 a variety of websites for about a year and am concerned about switching to another platform.
    I have heard excellent things about blogengine.net.
    Is there a way I can transfer all my wordpress content into it?
    Any help would be greatly appreciated!

  22. I seriously love your blog.. Very nice colors & theme.
    Did you build this web site yourself? Please reply back as
    I’m trying to create my own website and want to learn where you got this
    from or what the theme is called. Appreciate it!

  23. Currently it sounds like BlogEngine is the best blogging
    platform available right now. (from what I’ve read) Is that what you are using on your blog?

  24. This is the right webpage for anybody who really wants to understand this topic.
    You realize a whole lot its almost tough to argue with you (not
    that I actually would want to…HaHa). You certainly put a fresh spin on a topic which
    has been discussed for years. Great stuff, just great!

  25. Thank you a lot for sharing this with all of us you really recognize what you are
    speaking approximately! Bookmarked. Kindly additionally discuss
    with my site =). We can have a hyperlink change agreement among us

  26. An outstanding share! I’ve just forwarded this onto a friend who
    had been conducting a little research on this. And he in fact bought me lunch due to the fact that I
    found it for him… lol. So let me reword this….
    Thank YOU for the meal!! But yeah, thanks
    for spending time to discuss this issue here on your site.

  27. Hey! This post could not be written any better! Reading through this post reminds me of my previous room
    mate! He always kept chatting about this. I will forward this page to him.
    Fairly certain he will have a good read. Many thanks for
    sharing!

  28. 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 site when you could be giving us something informative to read?

  29. I believe what you said made a ton of sense. However, consider this, what if you typed a
    catchier title? I mean, I don’t wish to tell you how to run your website, however
    what if you added something that makes people want more? I
    mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku – Umar faisol is kinda boring.
    You should glance at Yahoo’s front page and watch how they create
    article headlines to get people interested. You might add a video or a picture or two to get readers interested about what you’ve written. Just my opinion, it would bring your posts a little bit more interesting.

Comments are closed.