I’ve tried to figure this out on my own, but I’m coming to a dead end. I’m trying to return a string from a function that I created that references amounts derived from a pandas dataframe that was created earlier in the function, and I want each variable reference to be shown as it’s own line as the output:
net_winnings = all_invest_df['Payout'].sum()-all_invest_df['Investment'].sum()
return f"""Invested Amount: {all_invest_df['Investment'].sum()}
Payout Amount: {all_invest_df['Payout'].sum()}
Net Winnings: {net_winnings}"""
What I want to see is:
Invested Amount: xxxxx
Payout Amount: xxxxx
Net Winnings: xxxxx
But this is my current output:
‘Invested Amount: 20680n Payout Amount: 25442.31574810885n Net Winnings: 4762.315748108849’
Any ideas for out to fix this would be appreciated. Thanks.