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. This design is incredible! You most certainly 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!) Great job.
    I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

  2. I’ve been exploring for a bit for any high-quality articles or blog posts in this sort of area .
    Exploring in Yahoo I eventually stumbled upon this site.
    Reading this information So i’m happy to exhibit that I have a very
    good uncanny feeling I came upon exactly what I needed.
    I most indisputably will make certain to don?t disregard this
    site and give it a glance regularly.

  3. I have been browsing on-line more than 3 hours nowadays, yet I by no means found
    any fascinating article like yours. It is lovely worth enough for
    me. In my opinion, if all webmasters and bloggers made just
    right content as you probably did, the net might be much more helpful than ever before.

  4. What i don’t understood is in fact how you are no longer actually much more well-preferred than you
    might be now. You are so intelligent. You understand therefore considerably on the subject of this
    matter, produced me individually believe it from so many varied angles.
    Its like men and women are not interested except it’s something to
    do with Woman gaga! Your personal stuffs outstanding.
    All the time care for it up!

  5. If some one wishes expert view regarding blogging and site-building afterward i advise him/her to
    pay a quick visit this webpage, Keep up the fastidious job.

  6. I do not know if it’s just me or if perhaps everyone else encountering issues with your site.

    It appears like some of the written text within your content are running off the screen.
    Can somebody else please provide feedback and let me
    know if this is happening to them as well? This might be a issue with my browser because I’ve had this happen previously.
    Many thanks

  7. I do trust all of the ideas you’ve introduced to your post.
    They’re very convincing and can certainly work. Still,
    the posts are very quick for starters. May you please lengthen them a
    bit from subsequent time? Thanks for the post.

  8. I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone
    to do it for you? Plz respond as I’m looking to construct my
    own blog and would like to know where u got this from.
    many thanks

  9. With havin so much content do you ever run into any problems of plagorism or copyright violation? My website
    has a lot of exclusive content I’ve either created myself or outsourced but it seems
    a lot of it is popping it up all over the internet without my permission. Do you know any solutions to help reduce content from being ripped off?
    I’d definitely appreciate it.

  10. Wonderful beat ! I would like to apprentice while you amend
    your website, how could i subscribe for a blog site? The account aided me
    a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea

  11. Great post. I used to be checking constantly this weblog and I am
    inspired! Very helpful information specifically the closing section 🙂 I
    handle such information a lot. I was looking for this particular information for a long time.

    Thanks and good luck.

  12. Do you have a spam issue on this site; I also am a blogger,
    and I was wanting to know your situation; many of us have created some nice practices and we are looking to exchange methods with
    others, why not shoot me an e-mail if interested.

  13. Woah! I’m really enjoying the template/theme of this blog.

    It’s simple, yet effective. A lot of times it’s hard to get
    that “perfect balance” between user friendliness and visual appeal.
    I must say you’ve done a fantastic job with this. Additionally, the blog loads extremely quick for me on Safari.

    Superb Blog!

  14. Admiring the hard work you put into your website and
    detailed information you provide. It’s awesome to come across a blog every once in a while that isn’t the same
    outdated rehashed information. Fantastic read! I’ve bookmarked your site and I’m adding
    your RSS feeds to my Google account.

  15. Please let me know if you’re looking for a article writer for
    your site. You have some really great articles and
    I believe I would be a good asset. If you ever want to take some of the load off,
    I’d absolutely love to write some material for your blog in exchange for a link back to mine.
    Please blast me an email if interested. Thank you!

  16. Nice answer back in return of this matter with genuine arguments and
    explaining the whole thing on the topic of that.

  17. First of all I would like to say fantastic blog! I had a quick question which I’d like to ask if you don’t
    mind. I was interested to know how you center yourself and clear
    your thoughts prior to writing. I’ve had a tough time clearing my thoughts in getting my ideas out there.
    I do enjoy 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? Thank you!

  18. Hey There. I found your blog using msn. This is a very well written article.
    I’ll be sure to bookmark it and return to read more of
    your useful info. Thanks for the post. I’ll definitely comeback.

  19. Greetings! I know this is kinda off topic however I’d figured I’d ask.
    Would you be interested in trading links or maybe guest writing a blog post or vice-versa?
    My site covers a lot of the same topics as yours and I think we could
    greatly benefit from each other. If you happen to be interested feel free to shoot me
    an e-mail. I look forward to hearing from you! Terrific blog by the way!

  20. Hi, I do think this is a great site. I stumbledupon it 😉 I may come back yet again since
    i have book marked it. Money and freedom is the best way to change, may you be rich and continue to help other people.

  21. Today, I went to the beach front with my children. I
    found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.”
    She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is completely off topic but I had
    to tell someone!

  22. Hi, i read your blog occasionally and i own a similar one and i was just wondering if you get a
    lot of spam feedback? If so how do you stop it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any help is very much appreciated.

  23. Hello there, You have done a great job. I’ll certainly digg it and personally recommend to my friends.
    I’m sure they will be benefited from this web site.

  24. Greetings! This is my first comment here so I just wanted to give a quick
    shout out and say I genuinely enjoy reading
    your articles. Can you suggest any other blogs/websites/forums that cover the same subjects?
    Thanks for your time!

  25. I simply could not leave your website prior to suggesting that I extremely enjoyed the usual info
    an individual supply for your visitors? Is gonna be again steadily in order to
    check up on new posts

  26. An outstanding share! I have just forwarded this onto a
    co-worker who had been doing a little research on this. And he
    in fact bought me dinner because I discovered it for him…

    lol. So allow me to reword this…. Thanks for the
    meal!! But yeah, thanks for spending some time to talk about
    this issue here on your site.

  27. Hi there this is somewhat of off topic but I was wondering if blogs
    use WYSIWYG editors or if you have to manually code with HTML.
    I’m starting a blog soon but have no coding skills so I wanted to get advice
    from someone with experience. Any help would
    be greatly appreciated!

  28. Thanks for one’s marvelous posting! I certainly enjoyed reading it,
    you are a great author. I will always bookmark your blog and may come back in the
    foreseeable future. I want to encourage continue
    your great work, have a nice weekend!

  29. Excellent website you have here but I was curious if you knew of any forums that cover the same topics talked about in this article?
    I’d really like to be a part of community where I can get comments from other experienced individuals that
    share the same interest. If you have any suggestions,
    please let me know. Thanks a lot!

Comments are closed.