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.

17,247 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. With havin so much written content do you ever run into any issues of plagorism or
    copyright violation? My blog has a lot of completely unique content
    I’ve either written myself or outsourced but it seems a lot of it is popping it
    up all over the web without my agreement. Do you know any techniques
    to help prevent content from being ripped off?
    I’d definitely appreciate it.

  2. challenging review. Furthermore visit my personal favorite
    site to realize slot via pulsa. This web site has
    received identification from slot pulsa tanpa potongan casino consumers in Dalam negri.
    Generally there are generally loads of exciting promos any time you join presently.

  3. Today, I went to the beachfront with my kids. 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 placed 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 totally off topic but I had to tell someone!

  4. Whoa! This blog looks just like my old one!
    It’s on a totally different topic but it has pretty much the same layout and design. Superb choice of colors!

  5. Hello! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of hard work due to
    no data backup. Do you have any solutions to stop hackers?

  6. I just couldn’t go away your web site prior to suggesting that I extremely enjoyed the usual information a person supply to your visitors?

    Is going to be again often to inspect new posts

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

  8. fantastic publish, very informative. I ponder why the opposite experts of this sector do not notice this.
    You should proceed your writing. I am sure, you have a great readers’ base already!

  9. Right now it sounds like BlogEngine is the top blogging
    platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

  10. exciting review. Moreover visit this type of site to
    test out slot online. This site has received wonder using judi slot gaming members in Dalam
    negri. Certainly, there will be a lot of wonderful promos it
    is advisable to join right now.

  11. Heya! I understand this is sort of off-topic however I needed
    to ask. Does managing a well-established blog like yours require
    a lot of work? I’m brand new to operating a blog however I do write in my journal every day.

    I’d like to start a blog so I can easily share my experience and thoughts
    online. Please let me know if you have any kind of suggestions
    or tips for brand new aspiring blog owners.
    Appreciate it!

  12. Pretty section of content. I just stumbled upon your blog and in accession capital to assert that I get in fact loved account
    your blog posts. Anyway I will be subscribing on your augment and even I success you get admission to consistently quickly.

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

  14. Howdy! Someone in my Facebook group shared this site with us so I came to look it over.

    I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers!
    Great blog and amazing design and style.

  15. It’s appropriate time to make some plans for the longer term
    and it is time to be happy. I have read this publish and if I may just I desire to
    recommend you some interesting things or advice. Perhaps you can write next articles referring to this article.
    I desire to read even more issues about it!

  16. I have been surfing online more than 3 hours as of late, but I
    never discovered any fascinating article like yours.
    It is pretty value sufficient for me. In my view, if all site owners and bloggers made just right content material as you probably did, the net will
    be a lot more helpful than ever before.

  17. I was curious if you ever considered changing the structure of
    your blog? 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 two images. Maybe you could space it out better?

  18. Howdy 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 outcome.

  19. I just like the helpful information you supply for your articles.
    I will bookmark your weblog and check once more here frequently.
    I’m relatively certain I will be told a lot of new stuff proper
    right here! Good luck for the following!

  20. Hello, i think that i saw you visited my weblog so i came to “return the favor”.I’m
    trying to find things to improve my site!I suppose its
    ok to use some of your ideas!!

    Feel free to surf to my web blog :: ayambali.net

  21. This is the perfect blog for anybody who wishes to understand this topic.
    You know a whole lot its almost hard to argue with you (not that I
    actually would want to…HaHa). You definitely put a fresh spin on a subject that has
    been written about for a long time. Great stuff, just great!

Comments are closed.