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. Hey just wanted to give you a brief heads up and let you know a few of the images aren’t loading correctly.
    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 results.

  2. 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 completely off topic but I had to tell someone!

  3. This is the perfect site for anybody who hopes to
    find out about this topic. You understand so much its almost tough to argue with you (not that I actually
    would want to…HaHa). You certainly put a fresh spin on a subject that has been written about for decades.
    Excellent stuff, just excellent!

  4. Today, I went to the beach 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 entirely off topic but I had to tell someone!

  5. I think this is among the most significant information for
    me. And i am glad studying your article. However should statement
    on some basic things, The site taste is wonderful, the articles is actually excellent : D.
    Just right task, cheers

  6. It’s appropriate time to make some plans for the
    longer term and it’s time to be happy. I have
    read this submit and if I may I wish to suggest you few interesting
    things or advice. Maybe you can write next articles regarding this article.
    I want to read even more issues about it!

  7. I’m impressed, I must say. Seldom do I encounter a blog that’s equally educative and interesting, and let me tell you, you have hit the nail on the head. The issue is something which not enough people are speaking intelligently about. I am very happy that I found this in my hunt for something relating to this.|

  8. Write more, thats all I have to say. Literally, it seems as though you
    relied on the video to make your point. You obviously know what youre talking about, why waste your
    intelligence on just posting videos to your weblog when you could be giving us something
    informative to read?

  9. Hi, the whole thing is going sound here and ofcourse every one is sharing facts, that’s
    truly excellent, keep up writing.

  10. Hi! I simply would like to offer you a huge thumbs up for
    the excellent info you’ve got right here on this post.

    I will be returning to your web site for more soon.

  11. Write more, thats all I have to say. Literally, it seems as though you relied
    on the video to make your point. You clearly know what youre talking about,
    why waste your intelligence on just posting videos to your blog when you could
    be giving us something enlightening to read?

  12. Heya i’m for the first time here. I came across this board
    and I in finding It truly useful & it helped me out much.
    I’m hoping to present one thing back and help others such as you helped me.

  13. Does your blog have a contact page? I’m having trouble locating it but, I’d
    like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.

    Either way, great site and I look forward to seeing it develop over time.

  14. I do not even understand how I finished up right here, but I thought this submit was good.
    I do not recognize who you might be but definitely you’re going to a well-known blogger for those who are not
    already. Cheers!

  15. Whеn I originally commented Ӏ clicked tһe “Notify me when new comments are added” checkbox and now each tіme ɑ
    ϲomment іs аdded Ι get four emails with tһe ѕame comment.
    Is thee any wаʏ yօu can reemove people fгom that service?
    Ꭺppreciate іt!

    Sttop bʏ my page – স্লট লগইন

  16. Hi there, i read your blog occasionally and i own a similar one
    and i was just wondering if you get a lot of spam responses?

    If so how do you stop it, any plugin or anything you can suggest?
    I get so much lately it’s driving me insane so any help is very much
    appreciated.

  17. Asking questions are actually nice thing if you are not understanding something completely,
    except this post provides nice understanding even.

  18. I go to see everyday some web sites and information sites to read articles,
    however this weblog provides feature based articles.

  19. Hey! This is kind of off topic but I need some help from an established blog.

    Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty fast.
    I’m thinking about making my own but I’m not sure where to begin. Do you have any tips or suggestions?

    Appreciate it

  20. interesting review. Additionally visit favored site to have judi
    slot. This great site has received acceptance via slot deposit pulsa
    gambling house family in Negara sendiri. Certainly, there
    are generally plenty of wonderful promos whenever you join right now.

  21. important review. Additionally visit the actual site to find out slot pulsa.
    These pages has received popularity from the comfort of slot
    deposit pulsa tanpa potongan on line casino women and men in Negara sendiri.
    Certainly, there are usually numerous interesting
    promos for people who join right now.

  22. We are a group of volunteers and opening a new scheme in our community.
    Your site offered us with valuable info to work on.
    You’ve done a formidable job and our entire community
    will be grateful to you.

  23. stimulating review. Furthermore visit this kind of site to try out slot.
    This kind of web site has received detectors
    from slot pulsa tanpa potongan game playing people in Negara sendiri.
    Now there are generally plenty of fascinating promos indoors
    event anyone join right here.

  24. If some one desires expert view on the topic
    of running a blog after that i advise him/her to
    pay a quick visit this web site, Keep up the good work.

  25. I’m impressed, I have to admit. Seldom do I come across a
    blog that’s equally educative and engaging, and without a doubt, you have hit the nail on the head.

    The issue is something that not enough people
    are speaking intelligently about. I am very happy
    I came across this during my search for something concerning this.

  26. For most recent information you have to pay a quick visit internet and on the web I found this web page
    as a most excellent web page for hottest updates.

  27. I’m not sure exactly why but this site is loading very slow for me.
    Is anyone else having this issue or is it a issue on my end?
    I’ll check back later and see if the problem still exists.

Comments are closed.