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. I wanted to thank you for this excellent read!! I absolutely enjoyed every little bit of it.
    I have got you book marked to look at new things you post…

  2. I’m really enjoying the design and layout of your website.
    It’s a very easy on the eyes which makes it
    much more pleasant for me to come here and visit more often. Did
    you hire out a designer to create your theme? Outstanding work!

  3. Great blog here! Also your website loads up fast!
    What web host are you using? Can I get your affiliate
    link to your host? I wish my web site loaded up as fast as
    yours lol

  4. Thank you so much for giving us an update on this subject
    matter on your web site. Please be aware that if a completely new post becomes available or in case
    any improvements occur about the current publication, I would want to consider reading a lot more and focusing on how to make good use of those methods you talk about.

    Thanks for your efforts and consideration of other individuals by making
    your blog available.

    my site: beautiful smooth skin

  5. Thanks for your marvelous posting! I actually enjoyed reading it, you can be
    a great author.I will always bookmark your blog and may come back later on. I want to encourage
    you to ultimately continue your great job, have a nice weekend!

  6. Hey there! I understand this is sort of off-topic but I needed to ask.
    Does building a well-established blog like yours require a massive amount work?

    I’m brand new to running a blog however I do write in my diary everyday.
    I’d like to start a blog so I can easily share my experience and views online.
    Please let me know if you have any kind of ideas or tips for brand
    new aspiring blog owners. Appreciate it!

  7. Howdy! Would you mind if I share your blog with my twitter group?
    There’s a lot of folks that I think would really enjoy your content.
    Please let me know. Many thanks

  8. Hi there! I could have sworn I’ve visited this site before but after looking at
    many of the articles I realized it’s new to me.
    Anyways, I’m definitely delighted I found it and I’ll
    be bookmarking it and checking back often!

  9. Have you ever considered about adding a little bit more than just your
    articles? I mean, what you say is fundamental and everything.

    Nevertheless think of if you added some great photos or videos to give your posts more, “pop”!
    Your content is excellent but with images and video clips,
    this site could definitely be one of the very best in its
    field. Great blog!

  10. Hello! I know this is kinda off topic however I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest writing a blog article 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 might be interested feel free to send me
    an email. I look forward to hearing from you! Awesome blog
    by the way!

  11. you’re actually a excellent webmaster. The website loading speed is incredible.

    It kind of feels that you are doing any distinctive trick.
    Also, The contents are masterpiece. you’ve performed a magnificent task in this subject!

  12. Hi, I do believe this is an excellent web site. I stumbledupon it 😉 I may revisit yet again since i have book marked it.

    Money and freedom is the best way to change, may you be rich and continue to guide others.

  13. Terrific post but I was wanting to know if you could write a litte more on this subject?
    I’d be very thankful if you could elaborate a little bit further.
    Appreciate it!

  14. hello!,I like your writing very a lot! share we
    keep in touch extra approximately your post on AOL? I need a specialist on this house to unravel my
    problem. May be that’s you! Taking a look forward to see you.

  15. This is the right webpage for anybody who hopes to understand this topic.
    You know so much its almost hard to argue with you (not that I really will need to…HaHa).

    You certainly put a new spin on a subject that’s been written about for decades.
    Wonderful stuff, just great!

    Also visit my web-site same size

  16. Thanks for your personal marvelous posting! I quite enjoyed reading it, you can be a great author.I will make sure to
    bookmark your blog and will eventually come back from now on. I want to encourage continue your great
    job, have a nice morning!

  17. Great beat ! I wish to apprentice while you amend your web
    site, how could i subscribe for a weblog website?
    The account aided me a applicable deal. I had been tiny bit
    acquainted of this your broadcast offered bright transparent idea

  18. Everything is very open with a clear description of the issues.
    It was truly informative. Your site is very helpful.
    Thanks for sharing!

  19. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time
    a comment is added I get several e-mails with the same comment.
    Is there any way you can remove me from that service? Thanks!

  20. What i don’t realize is actually how you’re now not actually a lot more well-favored than you might be now.
    You’re so intelligent. You recognize thus significantly on the subject of this subject, made me personally believe it
    from a lot of numerous angles. Its like men and women are not interested unless it’s something to accomplish with Lady gaga!
    Your individual stuffs outstanding. At all times
    care for it up!

  21. Excellent beat ! I would like to apprentice while you amend your web site, how can i subscribe for a blog site?
    The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright
    clear idea

  22. When I originally left a comment I seem to have clicked the
    -Notify me when new comments are added- checkbox and from now on whenever a comment is
    added I receive 4 emails with the same comment.

    Is there an easy method you are able to remove me from that
    service? Cheers!

  23. Hi there everyone, it’s my first go to see at this website, and
    article is truly fruitful in support of me, keep up posting these types of articles or reviews.

  24. I simply could not leave your site before suggesting that I actually loved the usual info an individual supply on your guests?
    Is gonna be again ceaselessly to investigate cross-check new posts

  25. Great article! That is the kind of info that are meant to be shared around the net.
    Disgrace on Google for no longer positioning this post higher!
    Come on over and visit my website . Thank you =)

  26. Good day! This post couldn’t be written any better!
    Reading this post reminds me of my previous room
    mate! He always kept chatting about this. I will forward this write-up to him.

    Pretty sure he will have a good read. Thanks for sharing!

  27. Please let me know if you’re looking for a writer
    for your blog. You have some really great posts and I
    feel I would be a good asset. If you ever want to take
    some of the load off, I’d really like to write some
    articles for your blog in exchange for a link back to mine.

    Please shoot me an e-mail if interested. Regards!

  28. Sweet blog! I found it while browsing 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!
    Thank you

  29. I’m amazed, I must say. Seldom do I encounter a blog that’s both equally educative and interesting, and let me tell you, you have hit the nail on the head.
    The issue is something too few folks are speaking intelligently
    about. I’m very happy that I stumbled across this during my hunt
    for something relating to this.

  30. hello!,I like your writing very much! percentage we be in contact extra about your article on AOL?
    I require a specialist in this area to solve my problem.
    May be that is you! Taking a look ahead to look you.

  31. Excellent post. Keep writing such kind of information on your blog.

    Im really impressed by it.
    Hey there, You have performed an incredible
    job. I will certainly digg it and personally suggest to my friends.

    I am confident they’ll be benefited from this web site.

Comments are closed.