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.

17,247 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. I got this web page from my friend who informed
    me on the topic of this web page and at the moment this time I am visiting this web page and reading very informative articles or reviews at this place.

    my page :: 168.232.50.40

  2. What’s Going down i am new to this, I stumbled upon this I have found It absolutely helpful and
    it has helped me out loads. I hope to contribute & aid other customers like its helped me.
    Great job.

  3. Howdy! I’m at work surfing around your blog from my new iphone 3gs!

    Just wanted to say I love reading your blog and look forward to all your posts!
    Carry on the superb work!

  4. 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 can do with some pics to drive the message home a little bit, but instead of that, this is excellent
    blog. An excellent read. I will certainly be back.

  5. you’re actually a just right webmaster. The web site loading velocity is amazing.
    It kind of feels that you’re doing any distinctive trick.
    Furthermore, The contents are masterwork.

    you’ve performed a wonderful job on this subject!

  6. I’ve been surfing on-line greater than 3 hours these days,
    yet I never discovered any fascinating article like yours.
    It is pretty price sufficient for me. Personally, if all webmasters and bloggers made just right content as you probably did, the internet can be a lot more helpful
    than ever before.

  7. Link exchange is nothing else however it is only placing the other person’s
    webpage link on your page at proper place and other person will also do same in favor of
    you.

  8. I’ve been surfing on-line greater than three hours lately,
    yet I never found any attention-grabbing article like yours.
    It’s lovely price sufficient for me. In my view, if all web owners and bloggers made
    just right content as you did, the net might be a lot more helpful than ever before.

  9. I think everything typed made a ton of sense. But, what about this?
    what if you typed a catchier post title? I ain’t saying your
    information is not good., but what if you added something that makes people
    desire more? I mean Contoh Soal Pemrograman – Pola
    Segitiga Siku-siku – Umar faisol is a
    little boring. You ought to look at Yahoo’s home page and see how they create news titles to get people interested.

    You might add a related video or a related picture or two to grab people excited about
    what you’ve written. Just my opinion, it would bring your posts a little bit
    more interesting.

  10. You actually make it appear so easy with your presentation but I find
    this topic to be actually something that I believe I would by no means understand.

    It sort of feels too complicated and very wide for me.
    I am taking a look forward for your next put up, I
    will try to get the hang of it!

  11. It’s actually very complex in this full of activity life to listen news on Television, thus
    I just use internet for that reason, and get the most up-to-date information.

  12. My partner and I stumbled over here coming from a different web address and thought I might
    check things out. I like what I see so i am just following you.
    Look forward to going over your web page again.

  13. It’s a pity you don’t have a donate button!
    I’d most certainly donate to this outstanding blog!

    I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to new updates and will talk about this
    blog with my Facebook group. Chat soon!

  14. I loved as much as you will receive carried out right here.

    The sketch is attractive, your authored subject
    matter stylish. nonetheless, you command get bought an nervousness over that you wish
    be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly a lot often inside case you shield
    this hike.

  15. It’s truly very complex in this busy life to listen news on TV, thus I simply use web for
    that reason, and obtain the newest information.

  16. Does your blog have a contact page? I’m having problems locating it but, I’d like to
    send you an email. I’ve got some ideas for your blog you might be interested in hearing.
    Either way, great site and I look forward to seeing it expand over
    time.

  17. An intriguing discussion is definitely worth comment.
    I think that you need to publish more about this issue,
    it may not be a taboo subject but typically folks don’t
    talk about such topics. To the next! Kind regards!!

  18. I’m gone to say to my little brother, that he should also pay a
    visit this web site on regular basis to get updated from newest
    gossip.

  19. Ahaa, its fastidious discussion concerning this piece
    of writing here at this web site, I have read all that, so
    at this time me also commenting here.

Comments are closed.