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.
What’s up, every time i used to check webpage posts here early in the morning, since
i love to learn more and more.
If some one desires expert view on the topic of running a blog then i advise him/her to visit this web site, Keep up
the pleasant job.
Every weekend i used to visit this site, as i wish for enjoyment, since this this web site conations in fact good funny data
too.
We’re a group of volunteers and opening a new scheme in our community.
Your site provided us with valuable info to work on. You’ve done a formidable job and our whole community will be grateful to you.
I couldn’t resist commenting. Well written!
Hi! Do you use Twitter? I’d like to follow you if that would be okay.
I’m absolutely enjoying your blog and look forward to new
updates.
Hi, I do think this is a great site. I stumbledupon it 😉 I am going to come back once again since
I saved as a favorite it. Money and freedom is the best way to change, may you
be rich and continue to help others.
Hello! Do you use Twitter? I’d like to follow you if
that would be okay. I’m definitely enjoying your blog and look
forward to new posts.
I do not even know how I stopped up here, but I assumed this put up was once great.
I do not know who you are however definitely
you are going to a well-known blogger should you aren’t
already. Cheers!
fantastic points altogether, you just received a new reader.
What might you suggest about your put up that you simply made a few days in the past?
Any sure?
Today, I went to the beach front with my kids. I found a sea shell and gave it
to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.”
She put the shell to her ear and screamed. There was a hermit crab inside and
it pinched her ear. She never wants to go back!
LoL I know this is totally off topic but I had to
tell someone!
Everyone loves what you guys are usually up too. Such clever work
and coverage! Keep up the great works guys I’ve incorporated you guys to blogroll.
Incredible! This blog looks just like my old one!
It’s on a completely different subject but it has pretty much the same layout and
design. Superb choice of colors!
It’s very straightforward to find out any matter on web as compared to textbooks, as I found this article at
this site.
Hi! 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 great work!
What’s up, I log on to your new stuff daily.
Your humoristic style is witty, keep it up!
Wow! In the end I got a blog from where I be able to truly obtain helpful data regarding
my study and knowledge.
I like what you guys are up too. This kind of clever work and exposure!
Keep up the good works guys I’ve you guys to my
own blogroll.
Its like you learn my mind! You appear to grasp so much about this, such as
you wrote the e book in it or something. I feel that you can do
with some percent to force the message house a bit, however instead of that, this is magnificent blog.
A fantastic read. I’ll certainly be back.
Yes! Finally something about qx.dz169.com.
Excellent beat ! I wish to apprentice while you
amend your site, how can i subscribe for a weblog site? The account
aided me a acceptable deal. I had been a little bit acquainted of this your broadcast provided vibrant clear concept
wonderful points altogether, you simply received a new reader.
What may you recommend about your submit that you simply made a few days ago?
Any certain?
whoah this blog is fantastic i love reading your posts.
Keep up the great work! You already know, a lot of people
are hunting round for this information, you can aid them greatly.
I read this piece of writing completely about the comparison of newest and preceding technologies, it’s
remarkable article.
Wow that was odd. I just wrote an very long comment but after I clicked submit my comment didn’t appear.
Grrrr… well I’m not writing all that over again. Anyhow, just
wanted to say wonderful blog!
I like what you guys are usually up too. This type of clever work and reporting!
Keep up the great works guys I’ve added you guys to my blogroll.
I was able to find good advice from your content.
I think the admin of this web page is in fact working hard in support of his site, as here every stuff is quality based data.
Today, I went to the beach with my kids. I found a
sea shell and gave it to my 4 year old daughter and
said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this
is completely off topic but I had to tell someone!
Now I am ready to do my breakfast, once having my
breakfast coming over again to read further news.
Have you ever thought 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 visuals or video clips to give your
posts more, “pop”! Your content is excellent but with images and video
clips, this site could definitely be one of the best in its field.
Wonderful blog!
What’s up every one, here every person is sharing such familiarity, thus it’s
good to read this web site, and I used to pay a quick visit this blog all the time.
Hola! I’ve been reading your weblog for a long time now and finally got the bravery to go ahead and give you a shout out from Kingwood
Texas! Just wanted to tell you keep up the good work!
Currently it seems like BlogEngine is the top
blogging platform available right now. (from what I’ve read) Is that what you’re using
on your blog?
I think the admin of this web site is truly working hard in favor of his site,
as here every data is quality based data.
Hello there! I could have sworn I’ve been to this site before but after browsing
through some of the post I realized it’s new to me.
Nonetheless, I’m definitely glad I found it and I’ll be
bookmarking and checking back often!
Hello there, You’ve done an incredible job. I’ll definitely digg it
and personally recommend to my friends. I’m sure they’ll
be benefited from this web site.
Amazing! Its in fact amazing piece of writing, I have got much
clear idea regarding from this post.
This text is priceless. When can I find out more?
Aw, this was an exceptionally good post. Finding the time and actual effort to make a top notch article…
but what can I say… I procrastinate a lot and don’t seem to get anything done.
I like the valuable info you supply for your articles.
I will bookmark your weblog and check again right here regularly.
I’m rather certain I’ll learn lots of new stuff proper
here! Good luck for the following!
Hi to every one, the contents existing at this site are actually remarkable
for people knowledge, well, keep up the good work fellows.
Here is my web-site: pg soft slots demo
Hello! I just wanted to ask if you ever have any
problems with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due
to no data backup. Do you have any methods to stop hackers?
This piece of writing will assist the internet people for building up new webpage or even a weblog from start to end.
Hi! Do you know if they make any plugins to protect against hackers?
I’m kinda paranoid about losing everything I’ve
worked hard on. Any recommendations?
It’s an remarkable paragraph in support of all the online people;
they will obtain benefit from it I am sure.
This post will help the internet people for building up new
web site or even a blog from start to end.
For the reason that the admin of this web page is
working, no doubt very shortly it will be renowned, due
to its feature contents.
Hello, this weekend is fastidious for me, as this moment i am reading this fantastic informative paragraph here at my house.
I do not even know the way I finished up here, but I believed this post was once good.
I do not recognize who you might be however definitely you are
going to a famous blogger if you happen to are
not already. Cheers!