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

  1. Its like you read my mind! You seem to know so much about this,
    like you wrote the book in it or something. I think that you could do with some pics to drive the message
    home a little bit, but instead of that, this is magnificent blog.
    A great read. I will definitely be back.

  2. Fantastic goods from you, man. I have understand your stuff
    previous to and you are just extremely wonderful. I actually
    like what you have acquired here, really like what you’re stating and the way in which you say it.
    You make it enjoyable and you still take care of to keep it wise.
    I cant wait to read far more from you. This is actually a great website.

  3. I’m amazed, I have to admit. Seldom do I come across a blog that’s both educative and engaging, and without a
    doubt, you’ve hit the nail on the head. The issue is something too few folks are speaking intelligently about.
    I am very happy that I found this during my search for something regarding this.

  4. Hi! This is my first comment here so I just
    wanted to give a quick shout out and tell you I genuinely
    enjoy reading your articles. Can you recommend any other
    blogs/websites/forums that deal with the same subjects? Thank you so much!

  5. wonderful issues altogether, you simply gained a brand new reader.
    What may you recommend in regards to your publish that you just made
    some days in the past? Any positive?

  6. I blog often and I seriously appreciate your information.
    This great article has really peaked my interest.
    I will book mark your site and keep checking for
    new details about once a week. I opted in for your Feed too.

  7. This design is wicked! You certainly 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!

  8. Good day! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Thank you!

  9. What’s Going down i am new to this, I stumbled upon this I have
    discovered It positively helpful and it has helped
    me out loads. I’m hoping to contribute & aid other customers like its helped me.
    Great job.

  10. Hi there, You have done an excellent job.
    I will certainly digg it and personally suggest to
    my friends. I’m confident they’ll be benefited from
    this web site.

  11. What’s up, yeah this paragraph is in fact good and I have learned lot of things from it on the topic of blogging.
    thanks.

  12. I was more than happy to uncover this website. I wanted to thank
    you for your time for this fantastic read!! I definitely liked
    every little bit of it and i also have you book-marked
    to see new things in your blog.

  13. Can I just say what a comfort to uncover an individual who actually
    understands what they are discussing online. You actually realize how to bring a
    problem to light and make it important. More and more people ought to check this out and understand this side of your story.
    I can’t believe you are not more popular since you surely possess the gift.

    Also visit my homepage: cannabis doctors

  14. My brother recommended I would possibly like this website.

    He was once entirely right. This put up actually made my day.

    You can not imagine simply how much time I had spent for this info!
    Thank you!

  15. I am curious to find out what blog platform you’re
    utilizing? I’m experiencing some minor security problems with my latest site and I would like to find something more risk-free.
    Do you have any solutions?

  16. Simply desire to say your article is as astounding. The clearness in your publish is simply great and i could assume you’re an expert in this subject.
    Well along with your permission allow me to grasp your RSS feed to keep
    updated with imminent post. Thank you a million and please
    carry on the enjoyable work.

    Visit my web-site … acne treatment

  17. Have you ever considered writing an e-book
    or guest authoring on other blogs? I have a blog based upon on the same subjects you discuss and would love to have you share some stories/information. I know my subscribers would enjoy your work.
    If you are even remotely interested, feel free to shoot me an email.

  18. Hi, i believe that i saw you visited my web site thus i came to return the desire?.I am
    trying to find things to improve my web site!I assume its ok to use a few of your ideas!!

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

  20. Heya i’m for the first time here. I found this board and I find It truly useful & it helped
    me out a lot. I hope to give something back and help others like you helped me.

  21. Hey! I just wanted to ask if you ever have any
    trouble with hackers? My last blog (wordpress) was hacked
    and I ended up losing months of hard work due to no data backup.
    Do you have any solutions to prevent hackers?

  22. Hi! This post couldn’t be written any better! Reading through this
    post reminds me of my previous room mate! He always kept talking about this.
    I will forward this post to him. Fairly certain he will have
    a good read. Thank you for sharing!

  23. I keep listening to the rumor speak about receiving free online grant applications so I
    have been looking around for the most excellent site to get one.
    Could you advise me please, where could i get some?

    Feel free to visit my web-site: weight loss pills

  24. Hi there excellent website! Does running a blog such as this require
    a massive amount work? I’ve very little expertise in programming but I was hoping to start my
    own blog soon. Anyhow, should you have any recommendations
    or tips for new blog owners please share. I know this is
    off topic however I just had to ask. Cheers!

  25. Do you mind if I quote a few of your articles as long as I provide
    credit and sources back to your blog? My blog is
    in the exact same area of interest as yours and my users would really benefit from a lot of the information you present here.
    Please let me know if this ok with you. Thanks a lot!

  26. Excellent pieces. Keep posting such kind of info on your site.
    Im really impressed by your blog.
    Hey there, You’ve done an excellent job. I’ll definitely digg it and for my part recommend to my friends.
    I am confident they’ll be benefited from this website.

  27. Howdy, I do think your blog may be having browser
    compatibility problems. When I look at your blog in Safari, it looks fine but when opening in I.E.,
    it has some overlapping issues. I just wanted to give you a quick heads up!
    Aside from that, great site!

  28. Hmm it looks like your blog ate my first comment (it was extremely long) so I guess
    I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new to the
    whole thing. Do you have any tips and hints for first-time blog writers?
    I’d genuinely appreciate it.

  29. Useful information. Fortunate me I discovered your
    website unintentionally, and I am shocked why this twist of
    fate did not happened earlier! I bookmarked it.

Comments are closed.