Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # The name of this file is python-module.py .
- # To use Calculator class or hello_world function from other files, call import module (without py extension)
- # Calculator class
- class Calculator:
- def __init__(self):
- self.current = 0
- def add(self, amount):
- self.current += amount
- def get_current(self):
- return self.current
- # Stand alone function
- def hello_world(name):
- print("Hello, World! My name is %s" % name)
Add Comment
Please, Sign In to add comment