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,273 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. I blog quite often and I truly appreciate your information. The article
    has truly peaked my interest. I will bookmark your blog and keep checking
    for new details about once per week. I opted in for your
    Feed as well.

  2. Have you ever considered about adding a little bit more than just
    your articles? I mean, what you say is valuable and
    everything. However imagine if you added some great graphics or videos to give your posts more, “pop”!
    Your content is excellent but with images and videos, this blog could definitely be one
    of the very best in its niche. Fantastic blog!

  3. I savor, result in I found just what I used to be taking a look for.
    You’ve ended my four day long hunt! God Bless you
    man. Have a great day. Bye

  4. With havin so much written content do you ever run into any issues of plagorism or copyright violation? My blog has a
    lot of exclusive content I’ve either authored myself or outsourced but it looks
    like a lot of it is popping it up all over the web without my permission. Do you know any ways to help prevent content from being ripped off?
    I’d really appreciate it.

  5. I’m amazed, I must say. Rarely do I encounter a blog that’s equally educative and entertaining, and without a doubt, you’ve hit the nail on the head.
    The problem is something which too few people are speaking intelligently about.
    I am very happy that I stumbled across this in my search for something concerning
    this.

  6. Great post. I was checking continuously this blog and I’m impressed!
    Very helpful information particularly the closing phase 🙂 I handle such info a lot.
    I used to be seeking this certain information for a very lengthy time.
    Thanks and good luck.

  7. Outstanding post but I was wondering if you could write a litte more on this subject?
    I’d be very thankful if you could elaborate a little bit more.
    Kudos!

  8. Heya i’m for the primary time here. I came across this board and I in finding It truly helpful & it helped me out a lot.
    I’m hoping to present something again and aid others like you helped me.

  9. I don’t even understand how I ended up here, however I believed this submit used
    to be great. I don’t recognize who you might be but definitely you’re going to a
    well-known blogger if you happen to aren’t already. Cheers!

  10. Nice blog here! Additionally your site lots up very fast!
    What host are you the usage of? Can I get your associate hyperlink in your host?
    I want my website loaded up as quickly as yours lol

  11. Hey I know this is off topic but I was wondering if you
    knew of any widgets I could add to my blog that automatically tweet
    my newest twitter updates. I’ve been looking for a plug-in like this
    for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward
    to your new updates.

  12. you are in point of fact a just right webmaster. The site loading speed is incredible.
    It sort of feels that you’re doing any distinctive trick.
    In addition, The contents are masterwork. you’ve performed a
    excellent job in this matter!

  13. Superb blog! Do you have any hints for aspiring writers? I’m
    planning to start my own site soon but I’m a little lost on everything.
    Would you suggest starting with a free platform like
    Wordpress or go for a paid option? There are so many choices out there that
    I’m completely overwhelmed .. Any suggestions?
    Kudos!

  14. Hmm it appears like your blog ate my first comment (it
    was extremely long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog writer but I’m still new to everything.

    Do you have any tips and hints for novice blog writers?
    I’d definitely appreciate it.

  15. Great beat ! I would like to apprentice while you amend your web site, how could i subscribe for a blog website?
    The account aided me a acceptable deal. I were tiny bit acquainted of this your broadcast offered
    vivid transparent idea

  16. I’m really enjoying the design and layout of your website.

    It’s a very easy on the eyes which makes it much more
    enjoyable for me to come here and visit more often. Did you
    hire out a designer to create your theme?
    Fantastic work!

  17. Woah! I’m really enjoying the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s tough
    to get that “perfect balance” between superb usability and
    visual appearance. I must say you’ve done a amazing job with
    this. In addition, the blog loads super quick
    for me on Internet explorer. Excellent Blog!

  18. I’m not sure еxactly ԝhy but thiѕ website іs loading extremely slow for me.

    Is anyߋne else hɑving this issue oor is it а issue on my end?
    I’ll check ƅack later aand ѕee іf the ρroblem ѕtilⅼ exists.

    my web site :: roba gratis online

  19. I’m really enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more pleasant for me to come here and
    visit more often. Did you hire out a developer to create
    your theme? Fantastic work!

  20. I was wondering if you ever thought of changing the page layout of your website?

    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 images. Maybe you could space it out better?

  21. I am sure this paragraph has touched all the internet users, its
    really really nice piece of writing on building up new website.

  22. Appreciating the commitment you put into your site and in depth
    information you present. It’s good to come across a blog every once in a while that
    isn’t the same out of date rehashed information. Great read!
    I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  23. I’m impressed, I must say. Seldom do I come across a blog that’s equally educative and interesting, and without a doubt, you’ve hit
    the nail on the head. The issue is something not enough people are speaking intelligently about.
    Now i’m very happy that I found this in my hunt for something
    concerning this.

  24. Thanks for your personal marvelous posting! I seriously
    enjoyed reading it, you happen to be a great author.I will make sure to bookmark your blog and will
    come back from now on. I want to encourage you to definitely continue your
    great work, have a nice morning!

  25. First of all I would like to say terrific blog!
    I had a quick question that I’d like to ask if you do not mind.
    I was interested to know how you center yourself and clear your mind before writing.

    I have had difficulty clearing my thoughts in getting
    my thoughts out there. I truly do take pleasure in writing
    however it just seems like the first 10 to 15 minutes
    are usually wasted simply just trying to figure out how to begin. Any suggestions or tips?
    Kudos!

Comments are closed.