Monday, 15 September 2014

Loops

We made IDLE do 50 lines of I love computer science. using a while loop:
lines=0
while lines<50:
print ("i love computer science")
lines = lines+1

You can also use:
print("i love computer science.\n" *50)
Or:
Lines=50
while line>1:
print ("i love computer science")
lines=lines-1



No comments:

Post a Comment