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 for … in.
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.
Remarkable! Its actually amazing post, I have got much clear idea about from this post.
There is certainly a great deal to find out about this subject.
I love all the points you have made.
Today, while I was at work, my cousin stole my apple ipad and tested to see if it
can survive a thirty foot drop, just so she can be a youtube sensation. My
iPad is now broken and she has 83 views. I know this is entirely off topic but
I had to share it with someone!
It’s a shame you don’t have a donate button! I’d most certainly donate to this brilliant
blog! I suppose for now i’ll settle for book-marking
and adding your RSS feed to my Google account.
I look forward to new updates and will share this site
with my Facebook group. Chat soon!
This is a topic that is close to my heart…
Cheers! Exactly where are your contact details though?
Why visitors still use to read news papers when in this technological world all is available on web?
I like it when people get together and share thoughts.
Great site, continue the good work!
I am truly grateful to the holder of this site who has shared
this wonderful article at at this place.
Appreciate the recommendation. Will try it out.
Hello, i believe that i saw you visited my site thus i came to return the favor?.I’m trying to
find issues to enhance my site!I suppose its adequate to make
use of a few of your ideas!!
Great blog! Do you have any tips and hints for aspiring writers?
I’m hoping to start my own site soon but I’m a little lost on everything.
Would you propose starting with a free platform like WordPress or go for a
paid option? There are so many options out there that I’m completely confused ..
Any recommendations? Bless you!
I have fun with, cause I found just what I
used to be having a look for. You have ended my four day lengthy hunt!
God Bless you man. Have a great day. Bye
Highly energetic article, I liked that a lot.
Will there be a part 2?
I’ve been browsing online more than 3 hours today, yet I never found any interesting article
like yours. It is pretty worth enough for me. In my opinion,
if all webmasters and bloggers made good content as you did, the internet will be a lot more useful than ever before.
I am curious to find out what blog system you’re
utilizing? I’m experiencing some small security problems with my latest site and I would
like to find something more secure. Do you have any suggestions?
excellent submit, very informative. I ponder why the opposite experts of this sector do not realize
this. You should proceed your writing. I’m sure, you’ve a huge readers’ base already!
Hi there! I’m at work surfing around your blog from my new iphone 3gs!
Just wanted to say I love reading through your blog and look forward to all your posts!
Keep up the superb work!
Why people still make use of to read news papers when in this technological globe all is presented on web?
Great post.
Its such as you read my thoughts! You appear to
understand a lot about this, such as you wrote the ebook in it or something.
I feel that you could do with a few % to drive the
message home a little bit, however other than that, that is great blog.
A great read. I will definitely be back.
It’s great that you are getting ideas from this post as well as from
our dialogue made here.
It’s fantastic that you are getting thoughts from this article as
well as from our argument made at this place.
This article is truly a nice one it helps new internet visitors,
who are wishing for blogging.
Helpful info. Fortunate me I discovered your web site accidentally, and
I am stunned why this twist of fate did not took
place in advance! I bookmarked it.
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
You obviously know what youre talking about, why waste your intelligence on just posting
videos to your weblog when you could be giving us something
informative to read?
It is not my first time to go to see this site, i am visiting
this web site dailly and get pleasant facts from here all the time.
I’m amazed, I have to admit. Seldom do I encounter
a blog that’s both equally educative and engaging, and let me tell you, you’ve hit the nail on the head.
The problem is something that too few folks are
speaking intelligently about. I am very happy I came across this during my
search for something relating to this.
Appreciate this post. Will try it out.
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 waste your intelligence on just posting
videos to your weblog when you could be giving us something enlightening
to read?
Outstanding story there. What happened after?
Good luck!
It’s truly very difficult in this active life to listen news on TV, thus I simply use internet for that reason, and get the hottest news.
Excellent way of explaining, and fastidious article to get facts on the topic of my
presentation subject matter, which i am going to
convey in institution of higher education.
Hi to every , since I am actually eager of reading this blog’s post to be updated on a regular basis.
It consists of fastidious material.
A fascinating discussion is definitely worth comment.
I think that you should publish more on this issue, it may not be a taboo subject but typically folks don’t speak about such issues.
To the next! Cheers!!
Hello mates, nice article and nice urging commented at this place, I am in fact
enjoying by these.
I believe that is among the most vital information for me.
And i am satisfied reading your article. But should statement on few general things,
The site taste is perfect, the articles is actually
excellent : D. Just right job, cheers
Link exchange is nothing else except it is simply
placing the other person’s blog link on your page at suitable place and
other person will also do same in favor of you.
If some one wishes expert view on the topic of running a blog then i
suggest him/her to pay a quick visit this blog, Keep
up the fastidious work.
Hey there superb blog! Does running a blog such as this take a massive amount
work? I have very little expertise in computer programming but I had been hoping to start my own blog soon. Anyway, if you
have any recommendations or techniques for new blog owners
please share. I understand this is off topic nevertheless I just needed to
ask. Kudos!
You could definitely see your enthusiasm in the work you write.
The sector hopes for even more passionate writers like you who aren’t afraid to mention how they believe.
All the time go after your heart.
Hello mates, how is everything, and what you want to say regarding this article,
in my view its in fact amazing in favor of me.
If some one wishes expert view about blogging then i suggest him/her to
pay a quick visit this web site, Keep up the fastidious job.
Appreciation to my father who stated to
me on the topic of this web site, this web site is in fact amazing.
Hey there, I think your blog might be having browser compatibility issues.
When I look at your blog in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up!
Other then that, fantastic blog!
There is certainly a lot to know about this issue.
I like all of the points you made.
It’s truly very complicated in this active life to listen news on TV,
thus I only use the web for that reason, and get the hottest news.
I delight in, cause I discovered exactly what I was having a look for.
You have ended my 4 day long hunt! God Bless you man. Have
a great day. Bye
Hey there! Do you know if they make any plugins to safeguard against hackers?
I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?
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 three e-mails with the same comment.
Is there any way you can remove me from that service? Appreciate it!
I do not even know how I stopped up right here, however I
thought this publish used to be great. I do not know who you might be but certainly you’re going to a well-known blogger if
you are not already. Cheers!