#%% Importing Modules

import pandas as pd

#%% Sample DataFrame

df = pd.DataFrame({
    'first_name': ['alice','bob','charlie','daisy'],
    'last_name':['smith','jones','joneson','white'],
    'age': [25,20,30,35]})

#%% Method 1 : Long and Slow

emptyList = []

for colName in df.columns.values: 

    emptyList2 = []

    for index, row in df.iterrows():

        if len(str(row[colName])) != None:
            charLength = len(str(row[colName]))
        else:
            charLength = 0

        emptyList2.append(charLength)
    
    emptyList.append((colName,max(emptyList2)))
    

maxChar = dict(emptyList)

#%% Method 1 : Short and Fast

maxChar = [(colName, df[colName].apply(lambda x: len(str(x)) if x!=None else 0).max())for colName in df.columns.values]