Advertisement
dvdjaco

6.1

Feb 18th, 2012
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. # #!/usr/bin/python
  2. #
  3. # By dvdjaco
  4. # Exercise 6.1
  5. #
  6. # Write a while loop that starts at the last character in the string and works its way backwards to the first character in the string, printing each letter on a separate line, except backwards.
  7.  
  8. word = 'backwards'
  9. i = len(word) - 1
  10. while i >= 0:
  11.     print word[i]
  12.     i = i - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement