Advertisement
CheeseTown

Untitled

Oct 18th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import pylab
  2. print("Skriv stop for Ć„ avslutte")
  3. stop = 0
  4.  
  5. def terning():
  6. SUM = 0
  7. kast = int(input("Hvor mange terninger vil du kaste? "))
  8. while kast > 0 :
  9. SUM += pylab.randint(0,6)
  10. kast -= 1
  11. print("Summen ble: ", SUM)
  12.  
  13. while stop == 0:
  14. terning()
  15. print("Vil du kaste pƄ nytt? (stop for nei og hva som helst for fortsette)")
  16. INPUT = str(input("Skriv her: "))
  17. if INPUT == stop:
  18. stop = 1
  19.  
  20. else:
  21. stop = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement