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

  1. Hey! Do you know if they make any plugins
    to help with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Kudos!

  2. When I originally commented I appear to have
    clicked the -Notify me when new comments are added- checkbox
    and now each time a comment is added I receive 4 emails with the exact same
    comment. Perhaps there is a means you are able to remove me
    from that service? Kudos!

  3. Hey there 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 web browser compatibility but I figured I’d post to let you know.
    The design and style look great though! Hope you get the issue fixed soon. Cheers

  4. I know this if off topic but I’m looking into starting
    my own blog and was curious what all is needed to get set up?
    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very internet savvy so I’m not 100% certain. Any recommendations or advice would be greatly appreciated.
    Kudos

  5. I am really inspired along with your writing abilities and also with the format in your weblog.
    Is this a paid subject or did you modify it your self?
    Anyway keep up the excellent high quality writing, it is
    uncommon to see a great weblog like this one nowadays..

  6. You really make it seem so easy with your presentation but I find this
    topic to be really something which I think I would never understand.
    It seems too complex and extremely broad for me. I am looking forward for your next post,
    I will try to get the hang of it!

  7. Hello are using WordPress for your site platform?
    I’m new to the blog world but I’m trying to get started and create my
    own. Do you require any html coding expertise
    to make your own blog? Any help would be greatly appreciated!

  8. Hello There. I found your weblog the use of msn. That is a
    very well written article. I will be sure to bookmark
    it and come back to read more of your helpful info. Thank
    you for the post. I’ll certainly comeback.

  9. Hi there! I just wanted to ask if you ever have any problems with hackers?
    My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to
    no back up. Do you have any solutions to stop hackers?

  10. Thanks , I have recently been looking for info about this subject for ages
    and yours is the best I have discovered so far.

    However, what in regards to the conclusion? Are you
    sure concerning the source?

  11. Oh my goodness! Amazing article dude! Thank you so much, However I am encountering problems with your RSS.
    I don’t know the reason why I cannot subscribe
    to it. Is there anyone else getting identical RSS issues?
    Anyone who knows the solution can you kindly respond? Thanx!!

  12. Hello, I believe your website could possibly be having browser compatibility issues.
    Whenever I take a look at your web site in Safari, it looks fine however, if opening in Internet Explorer, it has some overlapping issues.
    I simply wanted to give you a quick heads up! Besides that, wonderful site!

  13. Excellent pieces. Keep writing such kind of information on your site.

    Im really impressed by your site.
    Hey there, You have performed an incredible job. I’ll definitely digg
    it and individually suggest to my friends. I’m sure they will be benefited from this
    web site.

  14. Excellent post. I used to be checking continuously this weblog and I am inspired!
    Very helpful information specially the last part ๐Ÿ™‚ I care for such info a lot.

    I was seeking this certain information for a very long time.
    Thank you and best of luck.

  15. I simply couldn’t leave your web site prior to suggesting
    that I extremely loved the usual info an individual supply to your guests?
    Is gonna be back incessantly in order to check up on new posts

  16. My partner and I stumbled over here from a different web page and thought I might as well check things out.
    I like what I see so i am just following you. Look forward to
    going over your web page yet again.

  17. hey there and thank you for your info รขโ‚ฌโ€œ I have certainly picked
    up anything new from right here. I did however expertise a few technical points
    using this web site, as I experienced to reload the web site a lot of times previous to
    I could get it to load correctly. I had been wondering if your web hosting is OK?
    Not that I am complaining, but sluggish loading instances times
    will often affect your placement in google and could damage
    your high-quality score if advertising and marketing with Adwords.
    Anyway I’m adding this RSS to my email and could look out for much more of your
    respective interesting content. Make sure you update this again very
    soon.

  18. Pretty component to content. I just stumbled upon your weblog and in accession capital to assert that I get actually loved account your weblog
    posts. Anyway I’ll be subscribing in your augment and even I fulfillment you access persistently rapidly.

  19. hi!,I love your writing very so much! proportion we communicate more about your post
    on AOL? I need a specialist on this space to resolve my problem.
    May be that is you! Looking ahead to peer you.

  20. 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
    blog when you could be giving us something informative to read?

  21. It is the best time to make some plans for the longer term and
    it’s time to be happy. I’ve read this publish and if I could I wish to recommend you few fascinating issues or tips.
    Maybe you can write subsequent articles referring to this article.
    I desire to learn more issues approximately it!

  22. Hi just wanted to give you a brief heads up and let you know a few of the images aren’t loading
    properly. I’m not sure why but I think its a linking issue.

    I’ve tried it in two different internet browsers and both show the same results.

  23. Do you have a spam problem on this site;
    I also am a blogger, and I was curious about your situation;
    we have created some nice procedures and we are looking to exchange methods with others, why not shoot
    me an email if interested.

  24. It’s awesome in support of me to have a web page, which
    is useful in favor of my knowledge. thanks admin

  25. Have you ever considered creating an ebook or guest
    authoring on other blogs? I have a blog based on the same topics you discuss
    and would love to have you share some stories/information. I
    know my subscribers would appreciate your work. If you’re even remotely interested, feel free to send me an email.

  26. Good day! This post could not be written any better!
    Reading through this post reminds me of my previous room mate!
    He always kept talking about this. I will forward this article to him.
    Pretty sure he will have a good read. Many thanks for sharing!

Comments are closed.