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.

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

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

  2. I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored material stylish.

    nonetheless, you command get got an impatience over that you wish be delivering the
    following. unwell unquestionably come further formerly again since exactly
    the same nearly very often inside case you shield this increase.

  3. Hey are using WordPress for your blog platform? I’m new
    to the blog world but I’m trying to get started and set up my own. Do you require
    any html coding knowledge to make your own blog?
    Any help would be greatly appreciated!

  4. Greetings from California! I’m bored to death at work so I decided to browse your blog on my
    iphone during lunch break. I love the info you provide here and can’t wait to take a look when I get home.
    I’m shocked at how fast your blog loaded on my phone ..

    I’m not even using WIFI, just 3G .. Anyways, good blog!

  5. I believe this is among the so much vital info for me. And i am glad studying your article.

    But want to statement on few normal issues, The web site taste is great,
    the articles is actually excellent : D. Good process, cheers

  6. Hey would you mind letting me know which web host you’re utilizing?
    I’ve loaded your blog in 3 different internet browsers and I must say this blog loads a lot faster
    then most. Can you recommend a good web hosting provider
    at a honest price? Cheers, I appreciate it!

  7. continuously i used to read smaller articles that also clear
    their motive, and that is also happening with this post which I am
    reading at this place.

  8. Somebody essentially lend a hand to make significantly articles I might state.

    That is the very first time I frequented your web page and to this point?
    I amazed with the research you made to make this particular publish extraordinary.
    Great job!

  9. What you said made a ton of sense. But, think about this,
    what if you typed a catchier title? I ain’t saying your content
    is not solid., but suppose you added something to possibly grab folk’s attention? I mean Contoh Soal Pemrograman –
    Pola Segitiga Siku-siku – Umar faisol is kinda plain. You ought to look at
    Yahoo’s front page and watch how they create article titles to grab people interested.
    You might add a video or a picture or two to grab people interested about everything’ve got to say.

    In my opinion, it would make your blog a little livelier.

  10. For latest news you have to go to see the web and on web I found
    this site as a most excellent web page for latest updates.

  11. Howdy 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 web browsers and both show the same outcome.

  12. Hi there, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam responses?
    If so how do you protect against it, any plugin or anything you can advise?
    I get so much lately it’s driving me mad so any support is very much appreciated.

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

  14. whoah this weblog is great i like studying your articles.
    Stay up the great work! You already know, lots of individuals are hunting round for this
    info, you could help them greatly.

  15. Heya i’m for the first time here. I came across
    this board and I find It truly useful & it helped me out much.
    I hope to give something back and help others like
    you helped me.

  16. My partner and I stumbled over here different page and thought
    I should check things out. I like what I see so now i’m following you.

    Look forward to exploring your web page for a second time.

  17. I do not even know how I ended up here, but I thought this post
    was good. I do not know who you are but definitely you’re going to a famous blogger if you aren’t already 😉 Cheers!

  18. Nice blog here! Also your site loads up fast! What host are you using?
    Can I get your affiliate link to your host? I wish my web site loaded up as
    fast as yours lol

  19. No matter if some one searches for his vital thing, so he/she wishes to be available
    that in detail, thus that thing is maintained over here.

  20. Hello there! I could have sworn I’ve been to this blog before
    but after checking through some of the post I
    realized it’s new to me. Anyways, I’m definitely delighted I found it and I’ll be bookmarking
    and checking back frequently!

  21. I think everything posted made a lot of sense.
    But, consider this, what if you added a little content?
    I ain’t saying your content isn’t solid., but what if you added
    a title to possibly grab folk’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku – Umar faisol is a little plain. You could look
    at Yahoo’s front page and see how they create post headlines to grab people to open the links.
    You might add a related video or a related pic or two to grab people interested about what you’ve got to say.
    Just my opinion, it would bring your posts a little bit more interesting.

Comments are closed.