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. Hiya! I know this is kinda off topic however , I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest authoring a blog post or
    vice-versa? My site goes over a lot of the same subjects as yours and I believe we could greatly benefit from each other.
    If you are interested feel free to send me an email.
    I look forward to hearing from you! Wonderful blog by the way!

  2. We are a group of volunteers and opening a new scheme in our community.
    Your site offered us with valuable information to work on. You have done an impressive job and our entire community will
    be thankful to you.

  3. Hi there! Quick question that’s completely off topic. Do you know how to make your site mobile
    friendly? My site looks weird when browsing from my iphone.
    I’m trying to find a template or plugin that might be able to resolve this issue.
    If you have any suggestions, please share. Thank you!

  4. Spot on with this write-up, I honestly believe
    that this amazing site needs far more attention. I’ll probably be
    back again to read through more, thanks for the information!

  5. Hello! I know this is kinda off topic nevertheless I’d
    figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog
    post or vice-versa? My site covers a lot of the same subjects as yours
    and I believe we could greatly benefit from each other. If you might be interested feel free to shoot me an e-mail.
    I look forward to hearing from you! Great blog
    by the way!

  6. This design is wicked! You certainly know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job.
    I really loved what you had to say, and more than that, how you presented
    it. Too cool!

  7. Magnificent beat ! I wish to apprentice while you amend your web site, how could i subscribe for a blog site?
    The account helped me a acceptable deal. I were a little bit
    familiar of this your broadcast provided vibrant transparent concept

  8. Hey there! This post couldn’t be written any better!

    Reading this post reminds me of my good old room mate! He
    always kept talking about this. I will forward this post to him.
    Fairly certain he will have a good read. Thank you for sharing!

  9. I’m extremely inspired along with your writing skills and also with the format to your
    blog. Is this a paid topic or did you customize it yourself?
    Either way keep up the nice high quality writing, it is uncommon to peer a great blog like this one today..

  10. Its like you read my mind! You seem to know so much approximately this, such as
    you wrote the guide in it or something. I believe that you could do with some
    % to force the message home a little bit, but other than that, that is magnificent blog.
    A fantastic read. I will certainly be back.

  11. Hello this is somewhat 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 expertise so I wanted to get advice from someone with experience.
    Any help would be greatly appreciated!

  12. Somebody necessarily help to make severely articles I’d state.
    That is the first time I frequented your web page and so far?
    I surprised with the analysis you made to make this particular post incredible.
    Great task!

  13. Excellent post. I used to be checking constantly this weblog and I am inspired!
    Extremely useful info particularly the final section 🙂 I care
    for such information a lot. I used to be seeking this certain info for
    a long time. Thank you and good luck.

  14. I know this if off topic but I’m looking into starting my own blog and
    was wondering what all is needed to get setup? I’m assuming having a blog like yours would cost
    a pretty penny? I’m not very web savvy so I’m not 100% sure.
    Any tips or advice would be greatly appreciated. Thanks

  15. Simply wish to say your article is as surprising. The clarity in your
    post is just nice and i could suppose you’re a professional on this
    subject. Well along with your permission let me
    to grasp your feed to keep updated with imminent post. Thanks a million and please continue the
    rewarding work.

  16. Have you ever considered creating an e-book or guest authoring on other websites?
    I have a blog centered on the same subjects you discuss and
    would love to have you share some stories/information. I know my viewers would appreciate your work.
    If you’re even remotely interested, feel free to shoot me an e mail.

  17. Hi just wanted to give you a quick heads up
    and let you know a few of the pictures aren’t loading properly.
    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different browsers and both show the same results.

  18. My partner and I absolutely love your blog and find almost all of your post’s to be exactly what I’m looking for.

    Would you offer guest writers to write content available for you?
    I wouldn’t mind writing a post or elaborating on many of the subjects you write about here.
    Again, awesome web log!

  19. I think this is among the most vital info for me. And i am
    glad reading your article. But want to remark on few
    general things, The site style is wonderful, the articles is really excellent :
    D. Good job, cheers

  20. Good day! 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 points or suggestions?

    With thanks

  21. Hey there, You’ve done a great job. I’ll definitely digg it and
    personally suggest to my friends. I am confident they will be benefited from this website.

  22. Hey there! I know this is kinda off topic however , I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest authoring a
    blog article or vice-versa? My website discusses a lot of the same subjects as yours
    and I feel we could greatly benefit from each other.
    If you’re interested feel free to send me an e-mail. I look forward to
    hearing from you! Fantastic blog by the way!

  23. I’ve been surfing online more than 3 hours these days, but I by no
    means discovered any fascinating article like yours.
    It is lovely value enough for me. Personally, if all webmasters and bloggers made good content as you probably did, the
    internet will probably be much more helpful than ever before.

  24. What i don’t realize is if truth be told how you are not actually a lot more well-favored than you may be right now.
    You are very intelligent. You already know therefore
    significantly with regards to this subject, produced me
    personally consider it from a lot of various angles.

    Its like women and men don’t seem to be interested except it’s something to do with
    Girl gaga! Your individual stuffs great. All the time deal with it up!

Comments are closed.