Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #created by David Currey
  2. #created in september 2016
  3. #created for ics3u
  4. #this is the global variable program
  5.  
  6. import ui
  7.  
  8. variableX = 25
  9.  
  10. def local_button_touch_up_inside(sender):
  11. # shows what happen with local variable
  12.  
  13. variableX = 10
  14. variableY = 30
  15. variableZ = variableX + variableY
  16.  
  17. view['local_answer_label'].text = str(variableZ)
  18.  
  19. def global_button_touch_up_inside(sender):
  20. # shows what happen with global variable
  21.  
  22. #global variableX
  23. #variableX = variableX + 1
  24. variableY = 30
  25. variableZ = variableX + variableY
  26.  
  27. view['global_answer_label'].text = str(variableZ)
  28.  
  29. view = ui.load_view()
  30. view.present('full_screen')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement