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 for … in.

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.

16,626 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku”

  1. I’ve been browsing online more than 2 hours today, yet I never found any interesting article like yours.
    It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as
    you did, the web will be much more useful than ever before.

  2. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several emails with the same comment.
    Is there any way you can remove me from that service?
    Bless you!

  3. I have been surfing on-line more than three hours these days, yet I by no means
    found any interesting article like yours.
    It is lovely price enough for me. In my opinion, if all site owners and bloggers made just right content material as you probably did, the internet shall be a lot more useful than ever before.

  4. Everything posted was actually very reasonable. However,
    what about this? suppose you added a little information? I ain’t saying your content isn’t good,
    but suppose you added a title that makes people want more?
    I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku – Umar faisol is a little plain. You might glance at
    Yahoo’s front page and see how they write post headlines to get
    viewers to click. You might add a related
    video or a related pic or two to get people excited about everything’ve written. Just my opinion, it would bring
    your blog a little livelier.

  5. My partner and I stumbled over here different
    web page and thought I should check things out.
    I like what I see so i am just following you. Look forward to checking
    out your web page repeatedly.

  6. What’s Taking place i am new to this, I stumbled upon this I’ve
    found It absolutely helpful and it has helped me out loads.
    I’m hoping to contribute & assist other customers like its helped me.
    Good job.

  7. Does your site have a contact page? I’m having problems locating it but, I’d like to send you an email.
    I’ve got some recommendations for your blog you might be interested in hearing.

    Either way, great blog and I look forward to seeing it expand over time.

  8. Hmm is anyone else experiencing problems with the pictures
    on this blog loading? I’m trying to find out if its a
    problem on my end or if it’s the blog. Any feed-back would be greatly
    appreciated.

  9. Preetty section of ϲontent. I juѕt stumbled upon your web site ɑnd in accession capital t᧐ assert tһat I get aϲtually enjoyed account
    ʏour blog posts. Anny ѡay I’ll be subscribing to
    your augment aand even I achievement уߋu access consistently fast.

    Feel free to surf to mmy web page: 読み続けてください

  10. It’s actually very difficult in this active life to listen news on TV,
    thus I simply use internet for that reason, and take the latest news.

  11. Currently it appears like WordPress is the best blogging platform out there
    right now. (from what I’ve read) Is that what you are using
    on your blog?

  12. Link exchange is nothing else except it is just placing the other person’s webpage
    link on your page at suitable place and other person will also do similar in favor of you.

  13. I do not even understand how I stopped up right here, but
    I believed this put up was good. I do not realize who you’re
    however certainly you are going to a famous blogger
    if you aren’t already. Cheers!

  14. After exploring a few of the blog articles on your web page, I honestly
    like your way of blogging. I added it to my bookmark
    webpage list and will be checking back soon. Please check out my web
    site too and tell me how you feel.

  15. Wow, fantastic weblog structure! How lengthy have you ever been running a blog for?

    you make blogging look easy. The entire glance of your web site
    is magnificent, let alone the content!

  16. Hey! I could have sworn I’ve been to this blog before but after reading through some of the post I realized it’s new to me.
    Anyways, I’m definitely glad I found it and I’ll be
    bookmarking and checking back often!

  17. I like what you guys are usually up too.
    This type of clever work and exposure! Keep up the superb works guys I’ve added you
    guys to our blogroll.

  18. What’s up, I want to subscribe for this blog
    to take most up-to-date updates, thus where can i do
    it please help out.

  19. In fact when someone doesn’t understand afterward its up
    to other people that they will assist, so here it takes place.

Comments are closed.