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

  1. My developer is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using Movable-type on a number of websites for about a year and am worried
    about switching to another platform. I have heard very good things about blogengine.net.
    Is there a way I can transfer all my wordpress posts into it?
    Any kind of help would be really appreciated!

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

  3. Heya! I know this is somewhat off-topic however I had to ask.
    Does operating a well-established website such as yours require a
    massive amount work? I am completely new to writing a blog but I do write in my
    journal daily. I’d like to start a blog so I will be able to share my own experience and feelings online.
    Please let me know if you have any recommendations or tips for new aspiring
    bloggers. Appreciate it!

  4. Very nice post. I just stumbled upon your weblog
    and wanted to say that I have truly loved surfing around your blog posts.
    After all I will be subscribing for your feed and I am hoping you write
    once more soon!

  5. 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 shakiness over that you wish be delivering the following.
    unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield
    this increase.

  6. Howdy! This is kind of off topic but I need some guidance
    from an established blog. Is it very hard
    to set up your own blog? I’m not very techincal but I
    can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to begin. Do you have any tips or suggestions?

    Appreciate it

  7. Admiring the hard work you put into your site and detailed information you present.
    It’s awesome to come across a blog every once in a while that isn’t the same out of date rehashed
    information. Wonderful read! I’ve saved your site and I’m adding your RSS
    feeds to my Google account.

  8. hello!,I love your writing very much! share we keep in touch extra approximately your post on AOL?
    I need a specialist on this house to solve my
    problem. May be that is you! Taking a look forward to look you.

  9. Awesome blog! Do you have any helpful hints for
    aspiring writers? I’m planning to start my own blog soon but I’m a little lost on everything.
    Would you suggest starting with a free platform like WordPress
    or go for a paid option? There are so many options out there that I’m completely confused ..
    Any tips? Cheers!

  10. Hey I know this is off topic but I was wondering if you knew of
    any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like
    this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  11. 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 little bit, but instead of that, this is
    great blog. A fantastic read. I’ll certainly be back.

  12. I’ve been exploring for a little for any high quality articles or weblog posts on this kind of house .
    Exploring in Yahoo I finally stumbled upon this website.

    Studying this info So i am glad to exhibit that I have an incredibly excellent uncanny feeling
    I discovered exactly what I needed. I so much no doubt will make certain to do not forget this
    website and provides it a look on a relentless basis.

  13. Just desire to say your article is as amazing. The clarity for your post is just great and i could think you’re
    a professional on this subject. Well together with your permission let me to take hold of your RSS feed to
    keep up to date with imminent post. Thanks a million and please
    continue the enjoyable work.

  14. I was suggested this website by my cousin. I am not sure whether this post is written by him
    as no one else know such detailed about my trouble.
    You’re incredible! Thanks!

  15. Its not my first time to pay a quick visit this website, i am browsing this web
    page dailly and take nice data from here all the time.

  16. Greetings! Quick question that’s completely off topic. Do you know how to make your
    site mobile friendly? My website looks weird when viewing from my apple iphone.
    I’m trying to find a theme or plugin that might be able to resolve this problem.

    If you have any suggestions, please share. With thanks!

  17. Everything said made a ton of sense. But, consider this, what if you added a little information? I mean, I don’t want to tell you how to run your blog, but suppose you added something to maybe grab folk’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku – Umar faisol
    is a little boring. You might glance at Yahoo’s home page and see how
    they write article titles to get viewers to open the links.
    You might add a video or a picture or two to get readers interested about everything’ve written. In my opinion, it
    could make your posts a little bit more interesting.

  18. Hello there, just became aware of your blog through Google, and found that it is really
    informative. I’m going to watch out for
    brussels. I will appreciate if you continue this
    {in future}. Numerous people will be benefited from your
    writing. Cheers!

  19. 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 site to come back down the road.
    Cheers

  20. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter
    updates. I’ve been looking for a plug-in like this for quite some time
    and was hoping maybe you would have some experience with something like
    this. Please let me know if you run into anything. I truly enjoy reading
    your blog and I look forward to your new updates.

  21. We’re a group of volunteers and opening a new scheme
    in our community. Your site offered us with valuable information to work
    on. You’ve done an impressive job and our entire community will be grateful to you.

  22. I’m impressed, I have to admit. Seldom do I come across a blog that’s both
    equally educative and entertaining, and without a doubt,
    you have hit the nail on the head. The problem is an issue
    that too few people are speaking intelligently about.
    Now i’m very happy I stumbled across this during my search for something concerning
    this.

  23. Hello my friend! I wish to say that this article is amazing, nice written and include almost all vital infos.
    I’d like to look extra posts like this .

Comments are closed.