Generation

generate functionSun, 13 Nov 2022

split input of dollar amount into denominations of bills and coins

def money(dollar): return [dollar // 100, (dollar % 100) // 50, (dollar % 50) // 20, (dollar % 20) // 10, (dollar % 10) // 5, (dollar % 5) // 2, (dollar % 2) // 1] money(101)

Questions about programming?Chat with your personal AI assistant