Tom_Jung

Untitled

Feb 14th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. # counting using a for loop & range(xx, yy)
  2. # Notice what numbers are printed (1 to 10).
  3. for number in range(1,11):
  4. print(number)
  5.  
  6.  
  7.  
  8. #A good example of Counting using a while loop:
  9. # Notice the numbers printed(0 to 9).
  10.  
  11. count = 0
  12.  
  13. while count < 10:
  14. print("Count is: ", count)
  15. count = count + 1
Advertisement
Add Comment
Please, Sign In to add comment