First, write the data in a csv file. Then you can use the pandas data frame to calculate the difference. Refer to the below code:
import pandas as pd
pd.read_csv("names.csv")
df_test['Difference'] = (df_test['CloseDate'] - df_test['SubmittedDate']).dt.days