Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i want to add a comma in the number like this 10,000.00 how to do it: def main()

ID: 3902325 • Letter: I

Question

i want to add a comma in the number like this 10,000.00 how to do it:


def main():
# creating empty list
list_s = []
sales =float(input('Enter the amount of monthly sales for one division (enter a negative number to finish: '))
# the controlling loop
while sales >= 0:
# adding new numbers to the list
list_s.append(sales)
sales =float(input('Enter the amount of monthly sales for one division (enter a negative number to finish: '))
output = ", " .join(["$"+ str(i) for i in list_s])
print("The list of monthly sales is : {", output , "}" )
largest = get_largest(list_s)
print('The highest sales value is: $', largest)
lowest = get_lowest(list_s)
print('The lowest sales value is: $', lowest)
ave = get_average(list_s)
print('The average of sales value is: $', ave)
list_new = get_threshold(list_s)
output = ", ".join(["$"+ str(i) for i in list_new])
print("The new list is : {", output , "}")

  
# the function to gert the highest number in the list

def get_largest(num):
largest = num[0]
for idx in range(1, len(num)):
if num[idx] > largest:
largest = num[idx]
return largest

# the function to get the lowest number in the list
def get_lowest(num):
lowest = num[0]
for i in range(1, len(num)):
if num[i] < lowest:
lowest = num[i]
return lowest

# the function to get the average number of the list
def get_average(num):
ave = sum(num) / len(num)
return ave

# the function to get a new list with the threshold and what is smaller than the threshold
def get_threshold(list_new):
threshold = float(input('enter a number to creat the new list: '))
for arr in list_new:
if arr >= threshold:
list_new.remove(arr)   
return list_new

main()

Explanation / Answer

If you have any doubts, please give me comment...

num = 10000

print(format(num, ',.2f'))