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 blog right here! Additionally your website loads up fast!
    What web host are you the usage of? Can I get your associate
    hyperlink for your host? I wish my website loaded up as fast as yours lol

  2. I believe that is among the so much important information for me.
    And i’m satisfied reading your article. However wanna observation on some general things, The site style is perfect, the articles is really excellent :
    D. Excellent job, cheers

  3. Unquestionably believe that which you said. Your favorite reason appeared to be on the internet the simplest thing to consider of.
    I say to you, I certainly get annoyed at the same time as people consider concerns that they just don’t know about.
    You managed to hit the nail upon the highest and also
    outlined out the entire thing with no need side effect ,
    people could take a signal. Will probably be again to get more.
    Thank you

  4. My family all the time say that I am killing my time here at web, except
    I know I am getting experience everyday by reading such pleasant articles or reviews.

  5. Hi there, i read your blog occasionally and i own a similar one and
    i was just wondering if you get a lot of spam responses?

    If so how do you stop it, any plugin or anything you can advise?

    I get so much lately it’s driving me crazy so any help is
    very much appreciated.

  6. I’m amazed, I have to admit. Seldom do I encounter a blog that’s both equally educative and engaging, and let
    me tell you, you have hit the nail on the head. The problem is
    something that not enough people are speaking intelligently about.
    I am very happy I stumbled across this during my hunt for
    something concerning this.

  7. Thanks for every other informative web site.
    The place else may I am getting that kind of information written in such a perfect means?
    I have a mission that I am just now operating on, and I’ve been at the look out for
    such info.

  8. After I initially left a comment I appear to have clicked the -Notify me when new comments are added- checkbox and from now on whenever
    a comment is added I recieve 4 emails with the same comment.
    There has to be a way you can remove me from that service?

    Cheers!

  9. Hey! This is kind of off topic but I need some advice from an established blog.

    Is it difficult 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 tips or suggestions?

    With thanks

  10. After checking out a few of the blog posts on your website, I really
    appreciate your way of blogging. I added it to my bookmark site list and will be checking back
    soon. Please visit my website too and tell me your opinion.

  11. Hmm it looks like your website 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 too am an aspiring blog blogger but I’m still new to everything.

    Do you have any points for first-time blog writers?
    I’d definitely appreciate it.

  12. Hi there, just became aware of your blog through Google, and found that it’s truly
    informative. I am going to watch out for brussels. I will appreciate if
    you continue this {in future}. A lot of people will be benefited from your writing.
    Cheers!

  13. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of
    the costs. But he’s tryiong none the less.
    I’ve been using Movable-type on a variety
    of websites for about a year and am worried about switching
    to another platform. I have heard very good things about blogengine.net.
    Is there a way I can transfer all my wordpress posts into it?
    Any kind of help would be really appreciated!

  14. Asking questions are genuinely good thing if you are not understanding something completely, however this post gives good
    understanding even.

  15. Wow, marvelous blog layout! How long have you
    been blogging for? you make blogging look easy. The overall look of your site is great, let
    alone the content!

  16. Hi! This is my first visit to your blog! We are a collection of volunteers and starting a
    new project in a community in the same niche. Your
    blog provided us beneficial information to
    work on. You have done a wonderful job!

  17. Fascinating blog! Is your theme custom made or
    did you download it from somewhere? A theme like yours with a few simple adjustements would really make my blog jump out.
    Please let me know where you got your design. Bless you

  18. I really like your blog.. very nice colors & theme.
    Did you design this website yourself or did you hire someone
    to do it for you? Plz respond as I’m looking to construct my own blog and would like
    to know where u got this from. cheers

  19. hello!,I love your writing very a lot! percentage
    we keep in touch extra about your article on AOL?
    I require a specialist in this area to solve my
    problem. Maybe that’s you! Having a look ahead to
    see you.

  20. Howdy! I know this is kind of off topic but I was wondering if you knew where I could get
    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. Unquestionably believe that which you said. Your favorite reason seemed to be on the internet the simplest thing to be aware of.
    I say to you, I certainly get annoyed while people consider worries that they plainly do not know about.
    You managed to hit the nail upon the top and defined out the whole
    thing without having side-effects , people could take a signal.
    Will likely be back to get more. Thanks

  22. With havin so much content and articles do you ever run into any problems
    of plagorism or copyright violation? My blog has
    a lot of completely unique content I’ve either created myself
    or outsourced but it appears a lot of it is popping it up all over the
    web without my permission. Do you know any techniques to help protect against content from being ripped off?
    I’d definitely appreciate it.

  23. This is the perfect site for everyone who wishes to understand this topic.
    You understand so much its almost hard to argue
    with you (not that I really would want to…HaHa).

    You definitely put a fresh spin on a subject which has been discussed for decades.
    Excellent stuff, just excellent!

  24. Great web site you have got here.. It’s difficult to
    find high-quality writing like yours these days. I really appreciate people like you!
    Take care!!

Comments are closed.