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. Magnificent website. Lots of helpful information here.
    I’m sending it to several pals ans additionally sharing in delicious.
    And of course, thank you for your sweat!

  2. Have you ever thought about adding a little bit more than just your articles?
    I mean, what you say is important and everything.
    But think about if you added some great photos or videos to give your posts more, “pop”!
    Your content is excellent but with images and videos, this site could certainly be one of the
    most beneficial in its niche. Very good blog!

  3. I believe what you posted was actually very reasonable. But,
    what about this? suppose you added a little content? I mean, I don’t wish to tell you how
    to run your website, however suppose you added something that grabbed
    folk’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku – Umar faisol is kinda boring.
    You should glance at Yahoo’s home page and note how
    they create news headlines to get people to open the links.

    You might add a video or a pic or two to get readers excited about
    what you’ve got to say. In my opinion, it could
    bring your posts a little bit more interesting.

  4. Wow, fantastic blog layout! How lengthy have you been blogging for?
    you make running a blog look easy. The total look of
    your web site is great, let alone the content!

  5. Hello There. I found your blog using msn. This is a really well written article.
    I’ll be sure to bookmark it and come back to read more of your useful info.
    Thanks for the post. I will definitely comeback.

  6. Hmm it appears like your website ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new to the
    whole thing. Do you have any tips for novice blog writers?
    I’d certainly appreciate it.

  7. wonderful issues altogether, you just received a emblem new reader.
    What may you recommend in regards to your put up that you just made some days ago?
    Any positive?

  8. You are so interesting! I do not believe I’ve truly read through something like that before.

    So wonderful to find another person with original thoughts on this issue.
    Seriously.. thanks for starting this up. This site is something that’s needed on the web,
    someone with some originality!

  9. You actually make it seem really easy with your presentation however I in finding this topic to be really something which I believe I might by no means understand.
    It kind of feels too complicated and extremely large for me.
    I am having a look ahead to your next publish, I will try to get
    the grasp of it!

  10. Hey just wanted to give you a quick heads up. The words in your article seem to be
    running off the screen in Firefox. I’m not sure
    if this is a format issue or something to do with internet browser compatibility but I figured I’d post to
    let you know. The layout look great though!
    Hope you get the problem solved soon. Cheers

  11. Hi there just wanted to give you a quick heads
    up. The words in your post seem to be running off the screen in Opera.
    I’m not sure if this is a format issue or something to do with web browser compatibility but I thought I’d post to
    let you know. The design look great though! Hope you get the problem fixed soon. Many thanks

  12. An impressive share! I have just forwarded this onto a colleague
    who was doing a little homework on this. And he actually ordered me lunch because I stumbled upon it for him…

    lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanks for spending time
    to talk about this subject here on your website.

  13. Thank you for the auspicious writeup. It in fact was a amusement account it.
    Look advanced to far added agreeable from you! By the way, how can we
    communicate?

  14. I’ve been exploring for a little bit for any
    high quality articles or blog posts in this
    kind of house . Exploring in Yahoo I ultimately stumbled upon this web site.
    Reading this info So i am satisfied to convey that I’ve a very just right
    uncanny feeling I discovered exactly what I needed.
    I most indisputably will make sure to don?t disregard
    this web site and provides it a look on a
    continuing basis.

  15. I love what you guys are usually up too. This kind of clever work and coverage!
    Keep up the fantastic works guys I’ve included
    you guys to my blogroll.

  16. excellent submit, very informative. I’m wondering why
    the other specialists of this sector don’t understand this.

    You should proceed your writing. I’m confident, you’ve
    a great readers’ base already!

  17. This design is spectacular! You definitely know
    how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!)
    Fantastic job. I really loved what you had to
    say, and more than that, how you presented it.
    Too cool!

  18. Hey there outstanding blog! Does running a blog like this require a large amount
    of work? I have no knowledge of computer programming but I had been hoping
    to start my own blog in the near future. Anyway, if you have any recommendations or techniques for new blog owners please share.
    I understand this is off topic but I just had to ask.
    Thanks a lot!

  19. Nice post. I was checking continuously this blog and I am inspired!

    Very useful information specifically the final phase 🙂 I handle
    such info much. I was looking for this particular information for a very long time.

    Thanks and good luck.

  20. This is really interesting, You’re a very skilled blogger.

    I have joined your rss feed and look forward to seeking more of your excellent post.
    Also, I have shared your web site in my social networks!

  21. Wow, wonderful blog format! How long have you been blogging for?
    you made running a blog look easy. The overall glance of your web site is fantastic,
    let alone the content material!

  22. We are a group of volunteers and starting a new scheme in our community.
    Your site offered us with valuable info to work on. You have
    done a formidable job and our whole community will be
    thankful to you.

  23. Excellent site you have here but I was curious
    about if you knew of any forums that cover the same topics talked about here?
    I’d really like to be a part of group where I can get advice from
    other experienced people that share the same interest.
    If you have any recommendations, please let me know.

    Bless you!

Comments are closed.