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. Right here is the right web site for anybody who wants to understand this topic.
    You understand a whole lot its almost hard to argue with you (not that I personally will
    need to…HaHa). You certainly put a new spin on a subject that’s
    been discussed for many years. Wonderful stuff, just wonderful!

  2. Howdy! I’m at work surfing around your blog from my new iphone 4!
    Just wanted to say I love reading through your blog and look forward to
    all your posts! Keep up the superb work!

  3. It’s a shame you don’t have a donate button! I’d certainly donate to this outstanding blog!
    I suppose for now i’ll settle for bookmarking 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!

  4. What i don’t realize is if truth be told how you are not actually a lot more smartly-liked than you may be now.
    You’re very intelligent. You realize therefore significantly when it
    comes to this subject, produced me personally believe it from numerous various angles.
    Its like men and women aren’t interested until it is one thing to do with
    Woman gaga! Your individual stuffs nice. All the
    time maintain it up!

  5. I have been browsing online more than 4 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 web will be much more useful than ever before.

  6. An interesting discussion is worth comment.
    I believe that you need to publish more about this subject matter,
    it may not be a taboo subject but typically folks don’t discuss these issues.
    To the next! Best wishes!!

  7. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.

    You definitely know what youre talking about, why waste your intelligence
    on just posting videos to your weblog when you could be giving us something informative to read?

  8. Hello it’s me, I am also visiting this site daily, this web
    site is in fact fastidious and the people are actually sharing fastidious thoughts.

  9. Wow, incredible blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your web site is great, let alone
    the content!

  10. Magnificent beat ! I wish to apprentice even as you amend your web site, how could i subscribe for a weblog
    web site? The account helped me a acceptable deal.

    I had been a little bit familiar of this your broadcast offered vibrant transparent idea

  11. I think that everything said was actually very reasonable.
    However, consider this, what if you typed a catchier post title?

    I am not saying your information is not solid, however suppose you added something that grabbed a
    person’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga
    Siku-siku – Umar faisol is a little boring.
    You should look at Yahoo’s front page and see how they write news headlines to get people interested.
    You might add a video or a related pic or two to get people excited about what you’ve written. Just my
    opinion, it would bring your posts a little livelier.

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

  13. you’re truly a excellent webmaster. The web site loading pace is amazing.
    It seems that you’re doing any unique trick. In addition, The contents are masterwork.
    you have performed a magnificent task in this subject!

  14. Whoa! This blog looks exactly like my old one!
    It’s on a totally different topic but it has pretty
    much the same layout and design. Excellent choice of colors!

  15. Truly when someone doesn’t know afterward its up to other visitors that they will help, so here it
    occurs.

  16. I was curious if you ever thought of changing the page layout 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 2 pictures. Maybe you could space it out better?

  17. I’m not sure exactly why but this blog is loading very slow for me.
    Is anyone else having this issue or is it a problem on my end?
    I’ll check back later and see if the problem still exists.

  18. Valuable information. Fortunate me I discovered your site unintentionally, and I am stunned why this coincidence didn’t happened earlier!
    I bookmarked it.

Comments are closed.