brewersfan1976

ch2-ex5.py

Jul 3rd, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. userInput = raw_input("Please enter a sentence:")
  2. print
  3. print
  4. column1 = "word"
  5. column2 = "reversed"
  6.  
  7. print column1.ljust(20), column2.ljust(20)
  8.  
  9. column1 = "----"
  10. column2 = "--------"
  11.  
  12. print column1.ljust(20), column2.ljust(20)
  13.  
  14. for w in userInput.split():
  15.     print "%-20s" % w,
  16.     print "%-20s" % w[::-1]
Advertisement
Add Comment
Please, Sign In to add comment