Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #created by David Currey
- #created in september 2016
- #created for ics3u
- #this is the global variable program
- import ui
- variableX = 25
- def local_button_touch_up_inside(sender):
- # shows what happen with local variable
- variableX = 10
- variableY = 30
- variableZ = variableX + variableY
- view['local_answer_label'].text = str(variableZ)
- def global_button_touch_up_inside(sender):
- # shows what happen with global variable
- #global variableX
- #variableX = variableX + 1
- variableY = 30
- variableZ = variableX + variableY
- view['global_answer_label'].text = str(variableZ)
- view = ui.load_view()
- view.present('full_screen')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement