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. Admiring the persistence you put into your blog and in depth
    information you provide. It’s great to come across a blog
    every once in a while that isn’t the same out of date
    rehashed material. Wonderful read! I’ve saved your site and I’m adding
    your RSS feeds to my Google account.

  2. Aw, this was an extremely nice post. Taking a few minutes and actual effort to produce a very good article… but what can I say… I put things off a whole lot and never
    seem to get nearly anything done.

  3. I just like the valuable information you supply in your articles.
    I’ll bookmark your blog and check once more here frequently.
    I’m rather sure I will be told lots of new stuff right
    here! Good luck for the next!

  4. Admiring the persistence you put into your blog and in depth information you present.
    It’s good to come across a blog every once in a while that isn’t
    the same out of date rehashed information. Great read!
    I’ve bookmarked your site and I’m adding your RSS
    feeds to my Google account.

  5. 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 can do with some pics to drive the message home a bit, but
    other than that, this is great blog. A great read.
    I’ll definitely be back.

  6. Hello! I could have sworn I’ve been to this site before but after
    browsing through some of the post I realized it’s new to me.

    Anyhow, I’m definitely glad I found it and I’ll be bookmarking and checking back frequently!

  7. I think that everything composed made a lot of sense.
    But, consider this, suppose you wrote a catchier title?
    I ain’t suggesting your content is not solid, however what
    if you added something that grabbed people’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku
    – Umar faisol is kinda plain. You might look at Yahoo’s home page and
    see how they create post titles to grab people to click.
    You might try adding a video or a related picture or two to
    grab readers interested about what you’ve got to say. Just my opinion, it could bring your
    posts a little livelier.

  8. I do not know whether it’s just me or if everyone else experiencing issues with your blog.
    It appears as if some of the written text within your content are running off the screen. Can someone else
    please provide feedback and let me know if this is happening to them too?

    This could be a problem with my internet browser because I’ve had
    this happen previously. Appreciate it

  9. Wow that was unusual. I just wrote an incredibly long comment
    but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again. Anyway, just wanted to
    say great blog!

  10. Hi, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam feedback?
    If so how do you protect against it, any plugin or anything you can suggest?
    I get so much lately it’s driving me crazy so any assistance is very much appreciated.

  11. 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 weblog when you could be giving us something enlightening
    to read?

  12. Aw, this was an exceptionally good post. Spending some time and actual effort to make
    a good article… but what can I say… I put things off a lot and never manage to get anything done.

  13. Pretty nice post. I just stumbled upon your blog and
    wanted to say that I have truly enjoyed browsing
    your blog posts. In any case I will be subscribing
    to your rss feed and I hope you write again very
    soon!

  14. It’s remarkable to visit this web page and reading the views of all
    colleagues on the topic of this post, while I am also keen of getting experience.

  15. important review. Moreover visit our own site to view slot pulsa online.
    This page has received identification from
    the slot deposit pulsa tanpa potongan video gaming other individuals in Negara sendiri.
    Generally there tend to be lots of eye catching promos since you join now.

  16. Hɑvе you eveг cоnsidered about adding a little bit
    mokre tһan just үօur articles? Ӏ mean, what you say іs fundamental ɑnd everything.
    However just imagine if yyou added some great images օr video
    clips tο gige yоur posts mߋre, “pop”! Your content is excellent Ьut
    with images аnd clips, this blog couⅼd certаinly be оne of the greatest in itѕ field.
    Terrific blog!

    mу blog post :: อ่านหัวข้อที่กำลังเป็นกระแส

  17. Having read this I thought it was rather informative.
    I appreciate you spending some time and effort to put this information together.
    I once again find myself personally spending a lot of time both reading and leaving comments.
    But so what, it was still worth it!

  18. Hello, I think your site might be having browser compatibility issues.
    When I look at your blog site in Ie, it looks
    fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, terrific blog!

  19. If some one needs to be updated with latest technologies therefore he
    must be visit this web page and be up to date all the time.

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

Comments are closed.