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. Simply wish to say your article is as surprising. The clearness in your post is just great and that i can assume you’re knowledgeable in this subject.
    Well together with your permission allow me to clutch your
    RSS feed to keep updated with drawing close post. Thank you one million and please carry on the rewarding work.

  2. Wow, wonderful weblog layout! How long have you ever been blogging for?

    you make running a blog look easy. The overall look of your website is great,
    as well as the content material!

  3. I was curious if you ever thought of changing the
    structure of your site? 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 one
    or two pictures. Maybe you could space it out better?

  4. Howdy this is kind of of off topic but I was wondering if blogs use
    WYSIWYG editors or if you have to manually code with HTML.
    I’m starting a blog soon but have no coding
    skills so I wanted to get advice from someone with experience.

    Any help would be greatly appreciated!

  5. It’s the best 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 few interesting things or suggestions.
    Perhaps you could write next articles referring to this article.
    I want to read more things about it!

  6. Good day! This is kind of off topic but I need some advice from an established blog.

    Is it hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast.
    I’m thinking about setting up my own but I’m not sure where
    to start. Do you have any tips or suggestions?
    Cheers

  7. I’m gone to tell my little brother, that he should also pay a quick
    visit this webpage on regular basis to obtain updated from hottest information.

  8. It’s actually a great and helpful piece of info. I am
    glad that you simply shared this helpful info with us. Please
    stay us informed like this. Thanks for sharing.

  9. Good site you’ve got here.. It’s difficult to find good quality writing like yours nowadays.

    I truly appreciate individuals like you! Take care!!

  10. Hi there! This is kind of off topic but I need some
    help from an established blog. Is it very difficult to set up
    your own blog? I’m not very techincal but I can figure things out pretty
    fast. I’m thinking about setting up my own but I’m not sure where to begin. Do you
    have any points or suggestions? Appreciate it

  11. Hey I know this is off topic but I was wondering if you knew of any widgets I could add
    to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would
    have some experience with something like this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  12. Hi there! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no data backup.
    Do you have any solutions to protect against hackers?

  13. I’m really enjoying the theme/design of your site. Do you ever run into any web browser compatibility issues?
    A few of my blog audience have complained about my site not
    working correctly in Explorer but looks great in Firefox.
    Do you have any solutions to help fix this issue?

  14. Hi! I could have sworn I’ve been to this site
    before but after reading through some of the post I realized it’s new to me.
    Nonetheless, I’m definitely happy I found it and I’ll be bookmarking and
    checking back often!

  15. I do accept as true with all of the ideas you’ve introduced for
    your post. They’re really convincing and will definitely work.

    Nonetheless, the posts are very quick for novices. Could you please extend
    them a bit from next time? Thank you for the post.

  16. It is perfect time to make a few plans for the long run and it is time to be happy.
    I have learn this put up and if I may I want to counsel you few fascinating things or tips.
    Perhaps you could write next articles regarding this article.
    I wish to read even more things about it!

  17. Pretty section of content. I just stumbled upon your site
    and in accession capital to assert that I get actually enjoyed account your blog posts.
    Anyway I’ll be subscribing to your feeds and even I achievement you access consistently rapidly.

  18. If some one needs to be updated with hottest technologies therefore he must be pay a visit this site and be up to date daily.

  19. Howdy, There’s no doubt that your site could be having internet browser compatibility issues.
    Whenever I take a look at your site in Safari, it looks fine however, when opening
    in I.E., it has some overlapping issues. I simply
    wanted to provide you with a quick heads up! Other than that, excellent website!

  20. Good day! I know this is kind of off topic but I
    was wondering which blog platform are you using for this website?
    I’m getting sick and tired of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform.
    I would be great if you could point me in the direction of a good platform.

  21. Fantastic goods from you, man. I have understand your stuff previous
    to and you’re just too great. I really like what you’ve acquired here, certainly like
    what you’re stating and the way in which you say it. You
    make it entertaining and you still care for
    to keep it wise. I can not wait to read much more from you.
    This is actually a great site.

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

  23. Hello There. I found your blog using msn. This is
    a very well written article. I will be sure to bookmark it and return to read more of your
    useful information. Thanks for the post. I’ll definitely return.

  24. I blog frequently and I genuinely appreciate your content.

    The article has truly peaked my interest. I will bookmark your blog and keep checking for new details about once a
    week. I subscribed to your Feed too.

  25. Hi! Would you mind if I share your blog with my twitter group?
    There’s a lot of folks that I think would really enjoy your content.
    Please let me know. Many thanks

  26. I have been browsing online more than 3 hours today, but I by no means found any attention-grabbing article
    like yours. It’s lovely price enough for me. Personally, if all site owners and bloggers
    made excellent content as you did, the internet might be a lot more helpful than ever before.

  27. Wonderful items from you, man. I have understand your stuff prior to and you’re simply extremely great.
    I really like what you have obtained here, certainly
    like what you’re stating and the best way wherein you assert it.
    You make it enjoyable and you still take care of to keep
    it sensible. I can not wait to learn much more from you.
    This is actually a wonderful web site.

  28. I believe that is one of the such a lot significant information for me.
    And i am satisfied studying your article. However wanna observation on few basic issues, The website taste is great, the articles is actually excellent
    : D. Excellent job, cheers

Comments are closed.