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. Your style is so unique compared to other people I’ve read stuff from.

    Many thanks for posting when you’ve got the opportunity, Guess I’ll
    just bookmark this web site.

  2. Great beat ! I would like to apprentice while you amend your website, how can i
    subscribe for a blog site? The account aided me a acceptable deal.

    I had been a little bit acquainted of this your broadcast offered bright
    clear idea

  3. wonderful points altogether, you just received a new reader.
    What might you suggest in regards to your submit that you
    just made a few days in the past? Any positive?

  4. Hello there! This is kind of off topic but I need some help from an established
    blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out
    pretty quick. I’m thinking about setting up my own but I’m not
    sure where to start. Do you have any ideas
    or suggestions? Thank you

  5. I love what you guys tend to be up too. This type of clever work and exposure!
    Keep up the very good works guys I’ve you guys to my personal blogroll.

  6. I do accept as true with all the ideas you’ve introduced on your
    post. They are very convincing and will certainly work. Still,
    the posts are very short for starters. May just you please lengthen them a
    bit from subsequent time? Thanks for the post.

  7. It’s appropriate time to make a few plans for the long run and it is time to be happy.
    I have read this submit and if I may just I want to recommend you
    few fascinating things or advice. Perhaps you can write subsequent articles relating to this article.
    I wish to read even more issues about it!

  8. I’m really impressed with your writing skills as
    well as with the layout on your blog. Is this a paid theme or did you
    modify it yourself? Either way keep up the nice quality writing, it is rare to see a
    great blog like this one today.

  9. Hi Dear, are you in fact visiting this site on a regular basis, if so after that you will without doubt get pleasant experience.

  10. Excellent pieces. Keep posting such kind of info on your
    page. Im really impressed by your site.
    Hey there, You’ve done a great job. I’ll certainly digg it and in my view
    recommend to my friends. I am sure they will be benefited from
    this web site.

  11. Greetings! This is my first visit to your blog!
    We are a group of volunteers and starting a new project in a
    community in the same niche. Your blog provided us
    valuable information to work on. You have done a extraordinary job!

  12. Wonderful blog! I found it while searching 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!
    Appreciate it

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

  14. Thanks for your marvelous posting! I truly enjoyed reading it, you may be a great author.I will always bookmark your blog and may come back in the future.
    I want to encourage one to continue your great work, have
    a nice holiday weekend!

  15. Greate pieces. Keep posting such kind of information on your site.
    Im really impressed by your blog.
    Hello there, You’ve done a great job. I’ll certainly digg
    it and for my part recommend to my friends. I’m confident they’ll be benefited from this web site.

  16. I think what you posted made a lot of sense. But, what about this?
    what if you were to write a awesome title? I mean,
    I don’t want to tell you how to run your blog, however what if you added something that makes people
    desire more? I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku
    – Umar faisol is a little boring. You ought to look at Yahoo’s front page and see how
    they create news headlines to grab viewers to click. You might add a related video or a related pic or two to grab people interested about everything’ve written. Just
    my opinion, it might make your blog a little livelier.

  17. Hey just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Ie.
    I’m not sure if this is a format issue or something to do with web browser compatibility
    but I thought I’d post to let you know. The layout look great though!

    Hope you get the problem resolved soon. Many thanks

  18. all the time i used to read smaller content which as
    well clear their motive, and that is also happening with this
    article which I am reading here.

  19. I’m curious to find out what blog system you’re working with?

    I’m experiencing some small security problems with my
    latest blog and I’d like to find something more safeguarded.
    Do you have any suggestions?

  20. Pretty section of content. I just stumbled upon your web site
    and in accession capital to assert that I acquire in fact enjoyed account your blog posts.
    Anyway I will be subscribing to your feeds and even I achievement you access consistently fast.

  21. I think that everything typed was actually very logical.

    However, think about this, suppose you composed a
    catchier post title? I am not suggesting your content is not solid, but suppose you added a headline that makes people want more?
    I mean Contoh Soal Pemrograman – Pola Segitiga Siku-siku –
    Umar faisol is a little vanilla. You might peek at Yahoo’s front
    page and see how they write post headlines to grab people to open the
    links. You might add a video or a related picture or two to get people interested
    about what you’ve written. Just my opinion,
    it would make your posts a little livelier.

  22. 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 throw away your intelligence on just posting
    videos to your blog when you could be giving
    us something enlightening to read?

  23. This is really attention-grabbing, You are an overly professional blogger.
    I’ve joined your rss feed and look ahead to seeking more of your wonderful post.
    Additionally, I have shared your website in my social networks

Comments are closed.