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. I’ve been surfing online more than 3 hours today, yet I
    never found any interesting article like yours. It’s pretty
    worth enough for me. In my opinion, if all site owners
    and bloggers made good content as you did,
    the internet will be much more useful than ever before.

  2. This is really interesting, You’re a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your great post.
    Also, I have shared your site in my social networks!

  3. I know this if off topic but I’m looking into starting my
    own blog and was wondering what all is required to get setup?

    I’m assuming having a blog like yours would cost a pretty penny?

    I’m not very web savvy so I’m not 100% sure.

    Any suggestions or advice would be greatly appreciated.
    Cheers

  4. Hello, Neat post. There’s an issue together with your website in web
    explorer, might check this? IE nonetheless is the market leader and a
    good section of other folks will omit your fantastic writing because of this problem.

  5. I do trust all of the concepts you have presented in your post.

    They are really convincing and will definitely work. Still, the posts are very
    short for starters. May just you please prolong them a little from next time?
    Thanks for the post.

  6. Hi! I just wanted to ask if you ever have any issues with hackers?

    My last blog (wordpress) was hacked and I ended up losing several weeks
    of hard work due to no data backup. Do you have
    any solutions to prevent hackers?

  7. I really like your blog.. very nice colors & theme.
    Did you design this website yourself or did you hire
    someone to do it for you? Plz respond as I’m looking to
    create my own blog and would like to know where
    u got this from. thank you

  8. I’ve been surfing online more than 4 hours today, yet I
    never found any interesting article like yours. It’s pretty worth enough for me.
    In my opinion, if all web owners and bloggers made good content
    as you did, the net will be a lot more useful than ever before.

  9. Pretty section of content. I simply stumbled upon your website and in accession capital to claim that I get in fact
    loved account your blog posts. Anyway I will be subscribing to your feeds or even I fulfillment you
    get right of entry to constantly quickly.

  10. I was curious if you ever considered 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 pictures.
    Maybe you could space it out better?

  11. I’ve been surfing 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 website
    owners and bloggers made good content as you did, the web will be much more useful than ever before.

  12. I was wondering if you ever considered changing the 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 1 or 2 pictures.

    Maybe you could space it out better?

  13. Hi! I could have sworn I’ve visited this website
    before but after looking at many of the posts I realized
    it’s new to me. Anyways, I’m certainly pleased I stumbled upon it and I’ll be book-marking it and checking back often!

  14. Hello there, just became aware of your blog through Google,
    and found that it’s really informative. I’m going to watch
    out for brussels. I’ll be grateful if you continue this {in future}.
    Lots of people will be benefited from your writing. Cheers!

  15. Hello everybody, here every one is sharing
    these kinds of familiarity, so it’s good to read this weblog,
    and I used to visit this weblog every day.

  16. Today, while I was at work, my sister stole my iPad and tested to see
    if it can survive a thirty foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and
    she has 83 views. I know this is entirely off topic but I had to share it with someone!

  17. Woah! I’m really digging the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s very
    hard to get that “perfect balance” between user friendliness and appearance.
    I must say you’ve done a excellent job with this.
    Additionally, the blog loads extremely fast for me on Internet explorer.

    Excellent Blog!

  18. Fantastic blog! Do you have any helpful hints for aspiring writers?
    I’m planning to start my own blog soon but I’m a little lost on everything.
    Would you recommend 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 recommendations?

    Cheers!

  19. 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.

  20. Somebody essentially help to make seriously articles I might state.
    That is the very first time I frequented your web page
    and to this point? I surprised with the research
    you made to create this particular put up amazing. Fantastic job!

  21. I am now not positive where you’re getting your information,
    however good topic. I needs to spend a while learning
    more or working out more. Thanks for great info I was searching for
    this information for my mission.

  22. Today, while I was at work, my sister stole my apple ipad and tested to see if it can survive a
    40 foot drop, just so she can be a youtube sensation. My
    apple ipad is now destroyed and she has 83 views. I know this is entirely off topic but I had to share it with someone!

  23. Woah! I’m really digging the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between superb usability and
    visual appearance. I must say you’ve done a awesome job with this.
    Additionally, the blog loads extremely quick for me on Opera.

    Excellent Blog!

  24. It’s actually very complex in this full of activity life to listen news on Television,
    thus I simply use internet for that reason, and
    take the most up-to-date information.

  25. excellent points altogether, you just received a new reader.
    What may you suggest about your publish that you just made a few days in the past?
    Any positive?

  26. Hey there just wanted to give you a brief heads up and let you know a few of the pictures aren’t loading properly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the same outcome.

  27. Woah! I’m really loving the template/theme of this
    website. It’s simple, yet effective. A lot of times it’s challenging
    to get that “perfect balance” between usability and visual appearance.

    I must say that you’ve done a very good job with this. Also, the blog loads very quick for me on Safari.

    Excellent Blog!

  28. I truly love your site.. Very nice colors & theme. Did you build this website yourself?
    Please reply back as I’m wanting to create my very own website and want
    to know where you got this from or exactly what the theme is named.

    Thanks!

Comments are closed.