I'm new to object oriented in Python, I'm a bit confused on how to work with object oriented.

```
class Beta(object):
    def __init__(self,message='defualt msg'):
        self.message = message

    def foo(self):
        return self.message
    def main():
        beta1 = Beta()
        messege = beta1.foo()

    if __name__ == '__main__':
        main()

```

The following code returns the following error `NameError: name 'Beta' is not defined` but the following code work:

```
    from time import sleep

    def foo(data):
        print("Beginning data processing...")
        modified_data = data + " that has been modified"
        sleep(3)
        print("Data processing finished.")
        return modified_data

    def main():
        data = "My data read from the Web"
        print(data)
        modified_data = foo(data)
        print(modified_data)

    if __name__ == "__main__":
        main()

```

The only difference is the class can we create an object inside the main or call the functions from the main directly or we need to explicitly create an object outside the class.

In Java or C# we can use the class name in any class function to call for another functions, while in Python this is not working this is a script that generated the same error.

```
    class Test():
    def foo() :
        print('Hello ')

    def bar():
        foo()
        print('world')
    def run():
        test = Test()
        test.bar()

    run()

```