<jupyter_start><jupyter_text>Variables:<jupyter_code>global_var = 10

class Test:
    local_var = 20
    def method(self):
        self.method_var = 30
    def instance(self,instance_var):
        print("Instance variable is:",instance_var)
ob = Test()<jupyter_output><empty_output><jupyter_text>Global variable gets printed without using class name:<jupyter_code>print(global_var)<jupyter_output>10<jupyter_text>Local Variable needs the class name:<jupyter_code>print(local_var)
print(ob.local_var)<jupyter_output>20<jupyter_text>Method variable needs the class name and the method to be executed:<jupyter_code>print(ob.method_var)
print(ob.method())
print(ob.method_var)<jupyter_output>30<jupyter_text>Instance variable needs class name, method to be executed and is created at run time:<jupyter_code>print(ob.instance_var)
print(ob.instance(40))
print(ob.instance_var)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10210876803551609, 'fraction_numerical': 0.01553829078801332, 'mean_word_length': 8.02, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '645298', 'license': 'MIT', 'n_tokens_mistral': 329, 'n_tokens_neox': 313, 'n_words': 59, 'path': 'Data-Science-HYD-2k19/Topic-Wise/OOP/BASICS/VARIABLES.ipynb', 'repo_name': 'Sanjay9921/Python', 'size': '901'}