Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. # definialjuk a sajtot es a kekszet szamolo programot nagyon fontos a cheese_and_crackers az viszi vegig a z egesz definialasat
  2. def cheese_and_crackers(cheese_count, boxes_of_crackers):
  3. print "You have %d cheeses!" %cheese_count
  4. print "You have %d boxes of crackers!" % boxes_of_crackers
  5. print "Man that's enough for a party!"
  6. #uj line
  7. print "Get a blanket.\n"
  8.  
  9.  
  10.  
  11. print "We can just give the function number direclty:"
  12. #a szamuk a sajtnak meg a keksznek
  13. cheese_and_crackers(20, 30)
  14. #nagyon rövid ut.
  15. print "OR, we can use variables from our script:"
  16. amount_of_cheese = 10
  17. amount_of_crackers = 50
  18. #ertem. a szamok beilsztese
  19. cheese_and_crackers(amount_of_cheese, amount_of_crackers)
  20.  
  21. # matek reseze
  22. print "We can even do math inside too:"
  23. cheese_and_crackers(10 + 20, 5 + 6)
  24.  
  25. #vagy csak beirunk igy szepen nem nagyon erdekes
  26. print "And we can combine the two, variables and math:"
  27. cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers + 1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement