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

  1. I do believe all the concepts you have introduced for your
    post. They are really convincing and can definitely
    work. Nonetheless, the posts are too quick for novices.

    Could you please lengthen them a bit from next time? Thank you for the post.

  2. Wonderful beat ! I wish to apprentice while you amend your site, how could i subscribe for a blog
    site? The account helped me a acceptable deal. I had
    been tiny bit acquainted of this your broadcast offered bright clear
    idea

  3. We stumbled over here coming from a different page and thought I may as well check things out.
    I like what I see so now i’m following you.
    Look forward to checking out your web page repeatedly.

  4. You actually make it seem so easy with your presentation but I find this topic to
    be actually something which I think I would never understand.
    It seems too complex and very broad for me. I’m looking forward for your next post,
    I’ll try to get the hang of it!

  5. Hi, I do think this is an excellent website. I stumbledupon it 😉 I will come
    back yet again since i have book-marked it. Money and freedom is the
    best way to change, may you be rich and continue to help others.

  6. Hmm is anyone else encountering problems with the images on this blog loading?
    I’m trying to determine if its a problem on my end or if it’s
    the blog. Any responses would be greatly appreciated.

  7. Hello there! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my blog to
    rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Appreciate it!

  8. Sweet blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Cheers

  9. Howdy! This is my first comment here so I just wanted to give a quick shout
    out and say I genuinely enjoy reading your posts.
    Can you suggest any other blogs/websites/forums that
    cover the same subjects? Thanks for your time!

  10. Wow, amazing blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your web site
    is fantastic, as well as the content!

  11. Hi are using WordPress for your site platform? I’m new to
    the blog world but I’m trying to get started and set up my own. Do you need any coding expertise to make
    your own blog? Any help would be greatly appreciated!

  12. Hello there! I could have sworn I’ve visited this blog
    before but after looking at a few of the posts I realized it’s
    new to me. Nonetheless, I’m certainly pleased I came across it and I’ll be bookmarking it and checking back
    frequently!

  13. Oh my goodness! Incredible article dude! Thank you, However I am encountering troubles with your RSS.

    I don’t know the reason why I cannot join it.
    Is there anybody having similar RSS problems?

    Anyone that knows the solution can you kindly respond?

    Thanks!!

  14. Greetings, I believe your blog could possibly be having web browser
    compatibility issues. Whenever I look at your website in Safari, it looks fine
    but when opening in Internet Explorer, it has some overlapping issues.

    I simply wanted to give you a quick heads up! Apart from that, fantastic website!

  15. Right now it looks like Drupal is the top
    blogging platform available right now. (from what
    I’ve read) Is that what you are using on your blog?

  16. 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 images.

    Maybe you could space it out better?

  17. LINK DAFTAR PRAGMATIC123 | LINK ALTERNATIF PRAGMATIC123 | LINK LOGIN PRAGMATIC123
    | PRAGMATIC123 | DITA4D | LINK DAFTAR DITA4D | LINK LOGIN DITA4D | LINK ALTERNATIF DITA4D | LINK DAFTAR PRAGMATIC77
    | LINK LOGIN PRAGMATIC77 | LINK ALTERNATIF PRAGMATIC77
    | PRAGMATIC77 | LINK DAFTAR PRAGMATIC189 | LINK LOGIN PRAGMATIC189 |
    LINK ALTERNATIF PRAGMATIC189 | PRAGMATIC189 | PRAGMATIC PLAY | DEMO PRAGMATIC PLAY | AKUN DEMO PRAGMATIC PLAY
    | KINGDOMTOTO | LINK DAFTAR KINGDOMTOTO | LINK ALTERNATIF KINGDOMTOTO | LINK LOGIN KINGDOMTOTO
    | KINGDOMTOTO WAP | LXTOTO | LINK LOGIN LXTOTO | LINK DAFTAR LXTOTO
    | LINK ALTERNATIF LXTOTO | LXTOTO WAP | LINK WAP LXTOTO

  18. ในสมัยนี้ มั่นใจว่าคนไทยนั้นต้องเผชิญกับปัญหาว่างงานหรือมีปัญหาเรื่องเกี่ยวกับการเงินอย่างแน่นอน เพราะเหตุว่าไม่ว่าจะเป็นเศรษฐกิจที่ต่ำ ไม่อาจจะดำเนินงานหาเงิน วันนี้ทางสล็อต
    เว็บตรงไม่ผ่านเอเย่นต์ไม่มีขั้นต่ำมีวิธีการหารายได้กล้วยๆกับการเล่นเกมสล็อตเว็บตรงที่เป็นเกมออนไลน์หารายได้ได้จริง สามารถหาเงินออนไลน์ได้ทุกที่ตลอดทั้งวัน 24 ชั่วโมง ซึ่ง g2gbk8 เป็นสล็อต เว็บตรงไม่ผ่านเอเย่นต์ไม่มีขั้นต่ำมีมั่นคงถูกตามกฎหมายคาสิโนสากล รับประกันจากผู้เล่นจริงทั้งประเทศ ทุกคนสามารถหาเงินกล้วยๆ โดยทาง g2gbk8 นั้นมีค่ายเกมjoker เว็บตรง,pg slot ไม่ผ่านเอเย่นต์,slotxo เว็บตรงไม่ผ่านเอเย่นต์ 2022,ซุปเปอร์สล็อต เพียงสมัครสล็อตกับทาง g2gbk8 ที่เป็นเว็บเกมสล็อต ซึ่งไม่ผ่านผู้แทนหรือตัวกลางอะไรก็ตามเล่นสล็อตได้โดยตรงกับค่ายเกม มีเกมslotให้เลือกเล่นมากยิ่งกว่า 200 เกม และก็ยังมีบริการต่างๆล้นหลามที่จะเพิ่มความสบายสบายให้กับสมาชิกเกมสล็อตเว็บตรง ไม่ว่าจะเป็นการเติม-ถอน ไม่มีอย่างต่ำรวมทั้งมีความรวดเร็วประเมินผลด้วยระบบอัตโนมัติ มีความเที่ยงตรงสูง ไม่ต้องส่งสลิปหลักฐานการโอนให้กับทางผู้ดูแลให้เสียเวลา หรือจะเป็นโปรโมชั่นแจกฟรีเครดิต100%
    หรือจะเป็นโปรฝาก 20 รับ 100 ทุกท่านสามารถหารายได้ออนไลน์ได้แล้วที่สล็อต เว็บตรงไม่ผ่านเอเย่นต์ไม่มีขั้นต่ำ เว็บสล็อตแตกง่าย

  19. Somebody necessarily help to make seriously posts I would state.
    That is the first time I frequented your website page
    and so far? I surprised with the research you made to make this particular submit
    extraordinary. Excellent job!

  20. Hi, I ⅾo thіnk this is a great site. I stumbledupon it
    😉 Ӏ’m ɡoing to revisit уet again sіnce I bookmarked it.
    Money аnd freedom iss tһe bеst way tо chɑnge, may you Ƅe rrich аnd continue tο guide othеr people.

    Tаke a ⅼo᧐k at my blog post; lire le sujet tendance

Comments are closed.