Advertisement
Guest User

Untitled

a guest
Jul 12th, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # as input a positive whole number, and prints
  2. # out all the whole numbers from 1 to the input
  3. # number.
  4.  
  5. # Make sure your procedure prints "upwards", so
  6. # from 1 up to the input number.
  7.  
  8.  
  9. def print_numbers(x):
  10. while x>0:
  11. x=x-1
  12. return x
  13. return x
  14. print print_numbers(3)
  15.  
  16.  
  17.  
  18.  
  19.  
  20. #print_numbers(3)
  21. #>>> 1
  22. #>>> 2
  23. #>>> 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement