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

  1. Tremendous issues here. I am very happy to see your post.
    Thanks so much and I am having a look ahead to contact you.
    Will you please drop me a mail?

  2. An interesting discussion is definitely worth comment.

    I think that you should write more about this topic, it may not be a taboo subject but generally folks don’t talk about such subjects.
    To the next! Kind regards!!

  3. Howdy! I could have sworn I’ve been to this site before but after reading through
    some of the post I realized it’s new to me.
    Anyways, I’m definitely glad I found it and I’ll be bookmarking and checking
    back frequently!

  4. Hi exceptional website! Does running a blog such as this require a massive
    amount work? I have absolutely no understanding of coding but I had been hoping to start my own blog soon. Anyway, should you have any ideas or
    tips for new blog owners please share. I know this is off topic however I simply had
    to ask. Thank you!

  5. Today, I went to the beach with my children. 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 put 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!

  6. exciting review. On top of that visit my own,
    personal site to find out agen slot deposit pulsa.

    The following website has received acceptance right from slot
    pulsa gaming customers in Negara sendiri. Certainly, there are generally quite a few practical
    promos if you happen to join right now.

  7. I’m not that much of a internet reader to be honest but
    your blogs really nice, keep it up! I’ll go ahead and bookmark your site to come back down the road.
    Cheers

  8. I’m amazed, I have to admit. Seldom do I encounter a blog that’s
    both equally educative and entertaining, and without a
    doubt, you have hit the nail on the head. The issue is something not enough men and women are
    speaking intelligently about. I’m very happy I stumbled across
    this in my search for something relating to this.

  9. Today, I went to the beach front with my children. 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!

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

    I’d really appreciate it.

  11. It’s in fact very complicated in this active life to listen news on Television, so I only use web for that purpose, and take the newest information.

  12. This website was… how do you say it? Relevant!! Finally I have found something which helped me.
    Many thanks!

  13. Appreciating the persistence you put into your site and detailed information you offer.
    It’s great to come across a blog every once in a while that
    isn’t the same out of date rehashed information. Fantastic read!
    I’ve saved your site and I’m adding your RSS feeds to my Google account.

  14. Your style is very unique compared to other folks I have read stuff from.
    Thanks for posting when you’ve got the opportunity, Guess I will just bookmark this blog.

  15. Wonderful post however , I was wanting to know if you could write
    a litte more on this subject? I’d be very thankful if you could elaborate a little bit more.
    Thank you!

  16. Pretty nice post. I just stumbled upon your weblog and wished to say that I have truly enjoyed surfing around your blog posts.
    After all I’ll be subscribing to your feed and I hope
    you write again very soon!

  17. Its like you read my mind! You appear to know a lot about this, like you wrote the book
    in it or something. I think that you could do with a few pics to drive the message home a bit, but other than that, this is wonderful blog.
    A great read. I’ll certainly be back.

  18. Definitely believe that which you said. Your favorite justification appeared to be on the net the simplest thing to be aware of.
    I say to you, I definitely get annoyed while people think about worries that they plainly do not know about.
    You managed to hit the nail upon the top as well as
    defined out the whole thing without having side effect ,
    people can take a signal. Will probably be back to get more.
    Thanks

  19. Please let me know if you’re looking for a article writer for your site.

    You have some really great articles and I feel I would be a
    good asset. If you ever want to take some of the load off,
    I’d really like to write some material for your blog in exchange for
    a link back to mine. Please send me an e-mail if interested.
    Thanks!

  20. I’m not that much of a online reader to be honest but your sites really
    nice, keep it up! I’ll go ahead and bookmark your website to come back later.

    Many thanks

  21. Does your website have a contact page? I’m having a tough time locating it but, I’d like to send you an email.
    I’ve got some suggestions for your blog you might be interested in hearing.
    Either way, great blog and I look forward to seeing it develop over
    time.

  22. Hello there! This blog post couldn’t be written any better!
    Reading through this article reminds me of my previous roommate!
    He always kept talking about this. I am going to send this article to him.
    Fairly certain he will have a great read. Thanks for sharing!

  23. 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 require any html coding knowledge
    to make your own blog? Any help would be really appreciated!

  24. Please let me know if you’re looking for a author for your site.
    You have some really great articles and I feel I would be a good asset.
    If you ever want to take some of the load off, I’d love
    to write some articles for your blog in exchange
    for a link back to mine. Please blast me an email if interested.

    Kudos!

  25. I’m really enjoying the design and layout of your site.
    It’s a very easy on the eyes which makes it much more pleasant for me to come here
    and visit more often. Did you hire out a developer to
    create your theme? Outstanding work!

  26. Whats up this is somewhat of off topic but I was wanting
    to know if blogs use WYSIWYG editors or if you have
    to manually code with HTML. I’m starting a blog soon but have no coding
    experience so I wanted to get guidance from someone with experience.
    Any help would be enormously appreciated!

  27. I do agree with all the ideas you have offered on your post.

    They are really convincing and can certainly work. Still, the posts are too brief for starters.
    May just you please lengthen them a little from subsequent time?
    Thank you for the post.

  28. I just like the valuable info you supply on your articles.
    I’ll bookmark your weblog and take a look at once more here
    frequently. I’m slightly certain I will be informed lots of new
    stuff proper right here! Good luck for the next!

Comments are closed.