Problem with Python code

I am getting this error I tried trouble shooting many different ways but not able to get any solution please help me:

from dhanhq import dhanhq
client_id = “hidden”
access_token = “hidden”

dhan = dhanhq(client_id,access_token)

def get_holdings(dhan):
data = dhan.get_holdings()
print(data)

get_holdings(dhan)

I am getting this error, but there is no extra indentation, also in code I have not written Dhan.getholdings() still it is showing this error

KeyboardInterrupt

get_holdings(dhan)
Traceback (most recent call last):
File “”, line 1, in
get_holdings(dhan)

~~~~~~~~~~~~^^^^^^

File “”, line 2, in get_holdings
data = dhan.getholdings()
^^^^^^^^^^^^^^^^
AttributeError: ‘dhanhq’ object has no attribute ‘getholdings’. Did you mean: ‘get_holdings’?

Hello @bhuvneshk

First of all, it is not a library or python issue. You just have to save the file and run this code again. And it should work.

I have saved the filed and then run, I am been getting same error

def get_holdings(dhan):
data = dhan.get_holdings()
print(data)

This is not indented here, making function blank.

def get_holdings(dhan):
    data = dhan.get_holdings()
    print(data)

it is indended in vs code but when I am pasting text here indentation is going away