### Instruction: There were 100 jelly beans in a bag to be given away on Halloween. Out of the 40 children taking part in the Halloween celebration, 80% were allowed to draw jelly beans from the bag. Each child drew two jelly beans out of the bag. How many jelly beans remained in the bag after the children took their share? Let's write a Python program.### Response: # define the initial number of jelly beans, the number of children, and the percentage of children allowed to draw
initial_jelly_beans = 100
children = 40
percentage_allowed = 0.8

# calculate the number of children allowed to draw
children_allowed = children * percentage_allowed

# calculate the number of jelly beans each child draws
jelly_beans_each_child = 2

# calculate the total number of jelly beans drawn
total_jelly_beans_drawn = children_allowed * jelly_beans_each_child

# calculate the remaining jelly beans
remaining_jelly_beans = initial_jelly_beans - total_jelly_beans_drawn

# print the result
print(remaining_jelly_beans)