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

  1. I’m really enjoying the theme/design of your web site.
    Do you ever run into any internet browser compatibility issues?
    A handful of my blog audience have complained about my website not operating correctly in Explorer
    but looks great in Firefox. Do you have any recommendations to help fix this problem?

  2. It’s really a great and useful piece of information. I am satisfied that you shared this useful information with us.
    Please keep us informed like this. Thanks for sharing.

  3. Just desire to say your article is as astounding.
    The clarity for your put up is just excellent and
    i could think you are an expert in this subject. Fine along with your permission let me
    to grab your RSS feed to stay updated with approaching post.

    Thank you 1,000,000 and please continue the enjoyable work.

  4. Fantastic goods from you, man. I have understand your stuff previous to and you’re just too great.

    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
    sensible. I can’t wait to read far more from you.
    This is really a great web site.

  5. Hello, I do think your web site may be having browser compatibility problems.
    When I look at your site in Safari, it looks fine however, when opening in IE, it’s got some overlapping issues.
    I simply wanted to provide you with a quick heads
    up! Other than that, wonderful blog!

  6. I like the valuable info you provide in your articles. I’ll
    bookmark your blog and take a look at once more here regularly.
    I’m rather sure I’ll be told many new stuff proper right here!
    Best of luck for the following!

  7. Having read this I believed it was rather enlightening.

    I appreciate you spending some time and effort to put this information together.
    I once again find myself personally spending way too much time both reading and leaving comments.
    But so what, it was still worth it!

  8. Thank you for any other magnificent post. Where else could
    anyone get that kind of info in such an ideal manner of writing?
    I’ve a presentation next week, and I’m on the search for such info.

  9. Hi my friend! I want to say that this article is awesome, nice written and come with approximately all significant infos.
    I would like to peer extra posts like this .

  10. Aw, this was a really nice post. Taking the time and actual effort
    to make a top notch article… but what can I say… I hesitate a whole lot
    and don’t seem to get anything done.

  11. With havin so much content and articles do you ever run into any issues of plagorism or copyright
    violation? My site has a lot of completely unique content I’ve either authored myself
    or outsourced but it looks like a lot of it is popping it up all
    over the internet without my permission. Do you know any ways to help reduce
    content from being ripped off? I’d really appreciate it.

  12. This is really interesting, You’re a very skilled blogger.
    I’ve joined your feed and look forward to seeking more
    of your wonderful post. Also, I have shared your website in my social networks!

  13. It is appropriate time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I desire to suggest
    you some interesting things or suggestions. Maybe you can write next articles referring to this article.
    I want to read more things about it!

  14. Hi there just wanted to give you a brief heads up and let you know a few of the images aren’t loading properly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers
    and both show the same outcome.

  15. Wow that was unusual. I just wrote an very long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say wonderful blog!

  16. Thanks for ones marvelous posting! I actually enjoyed reading it, you may be a great author.I
    will ensure that I bookmark your blog and definitely will come back at some point.

    I want to encourage you to definitely continue your great
    writing, have a nice afternoon!

  17. Hello! I know this is kinda off topic however I’d figured I’d ask.
    Would you be interested in trading links or maybe guest writing a blog article or vice-versa?
    My blog discusses a lot of the same topics as yours
    and I feel we could greatly benefit from each other.
    If you’re interested feel free to send me an email.
    I look forward to hearing from you! Wonderful blog by the way!

  18. exhilarating review. At the same time visit my site to be aware of situs slot online.

    Fantastic site has received recognition coming from judi
    slot online gambling men and women in Indonesia. At this time there are actually plenty
    of lovely promos if people join currently.

  19. I blog often and I seriously thank you for your content.
    This great article has truly peaked my interest. I’m going to
    book mark your blog and keep checking for new details about once per week.
    I opted in for your RSS feed as well.

  20. Hmm is anyone else encountering problems with the pictures on this blog loading?

    I’m trying to determine if its a problem on my end or if it’s the blog.
    Any responses would be greatly appreciated.

  21. First off I would like to say fantastic blog! I had a quick question which I’d like to ask if you do not mind.

    I was curious to find out how you center yourself and clear
    your mind before writing. I have had a difficult time clearing my mind
    in getting my ideas out there. I truly do take pleasure in writing but it just seems like the
    first 10 to 15 minutes are wasted simply just trying to figure
    out how to begin. Any suggestions or tips? Kudos!

  22. Hi there! 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 wonderful job!

  23. I have been surfing online more than 4 hours today, yet I never found any interesting
    article like yours. It is pretty worth enough for me. Personally, if all web owners and bloggers made good content as you did, the
    internet will be much more useful than ever before.

  24. Hey there I am so happy I found your weblog, I really found you
    by mistake, while I was searching on Digg for
    something else, Nonetheless I am here now and
    would just like to say thank you for a tremendous 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 moment but I have
    bookmarked it and also added your RSS feeds, so when I have time I
    will be back to read much more, Please do keep up the
    superb work.

  25. Hi, i feel that i noticed you visited my website thus i came to return the choose?.I’m attempting to find things to improve my website!I assume its good enough to use some of your concepts!!

  26. Hello, i think that i saw you visited my blog thus i
    came to “return the favor”.I am attempting
    to find things to improve my website!I suppose its ok to use
    a few of your ideas!!

  27. Hey there just wanted to give you a quick heads up and let you know a few of the pictures 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 results.

Comments are closed.