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. My partner and I stumbled over here different website and thought I may as well check things out.
    I like what I see so i am just following you. Look forward to
    looking into your web page repeatedly.

  2. I have been browsing online more than three hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my view, if all web owners and bloggers made good content
    as you did, the net will be much more useful than ever before.

  3. Hi there! This post could not be written any better!
    Reading this post reminds me of my old room mate! He always kept chatting about this.

    I will forward this write-up to him. Pretty sure he will have
    a good read. Many thanks for sharing!

  4. Today, while I was at work, my sister stole my iPad and tested to see if
    it can survive a 40 foot drop, just so she can be a youtube sensation. My iPad is now
    broken and she has 83 views. I know this is totally off topic but I had to share it with someone!

  5. Do you have a spam problem on this blog; I also am a blogger,
    and I was curious about your situation; many of us have developed some nice practices and we
    are looking to swap methods with others, be sure to shoot me an email if
    interested.

  6. Hello, i think that i saw you visited my weblog
    so i came to “return the favor”.I am attempting to find
    things to improve my web site!I suppose its ok to use a few of your ideas!!

  7. When someone writes an article he/she maintains the thought of a
    user in his/her mind that how a user can be aware of it.

    Thus that’s why this piece of writing is amazing. Thanks!

  8. Hi there! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest
    writing a blog article or vice-versa? My blog
    addresses a lot of the same topics as yours and I feel we could greatly benefit from
    each other. If you might be interested feel free to shoot me an email.
    I look forward to hearing from you! Terrific blog by the way!

  9. What’s up everyone, it’s my first visit at this web page, and
    paragraph is in fact fruitful in favor of me,
    keep up posting such articles.

  10. Good day! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through
    your articles. Can you suggest any other blogs/websites/forums that cover
    the same topics? Appreciate it!

  11. Link exchange is nothing else however it is just placing the other person’s weblog link on your page at appropriate place and other
    person will also do similar in support of you.

  12. Hey there! This is my first comment here so I just wanted to give a
    quick shout out and tell you I really enjoy reading
    through your articles. Can you recommend any other blogs/websites/forums
    that go over the same subjects? Appreciate it!

  13. Having read this I believed it was extremely informative. I appreciate you taking the time and energy to put this content together.
    I once again find myself spending way too much time both reading and leaving
    comments. But so what, it was still worthwhile!

  14. Oxford Online Pharmacy intends to use technology in the best way, in order to improve the health and wellbeing of the patients. Our health professionals will evaluate your condition with a series of questions and they will approve a suitable prescription for you. Even more, you can benefit from quick access to a pharmacist and GP via phone, e -mail or live chat; images can also be uploaded with your request.
    But the internet also has some bad apples, with websites that attempt to skirt regulations or scam consumers. This is true for online pharmacies, just as it is for every industry.
    https://csdmm.daupm.es/2022/02/06/ideas-for-safely-buying-drugs-on-line/
    buy lamisil 250 mg online
    can i order plan b online

  15. Hello, I think your site might be having browser compatibility
    issues. When I look at your blog in Safari, it looks fine
    but when opening in Internet Explorer, it has some overlapping.

    I just wanted to give you a quick heads up!
    Other then that, excellent blog!

  16. Excellent site you have here but I was wanting to know if you knew of
    any message boards that cover the same topics talked about here?
    I’d really love to be a part of group where I can get opinions
    from other knowledgeable individuals that share the same interest.
    If you have any suggestions, please let me know.
    Thanks!

  17. Its like you read my mind! You seem to know a lot about this, like
    you wrote the book in it or something. I think that you could do with a few
    pics to drive the message home a bit, but instead of that, this is
    magnificent blog. An excellent read. I will certainly be
    back.

  18. This is the right web site for anybody who hopes to understand this topic.
    You know a whole lot its almost hard to argue with you (not that I
    personally will need to…HaHa). You definitely put
    a fresh spin on a topic which has been discussed for decades.
    Great stuff, just wonderful!

  19. Hey! Do you know if they make any plugins to assist with Search
    Engine Optimization? I’m trying to get my blog to rank
    for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Thanks!

  20. I used to be recommended this blog through my cousin. I am
    now not certain whether or not this submit is written by him as no one else recognize such distinctive about my problem.
    You’re amazing! Thanks!

  21. Hello, its nice piece of writing on the topic of media print, we all
    be familiar with media is a fantastic source of facts.

Comments are closed.