import random
def send_red_packet(total_amount,num_packets):
remaining_amount=total_amount
remaining_packets=num_packets
packets=[]
for i in range(num_packets):
avg=remaining_amount/remaining_packets
amount=random.uniform(0.01,2*avg)
amount=round(amount2)
remaining_packets-=1
packets. append(amount)
return packets
total_amount=100.0
num_packets=10
packets=send_red_packet(total_amountnumpackets)
print('红包金额分别为:'packets)
print('总金额为 'sum(packets))