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.

16,631 thoughts on “Contoh Soal Pemrograman – Pola Segitiga Siku-siku

  1. Hello, i think that i saw you visited my weblog so i came to “return the favor”.I’m trying to find things to
    improve my site!I suppose its ok to use some of your ideas!!

  2. Hi there! 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 useful information to work on. You have done a marvellous
    job!

  3. This is the right site for everyone who wants to find out about this topic.
    You know a whole lot its almost tough to argue with you (not that
    I personally will need to…HaHa). You definitely put a new spin on a topic which has been discussed for ages.
    Great stuff, just excellent!

  4. It’s remarkable to pay a visit this web page and reading the views of all friends regarding
    this article, while I am also zealous of getting know-how.

  5. I’ve been browsing online more than three hours today, yet I never
    found any interesting article like yours.
    It’s pretty worth enough for me. In my view, if all
    web owners and bloggers made good content as you did,
    the internet will be much more useful than ever before.

  6. Admiring the dedication you put into your site and in depth information you provide.
    It’s great to come across a blog every once
    in a while that isn’t the same out of date rehashed material.
    Fantastic read! I’ve saved your site and I’m including your RSS feeds to my Google account.

  7. Fine way of explaining, and pleasant post to take data on the topic of my presentation topic,
    which i am going to deliver in institution of higher education.

  8. I’m impressed, I have to admit. Rarely do I encounter a blog that’s both equally educative and interesting,
    and without a doubt, you’ve hit the nail on the head.

    The issue is something too few people are speaking intelligently about.
    I’m very happy I stumbled across this during my search for
    something regarding this.

  9. It’s a shame you don’t have a donate button! I’d certainly donate to this outstanding
    blog! I suppose for now i’ll settle for bookmarking and adding your RSS
    feed to my Google account. I look forward to new updates and will share this site with
    my Facebook group. Talk soon!

  10. Hi there! I could have sworn I’ve been to this blog before but after browsing through
    some of the post I realized it’s new to me. Anyways,
    I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

  11. Hello mates, how is the whole thing, and what you want to say on the topic of
    this paragraph, in my view its actually amazing for me.

  12. What’s Taking place i’m new to this, I stumbled upon this I have found It positively useful and
    it has aided me out loads. I’m hoping to give a contribution & aid other customers like its
    aided me. Good job.

  13. 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 comments?
    If so how do you prevent it, any plugin or anything you can recommend?
    I get so much lately it’s driving me mad so any assistance is very much appreciated.

  14. Very nice post. I just stumbled upon your weblog and wanted to say
    that I have truly enjoyed browsing your blog posts.
    After all I will be subscribing to your feed and I hope you write again very soon!

  15. Heya i am for the first time here. I found this board and I
    find It truly useful & it helped me out much.
    I hope to give something back and aid others like you helped me.

  16. Hello, I think your web site could be having internet browser compatibility problems.
    When I look at your site in Safari, it looks fine however,
    if opening in Internet Explorer, it’s got some overlapping
    issues. I just wanted to give you a quick heads up!
    Apart from that, great site!

  17. I’m impressed, I must say. Rarely do I come across a blog that’s both educative
    and amusing, and let me tell you, you have hit the nail on the
    head. The issue is something that not enough men and
    women are speaking intelligently about. Now i’m very happy that I came across this during my search for something relating to this.

  18. It’s the best time to make a few plans for
    the long run and it is time to be happy. I have read this put up
    and if I may I want to suggest you some attention-grabbing
    issues or advice. Maybe you can write subsequent articles regarding
    this article. I wish to learn more things about it!

  19. What i don’t understood is if truth be told how you are not actually much more well-favored than you might
    be right now. You’re very intelligent. You already know therefore considerably in the case
    of this matter, produced me individually consider it from so many various
    angles. Its like men and women don’t seem to be involved except it is something to do with Woman gaga!
    Your individual stuffs outstanding. At all times deal with it up!

  20. Hey there! I could have sworn I’ve been to this blog before but after reading through some of the
    post I realized it’s new to me. Anyhow, I’m definitely glad
    I found it and I’ll be book-marking and checking back often!

  21. You ought to be a part of a contest for one of the greatest sites online.

    I most certainly will highly recommend this site!

  22. I’ve been surfing online greater than three hours today, yet I by no means discovered any fascinating article
    like yours. It is lovely price enough for me. In my opinion, if all webmasters and bloggers made just right content material as you probably
    did, the internet can be much more useful than ever before.

  23. A person necessarily assist to make seriously posts I would state.
    That is the very first time I frequented your web page and
    up to now? I surprised with the analysis you made
    to make this actual put up incredible. Magnificent task!

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

  25. I think this is one of the such a lot significant info for me.
    And i am glad reading your article. However wanna statement on few general things, The site style is
    ideal, the articles is truly great : D. Just right process, cheers

  26. Hi all, here every one is sharing such familiarity,
    so it’s good to read this webpage, and I used to go to see
    this blog everyday.

Comments are closed.