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

  1. It’s a shame you don’t have a donate button! I’d without
    a doubt donate to this outstanding blog! I suppose for now i’ll settle for book-marking and adding your RSS
    feed to my Google account. I look forward to brand new updates and will share this
    blog with my Facebook group. Chat soon!

  2. Exceptional post however I was wondering if you could write a litte
    more on this subject? I’d be very grateful if you could elaborate a little bit more.

    Many thanks!

  3. I got this website from my pal who told me on the topic of
    this site and at the moment this time I am browsing this web site and reading very
    informative articles or reviews at this place.

  4. These are in fact impressive ideas in about blogging.
    You have touched some fastidious things here. Any
    way keep up wrinting.

  5. Every weekend i used to visit this website, as i want enjoyment,
    as this this website conations truly fastidious funny material too.

  6. I really like what you guys are up too. This kind of clever
    work and reporting! Keep up the awesome works guys I’ve included you guys to my personal blogroll.

  7. whoah this blog is magnificent i like studying your articles.
    Stay up the good work! You know, a lot of people are searching round for this information, you can aid them greatly.

  8. I think the admin of this web site is truly working hard in support of
    his web site, because here every material is quality based data.

  9. My spouse and I stumbled over here coming from a different
    page and thought I might check things out. I like what I see so now i am following you.
    Look forward to checking out your web page yet again.

  10. Howdy this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have
    to manually code with HTML. I’m starting a blog
    soon but have no coding know-how so I wanted to get advice from someone with experience.
    Any help would be enormously appreciated!

  11. My developer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on a variety of websites for about
    a year and am nervous about switching to another platform.
    I have heard fantastic things about blogengine.net.
    Is there a way I can transfer all my wordpress content into
    it? Any kind of help would be greatly appreciated!

  12. I like the helpful info you provide in your articles.
    I will bookmark your blog and check again here frequently.

    I am quite sure I will learn many new stuff right
    here! Best of luck for the next!

  13. It’s amazing to pay a visit this web page and reading the views of all mates about this post, while I am also
    eager of getting knowledge.

  14. Thank you for some other informative website. Where else may I get that
    type of info written in such a perfect means?
    I’ve a mission that I am simply now operating on, and I’ve been at the glance
    out for such information.

  15. obviously like your website however you have to test the spelling on several of your posts.

    Several of them are rife with spelling problems and I to find it very bothersome to inform the
    truth on the other hand I will definitely come again again.

  16. I got this web page from my pal who told me concerning this web site and now this time I am visiting this web
    site and reading very informative posts at
    this place.

  17. Everything published made a great deal of sense. But, think about this,
    what if you composed a catchier title? I ain’t suggesting your information isn’t solid., however what if you added
    a title to possibly grab a person’s attention? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku – Umar
    faisol is kinda boring. You should glance
    at Yahoo’s home page and see how they write article headlines to grab viewers to open the links.
    You might add a video or a pic or two to grab readers
    excited about what you’ve written. In my opinion, it might make your posts a little livelier.

  18. Thanks for your marvelous posting! I really enjoyed reading it, you will be a great author.
    I will make sure to bookmark your blog and will often come back
    at some point. I want to encourage you to
    ultimately continue your great writing, have a nice morning!

  19. I am really loving the theme/design of your website.
    Do you ever run into any browser compatibility issues?
    A number of my blog visitors have complained about my website not working correctly in Explorer but looks great in Chrome.
    Do you have any tips to help fix this problem?

  20. You are so awesome! I don’t suppose I’ve truly read through a single thing like this before.

    So wonderful to discover somebody with some original thoughts on this topic.
    Seriously.. thanks for starting this up. This web site is something that is required on the internet, someone with a
    bit of originality!

  21. I am not sure where you are getting your information, but great topic.
    I needs to spend some time learning more or understanding more.

    Thanks for magnificent info I was looking for this information for my
    mission.

  22. I am genuinely pleased to read this weblog posts which
    includes plenty of helpful information, thanks for providing such statistics.

  23. Hi, i read your blog from time to time and i own a similar one and i was just wondering
    if you get a lot of spam comments? If so how do you prevent it, any plugin or anything you can advise?
    I get so much lately it’s driving me crazy so any support is very
    much appreciated.

  24. Hi there mates, how is the whole thing, and what you desire to say on the topic of
    this piece of writing, in my view its really remarkable in favor of me.

  25. Thanks for sharing your thoughts. I really appreciate your efforts and I will be waiting for your further write ups thank you once again.

  26. Howdy! Someone in my Myspace group shared this site with us so I came to look it
    over. I’m definitely loving the information. I’m bookmarking and will be tweeting this to
    my followers! Outstanding blog and outstanding design.

  27. Greetings! I know this is somewhat off topic but
    I was wondering which blog platform are you
    using for this website? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m
    looking at options for another platform. I would be awesome if
    you could point me in the direction of a good platform.

  28. It’s a pity you don’t have a donate button! I’d definitely donate to this excellent blog!
    I guess for now i’ll settle for bookmarking and adding your
    RSS feed to my Google account. I look forward to fresh updates and will share this website with my Facebook
    group. Chat soon!

  29. Hmm is anyone else having problems with the pictures on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.

    Any feedback would be greatly appreciated.

  30. Hello i am kavin, its my first time to commenting anywhere, when i read this
    paragraph i thought i could also make comment due
    to this brilliant article.

  31. I am really enjoying the theme/design of your weblog. Do you ever
    run into any web browser compatibility problems? A few of my blog
    readers have complained about my site not
    operating correctly in Explorer but looks great in Firefox.
    Do you have any advice to help fix this problem?

  32. May I simply just say what a comfort to uncover somebody that actually understands what
    they are discussing over the internet. You actually realize
    how to bring an issue to light and make it important.
    More and more people must check this out and
    understand this side of your story. I was surprised
    that you aren’t more popular given that you certainly have the gift.

  33. I do not even know how I stopped up right here, but I
    believed this publish was once great. I don’t know who you are however definitely you’re going to a famous blogger in the event you
    aren’t already. Cheers!

  34. I have to thank you for the efforts you’ve put in penning this site.

    I’m hoping to view the same high-grade blog posts from you later on as well.
    In fact, your creative writing abilities has encouraged me to get my very own blog now 😉

Comments are closed.