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. critical review. In the same way visit your individual site
    to comprehend judi slot. These pages has received acceptance originating from video slot online casino competitors in Dalam negeri.
    Now there are generally a lot of good promos if however , you join at present.

  2. What’s up to all, the contents existing at this site are truly
    amazing for people experience, well, keep up the nice work
    fellows.

  3. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a
    comment is added I get three e-mails with the same comment.
    Is there any way you can remove me from that service?
    Bless you!

  4. I enjoy what you guys are usually up too. This type of clever work and
    coverage! Keep up the good works guys I’ve included you guys to
    my blogroll.

  5. Hey! I’m at work surfing around your blog from my new apple iphone!
    Just wanted to say I love reading through your blog and look forward to all
    your posts! Keep up the excellent work!

  6. Its like you read my mind! You appear to know so much about this, like you wrote the book
    in it or something. I think that you could do with some pics to drive the message home
    a little bit, but instead of that, this is magnificent blog.
    An excellent read. I’ll definitely be back.

  7. I don’t even know how I ended up here, but I thought this post was great.
    I do not know who you are but definitely you’re going to a famous blogger if you are not already
    😉 Cheers!

  8. Hi, I do think this is an excellent blog. I stumbledupon it 😉 I am going to come back yet again since I
    bookmarked it. Money and freedom is the best way to change, may you be rich and continue to guide others.

  9. Hey! I know this is kinda off topic nevertheless I’d figured I’d ask.

    Would you be interested in exchanging links or maybe guest writing a blog article
    or vice-versa? My blog covers a lot of the same topics as yours and I believe we could
    greatly benefit from each other. If you’re interested feel free to shoot me an e-mail.
    I look forward to hearing from you! Excellent blog by
    the way!

  10. Because the admin of this web site is working, no hesitation very soon it
    will be famous, due to its quality contents.

  11. Its like you read my mind! You seem to know a lot about this, like you
    wrote the book in it or something. I think that you can do with
    some pics to drive the message home a bit, but instead of that, this is excellent blog.
    A great read. I will certainly be back.

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

  13. It’s remarkable to pay a quick visit this web site and reading the
    views of all mates concerning this paragraph, while I am also keen of getting know-how.

  14. Greetings from Ohio! I’m bored at work so I decided to check out your blog
    on my iphone during lunch break. I enjoy the knowledge you present here
    and can’t wait to take a look when I get home. I’m amazed at
    how fast your blog loaded on my cell phone .. I’m not even using WIFI,
    just 3G .. Anyhow, very good blog!

  15. beneficial review. Additionally visit your own site which can be
    competed agen slot deposit pulsa. This incredible web-site has received globally recognition along
    with agen slot pulsa casino enemy in Dalam negri. There are
    generally many fascinating promos if you join at this time.

  16. Pretty component of content. I just stumbled upon your blog and in accession capital to assert that
    I acquire in fact loved account your blog posts. Anyway I will be subscribing to your feeds
    or even I achievement you get entry to constantly fast.

  17. After I initially commented I seem to have clicked on the
    -Notify me when new comments are added- checkbox and from now on every time a comment is added I recieve 4 emails
    with the same comment. Is there a way you can remove me from
    that service? Kudos!

  18. I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.

    nonetheless, you command get bought an edginess over that you wish be delivering
    the following. unwell unquestionably come further
    formerly again since exactly the same nearly a lot often inside case you shield this hike.

  19. I think everything said was actually very reasonable. However, think on this, suppose you
    added a little information? I ain’t suggesting your information isn’t good, however suppose you
    added something that makes people desire more? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku –
    Umar faisol is kinda boring. You ought to glance at Yahoo’s
    front page and note how they create post titles to get people to click.
    You might add a video or a picture or two to get readers excited about what you’ve got to
    say. In my opinion, it could make your posts a little livelier.

  20. Heya! I just wanted to ask if you ever have any problems with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of hard work
    due to no back up. Do you have any methods to prevent hackers?

  21. You can definitely see your expertise within the article you write.

    The world hopes for even more passionate writers like you who aren’t afraid to say how they believe.
    At all times go after your heart.

  22. Hello every one, here every one is sharing such knowledge, therefore it’s
    nice to read this weblog, and I used to pay a
    visit this weblog all the time.

  23. 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 throw away
    your intelligence on just posting videos to your site when you could be giving us something
    informative to read?

Comments are closed.