How to store ratios for fundamental data.

I am trying to compute various ratios using fundamental data. For this I will be using a dictionary to store the values thereafter but I am unable to compute the ratios or the mathematical expression (as I am planning to make it more complex if this works). But it gives me an error saying :
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

for this line of code ---> ad_ratio = (assets/debt)

sec_dict = {}
for stock in fundamental_df:
sector = fundamental_df[stock]['morningstar_sector_code']
assets = fundamental_df[stock]['net_assets']
debt = fundamental_df[stock]['net_debt']

That error, TypeError: unsupported operand type(s) for /: 'NoneType' and 'float', shows that it is trying to divide a variable of no type (NoneType) with a float (which is a precise number, for example 5.674). This means that, at some point when you start running your algorithm, assets is of type None, meaning it is not a defined number.
You will want to check that assets (and anything else) are defined. You could do this with if assets is not None:, for example. Good luck!