Program Pattern Using 'While' in Python
Hello world!
In this post, I'll write how to make a simple pattern using Python.
Yaaap. Here we go! X)
PS: I am using an online compiler, Ideone.
Now, lemme give you my screenshot, so you can see like what I'm typing this code.
Horay! We did it! \(^o^)/
And yes! you can modification this code to be something new different.
Thank you! XOXO
In this post, I'll write how to make a simple pattern using Python.
Yaaap. Here we go! X)
angka1 = 5string = ""while angka1 > 0:angka2 = angka1while angka2 > 0:string = string + "*"angka2 = angka2 - 1string = string + "\n"angka1 = angka1 - 1print string
Now, lemme give you my screenshot, so you can see like what I'm typing this code.
And....THIS IS IT!
Horay! We did it! \(^o^)/
And yes! you can modification this code to be something new different.
Thank you! XOXO
wah sangat bermanfaat, terimakasih sudah berbagi
ReplyDelete