Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. print "Let's practice everything."
  2. print "You\'d need to know \' bouth esacape with \\ that do \n newline and \t tabs."
  3.  
  4. poem = """
  5. \t The lovely world
  6. with logic so firmly planted
  7. cannot discert \n the needs of love
  8. nor comprehend passion from intuilion
  9. and requires an explonantion
  10. \n\t\t there is none
  11. """
  12. print "_ _ _ _ _ _ _ _ "
  13. print poem
  14. print "_ _ _ _ _ _ _ _ "
  15.  
  16. five = 10 -2 +3 - 6
  17. print "This should be five: %s" % five
  18. def secret_formula(started):
  19.     jelly_beans = started * 500
  20.     jars = jelly_beans / 1000
  21.     crates = jars / 100
  22.     return jelly_beans, jars, crates
  23.  
  24. start_point = 10000
  25. beans, jars, crates = secret_formula(start_point)
  26.  
  27. print "With a starting point of : %d " % start_point
  28. print "We'd have %d beans, %d jars, and %d crates." %(beans, jars, crates)
  29.  
  30. start_point = start_point / 10
  31. print "We can also do that this way:"
  32. print "We'd have %d beans, %d jars, and %d crates." % secret_formula(start_point)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement