Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pylint:disable=W0621
- #pylint:disable=W0312
- balance = 100
- addCredit = input("How much credit do you want to add?\n")
- addCredit = int(addCredit)
- def Credit():
- global updatedCredit
- updatedCredit = balance + addCredit
- # I know it will work if added below the var: addCredit,
- # but its not always possible in long functions.
- return updatedCredit
- Credit()
- ### either print... ### doesnt work without global
- print(updatedCredit, "SUCCESS")
- ### or use in a new function.. ### Doesnt work without global either.
- def loanCredit():
- if updatedCredit < 200:
- updatedCredit =+ 200
- else:
- return
- print(updatedCredit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement