I need to iterate in a function for 3 accounts and print each account[i]
months_subscribed = input() acct = ["Account 1", "Account 2", "Account 3"] account = [] def summary_months_sub(): # acct = ["Account 1", "Account 2", "Account 3"] mostEarned = 0.0 combined = 0.0 month_subscribed = int(input()) if month_subscribed < 3: a1_month2_sub = month_subscribed * 7 else: remain = month_subscribed % 3 a1_month2_sub = month_subscribed * 6 + remain a1_ad_free = float(input()) * 2 a1_vod = float(input()) * 27.99 a1_vod = a1_vod.__round__(2) a1_total_summary = a1_month2_sub + a1_ad_free + a1_vod combined += a1_total_summary a1_premium = a1_ad_free + a1_vod account1 = combined a2_months_sub = a1_month2_sub a2_ad_sub = a1_ad_free a2_vod = a1_vod.__round__(2) a3_months_sub = a1_month2_sub a3_ad_sub = a1_ad_free a3_vod = a1_vod.__round__(2) months = [a1_month2_sub, a2_months_sub, a3_months_sub] ads = [a2_ad_sub, a2_ad_sub, a3_ad_sub] vods = [a1_vod, a2_vod, a3_vod] for i in range(3): print(f'{acct[i]} made
#x27;,a1_total_summary.__round__(2), 'total') print(f'>>> #x27;{months[i]},'from monthly subscription fees') print(f'>>> #x27;,{ads[i]}, 'from Ad-free upgrades') print(f'>>> #x27;,{vods[i]}, 'from Video on Demand purchases') print() summary_months_sub() #i need the i printed different accounts. but i need to iterate in the function. tests wont let me #iterate out of the function