question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Amy bought 10 bouquets of flowers and 20 individual roses. If each bouquet costs $25 and an individual rose costs the same as three bouquets, how much change will Amy get back if she gave the cashier 1 $500 bill?
def solve() -> int: bouquets = 10 roses = 20 bouquet_cost = 25 rose_cost = bouquet_cost * 3 total_bouquet_cost = bouquets * bouquet_cost total_rose_cost = roses * rose_cost total_flower_cost = total_bouquet_cost + total_rose_cost amount_paid = 500 ...
During a pandemic, a family of 5 consumes 6 rolls of toilet paper in 2 weeks. If a pack of toilet paper comes with 12 rolls, how many packs of toilet paper will they need for a year?
def solve() -> int: rolls_per_week = 6 / 2 rolls_per_year = rolls_per_week * 52 packs_per_year = rolls_per_year / 12 result = int(packs_per_year) return result
Jamie had 15 apples and split them into 3 equal groups. How many apples were in one group?
def solve() -> int: group_size = 0 group_size = 15 / 3 result = group_size return result
Toby has six fewer apples than Cassandra, and gives away 2 apples. How many apples does Toby have if Cassandra has 10?
def solve() -> int: toby = 0 cassandra = 10 toby_givenaway = 2 toby = cassandra - 6 toby_givenaway = 2 result = toby - toby_givenaway return result
The price of 1kg of apples is $2.50. If Sarah wishes to buy 3.5kg of apples, how much will she spend?
def solve() -> int: price_per_kg = 2.50 quantity = 3.5 total_cost = price_per_kg * quantity result = total_cost return result
Student: A factory has three shifts with nine workers each. Lisa has to supervise each shift, and it takes her 8 hours to complete one shift. If she earns $20 per hour of work, calculate the total amount of taxes she has to pay for her income, if the tax rate is 15%.
def solve() -> int: shifts = 3 workers = 9 hours = 8 rate = 20 tax = 0.15 income = shifts * hours * rate taxes = income * tax result = taxes return result
If Emily has 15 apples and her friend has 4, how many more apples does Emily have than her friend?
def solve() -> int: emily_apples = 15 friend_apples = 4 more_apples = emily_apples - friend_apples result = more_apples return result
Sarah needs to split 36 apples equally into 9 baskets. How many apples will she need in each basket?
def solve() -> int: apples = 36 baskets = 9 apples_per_basket = apples / baskets result = apples_per_basket return result
Student: A carpenter needs to cut a piece of wood that is 12 feet long into 3 equal pieces. If each cut reduces the length of the wood by 1/4 foot, what is the length of each piece of wood after all 3 cuts?
def solve() -> int: wood_length = 12 cut_loss = 0.25 total_loss = 3 * cut_loss remaining_length = wood_length - total_loss piece_length = remaining_length / 3 result = piece_length return result
Student: Maria owns a candy store and for every fifth customer, she gives a free candy bar. If she made $80 from selling candy bars, each costing $4, how many free candy bars did she give away?
def solve() -> int: cost = 4 revenue = 80 free = 5 sold = revenue // cost given = sold // free result = given return result
Tom reads 28 pages in a book. This is 30% more than what he would usually read. How many pages would Tom usually read in the book?
def solve() -> int: pages_read = 28 percentage_extra = 30 extra_pages = (percentage_extra/100) * pages_read pages_original = pages_read - extra_pages result = pages_original return result
Charlie buys a book for $15 and sells it for $18. How much profit does he make?
def solve() -> int: cost = 15 selling_price = 18 profit = selling_price - cost result = profit return result
Student: There are four bottles full of juice. There are 16 ounces of juice in the first bottle, 8 more ounces of juice in the second bottle, and half as many ounces of juice in the third bottle as in the second. The fourth bottle has the same amount of juice as the first and the third bottles combined. How many ounces...
def solve() -> int: bottle1 = 16 bottle2 = 8 bottle3 = bottle2 / 2 bottle4 = bottle1 + bottle3 total_juice = bottle1 + bottle2 + bottle3 + bottle4 result = total_juice return result
David makes candles. He can make 20 candles in 2 hours and 15 soaps in 3 hours. If he sells each candle for $5 and each soap for $4, how much money does he make if he works 6 hours a day for 5 days?
def solve() -> int: items_per_hour_candle = 20 / 2 items_per_hour_soap = 15 / 3 price_per_candle = 5 price_per_soap = 4 hours_worked = 6 * 5 items_candle = items_per_hour_candle * hours_worked items_soap = items_per_hour_soap * hours_worked money = price_per_candle * items_c...
There are 35 students in a class and each student has 6 markers. If 15 students give away 2 markers each, how many markers are left?
def solve() -> int: num_students = 35 num_markers_per_student = 6 num_markers = num_students * num_markers_per_student given_away_markers = 15 * 2 num_markers_left = num_markers - given_away_markers result = num_markers_left return result
In a park, if there are a total of 24 wheels and each car has 4 wheels, how many cars are there in the park?
def solve() -> int: total_wheels = 24 wheels_per_car = 4 num_cars = total_wheels // wheels_per_car result = num_cars return result
5. Jill is going on a road trip and she needs to plan her gas budget for the trip. She will get 35 miles per gallon for her car and the total cost of gas for the trip is $110. How many miles will Jill be able to travel?
def solve() -> int: cost = 110 miles_per_gallon = 35 gallons = cost / miles_per_gallon total_miles = gallons * miles_per_gallon result = total_miles return result
Maria has 7 fewer pencils than John. If they have a total of 23 pencils, how many pencils does Maria have?
def solve() -> int: john_pencils = 0 maria_pencils = 0 john_pencils = (23 + 7) / 2 maria_pencils = john_pencils - 7 result = maria_pencils return result
Ravindra has 456 apples, he gave away 114 apples and sold 232 apples. How many apples does Ravindra have left?
def solve() -> int: total_apples = 456 apples_given_away = total_apples - 114 apples_sold = apples_given_away - 232 remaining_apples = total_apples - apples_given_away - apples_sold result = remaining_apples return result
A recipe for 4 servings of soup requires 1 can of tomato sauce and 2 cups of water. If Marie wants to make 12 servings of soup, how many cans of tomato sauce and cups of water does she need?
def solve() -> int: serving = 4 tomato_sauce = 1 water = 2 total_servings = 12 total_tomato_sauce = (total_servings * tomato_sauce) / serving total_water = (total_servings * water) / serving result = total_tomato_sauce, total_water return result
Tyler needs to buy gasoline for his car. A gallon of gas costs $2.25. Tyler needs 10 gallons. How much money did Tyler spend in total?
def solve() -> int: total_cost = 0 total_cost += (10 * 2.25) result = total_cost return result
Ben has 4 boxes of cookies and each box has 16 cookies. He eats 4 cookies and gives away 2 boxes to his friends. How many cookies does he have left?
def solve() -> int: total_cookies = 4 * 16 cookies_eaten_given = 4 + 2 * 16 cookies_left = total_cookies - cookies_eaten_given result = cookies_left return result
A triangle has a base of 8 cm and a height of 6 cm. What is the area of the triangle?
def solve() -> int: base = 8 height = 6 area = 0.5*base*height result = area return result
Jake has $600. He wants to buy apples at $0.5 each and give some to his friends, Ben and Max. Ben will get 1/8 of the apples, and Max will get 1/2 of the apples. How many apples does Jake give to his friends?
def solve() -> int: jake_money = 600 apple_price = 0.5 num_apples = jake_money / apple_price ben_apples = num_apples * (1/8) max_apples = num_apples * (1/2) total_apples = ben_apples + max_apples result = total_apples return result
David can knit 50 sweaters a week. It costs $20 to produce each sweater. He sells them for 2.5 times as much. If he could knit 10 more sweaters a week, how much extra money could he make each week?
def solve() -> int: sweaters_per_week = 50 cost_per_sweater = 20 selling_price_multiplier = 2.5 total_cost = sweaters_per_week * cost_per_sweater selling_price = cost_per_sweater * selling_price_multiplier total_revenue = sweaters_per_week * selling_price extra_sweaters_per_week = ...
Ethan and Olivia are racing to see who can bike 20 miles the fastest. Ethan bikes the first 10 miles in 25 minutes, then bikes 5 more miles in 15 minutes. He bikes the next 3 miles in 9 minutes, then finishes the race. Olivia finishes the race in 35 minutes. In minutes, how long did it take Ethan to bike his final 2 mi...
def solve() -> int: ethan_distance = 10 + 5 + 3 + 2 ethan_time = 25 + 15 + 9 olivia_time = 35 ethan_final_time = ethan_time + (20/60) ethan_final_distance = ethan_distance + 2 ethan_final_speed = ethan_final_distance / ethan_final_time olivia_speed = ethan_distance / olivia_time ...
Laura went to the florist and bought a bouquet of roses, a pot of orchids, a bunch of tulips, and a pack of seeds. The roses were twice as expensive as the orchids, while the orchids were 60% of the price of the tulips. The seeds were the cheapest and cost a quarter of the price of the roses. If the tulips cost $12, ho...
def solve() -> int: x = 12*3/5 total = 2*x + x + 5/3*x + x/4 result = total return result
If 12 volunteers each donate $10 for a charity event, what is the overall total amount of money the charity will receive?
def solve() -> int: no_of_volunteers = 12 amount_per_volunteer = 10 total_amount = no_of_volunteers * amount_per_volunteer result = total_amount return result
Student: Paul bikes 10 miles every day to work. He works for 5 days every week. How much distance does he bike in a month, which has 30 days?
def solve() -> int: miles_per_day = 10 days_per_week = 5 days_in_month = 30 total_miles = miles_per_day * days_per_week * (days_in_month / days_per_week) result = total_miles return result
Kim has 10 more earrings than Kira, who has 7 earrings. Kyle has twice as many earrings as Kim. How many earrings does Kyle have?
def solve() -> int: Kira = 7 Kim = Kira + 10 Kyle = Kim * 2 result = Kyle return result
There are 20 roses and 15 tulips in a bouquet. If 5 roses and 3 tulips are removed, what percentage of the flowers in the bouquet are roses?
def solve() -> int: total_before = 20 + 15 total_after = total_before - (5 + 3) roses_after = 20 - 5 percentage = roses_after / total_after * 100 result = percentage return result
Peter has a total of $20 to spend on snacks. He already spent $3 on chips, how much money does he have left to spend?
def solve() -> int: total_money = 20 spent_money = 3 result = total_money - spent_money return result
A company manufactures 6000 bags of chips in a day. The company sells 80% of them and throws away 40% of the remaining. How many bags of chips are left unsold?
def solve() -> int: bags_made = 6000 percent_sold = 80 percent_thrashed = 40 sold = (percent_sold / 100) * bags_made unsold = bags_made - sold thrashed = (percent_thrashed / 100) * unsold unsold = unsold - thrashed result = unsold return result
Lily had 30 lollies yesterday, she had 20 more today. If she was given 30 lollies tomorrow, how many lollies would she have in total?
def solve() -> int: total_lollies = 0 total_lollies = total_lollies + 30 total_lollies = total_lollies + 20 total_lollies = total_lollies + 30 result = total_lollies return result
Nathan has a vegetable garden. He wants to plant 5 rows of tomatoes, 4 rows of carrots, and 3 rows of peppers. Each row contains 25 plants. How many total vegetables will Nathan have?
def solve() -> int: num_rows_tomatoes = 5 num_rows_carrots = 4 num_rows_peppers = 3 plants_per_row = 25 total_tomatoes = num_rows_tomatoes * plants_per_row total_carrots = num_rows_carrots * plants_per_row total_peppers = num_rows_peppers * plants_per_row total_vegetables = tot...
If a square has a perimeter of 20 centimeters, what is the length of each side in centimeters?
def solve() -> int: perimeter = 20 side_length = perimeter / 4 result = side_length return result
A factory produces 5000 toys. If 2/5 of the toys fail in the quality test, how many toys pass the quality test?
def solve() -> int: total_toys = 5000 failed_toys = int(total_toys * 2/5) passed_toys = total_toys - failed_toys result = passed_toys return result
A train is moving along a winding track. The track has 5 sharp curves, and the train must turn right 4 times to complete one round trip. After turning right the first time, the train travels 600 meters. After turning right the 3rd time, it travels 1800 meters. If the total distance traveled by the train is 9 kilometers...
def solve() -> int: turn1_distance = 600 turn3_distance = 1800 total_distance = 9000 total_distance_after_turn1 = turn1_distance total_distance_after_turn3 = turn1_distance + turn3_distance total_distance_after_turn4 = total_distance - total_distance_after_turn3 result = ...
Riley and Ryan collected 97 books for a library fundraiser. Then, their neighbors gave them 18 more books. If they have already sold 65 books, how many more do they have to sell?
def solve() -> int: books_collected = 97 books_from_neighbors = 18 books_sold = 65 total_books = books_collected + books_from_neighbors books_remaining = total_books - books_sold result = books_remaining return result
Jack harvested 200 apples from his orchard and decided to give some to his friends. He gave 50 to his cousin, 20 to his friend Nick, and donated 80 to a local farmer's market. If each apple has 5 seeds, how many seeds are left in Jack's apple collection?
def solve() -> int: apples_harvested = 200 apples_given_away = 50 + 20 + 80 seeds_per_apple = 5 apples_left = apples_harvested - apples_given_away seeds_left = apples_left * seeds_per_apple result = seeds_left return result
Five years ago, the sum of Rachel's age and her cousin's age was 3/4 of their grandmother's age. If Rachel is now 30 years old and her cousin is 25 years old, how old is their grandmother now?
def solve() -> int: rachel_age = 30 cousin_age = 25 sum_ages_five_years_ago = (rachel_age - 5) + (cousin_age - 5) grandmother_age_five_years_ago = sum_ages_five_years_ago / (3/4) grandmother_age = grandmother_age_five_years_ago + 5 result = grandmother_age return result
On Monday, Jack spent $30 on lunch and $50 on groceries. On Tuesday, he spent 25% less on lunch and 10% more on groceries than on Monday. On Wednesday, he spent $40 on lunch and the same amount on groceries as on Tuesday. How much more did he spend on lunch and groceries on Wednesday than on Monday?
def solve() -> int: lunch_mon = 30 groceries_mon = 50 lunch_tue = 0.75 * lunch_mon groceries_tue = 1.1 * groceries_mon lunch_wed = 40 groceries_wed = groceries_tue total_mon = lunch_mon + groceries_mon total_tue = lunch_tue + groceries_tue total_wed = lunch_wed + groceries_wed...
A pizza place sells a large pizza for $18 and a medium pizza for $12. They also charge $2 for each topping. Nancy orders two large pizzas and one medium pizza. She wants cheese, pepperoni, mushrooms, and olives as toppings. How much does she pay for her order?
def solve() -> int: base_price = 2 * 18 + 1 * 12 topping_price = 4 * 2 total_price = base_price + topping_price result = total_price return result
- Ben made some bracelets and sold them at a fair. He sold 4 bracelets the first hour and 2 more bracelets each hour for the next four hours. If he charged 5 dollars for each bracelet, how much money did he make in total?
def solve() -> int: bracelets = 4 money = 0 for hour in range(1, 6): bracelets = bracelets + 2 money = money + bracelets * 5 result = money return result
Mary is hosting a party for her friends. She wants to serve a total of 1000 calories of food. She plans to have pizza with 300 calories per slice, nachos with 50 calories each, and cupcakes with 100 calories each. How many cupcakes can Mary buy?
def solve() -> int: pizza_calories = 300 nachos_calories = 50 cupcakes_calories = 100 total_calories = 1000 pizza_slices = total_calories // pizza_calories remaining_calories = total_calories - (pizza_slices * pizza_calories) nachos = remaining_calories // nachos_calories...
Q8: If there are 15 chairs in a room and 9 more chairs arrive, how many chairs are in the room?
def solve() -> int: chairs = 15 chairs = chairs + 9 total_chairs = chairs result = total_chairs return result
Samantha started with 100 dollars in her wallet. While at the store, she spent 25% on a new shirt, then spent 40% of what was left on a book. How much money does Samantha have left?
def solve() -> int: money_start = 100 perc_spent = 0.25 shirt_cost = money_start * perc_spent money_after_shirt = money_start - shirt_cost perc_left = 0.6 book_cost = money_after_shirt * perc_left money_left = money_after_shirt - book_cost result = money_left return result
The school has 400 textbooks, and each textbook costs $20. How much money did the school spend on the textbooks?
def solve() -> int: total_textbooks = 400 cost_of_each_textbook = 20 total_money_spent = total_textbooks * cost_of_each_textbook result = total_money_spent return result
A car travels 50 miles in 1 hour. If the car drives for 2 and a half hours, how many miles does it travel?
def solve() -> int: miles_driven = 50 * 2.5 result = f'{miles_driven}' result = miles_driven return result
A zoo has 45 monkeys and 28 tigers. If they transfer some monkeys to another zoo so that the ratio of monkeys to tigers is 2:1, how many monkeys are left in the original zoo?
def solve() -> int: original_number_of_monkeys = 45 original_number_of_tigers = 28 ratio_of_monkeys_to_tigers = 2/1 new_ratio_of_monkeys_to_tigers = original_number_of_monkeys/original_number_of_tigers difference_ratio_of_monkeys = new_ratio_of_monkeys_to_tigers - ratio_of_monkeys_to_tigers new_...
9 ducks find 129 snails. The first group of ducks with 4 ducks found 3 times more snails than the second group with 3 ducks. How many snails did each group of ducks find?
def solve() -> int: total_snails = 129 snails_found_by_first_group = total_snails/9 * 3 snails_found_by_second_group = (total_snails - snails_found_by_first_group) / 3 result = snails_found_by_first_group, snails_found_by_second_group return result
Student: If a family starts with 18 sacks of rice in their first harvest and they increase their yield by 25 percent after every harvest, what is the total number of sacks of rice they can get after the third harvest?
def solve() -> int: sacks = 18 increase = 0.25 sacks = sacks + sacks * increase sacks = sacks + sacks * increase sacks = sacks + sacks * increase result = sacks return result
Sam has a rectangular garden that measures 20 feet by 15 feet. He wants to plant corn in the garden, leaving a 2-foot border around the edges. Each corn seed needs a 1-foot by 1-foot space to grow. How many corn seeds can Sam plant in his garden?
def solve() -> int: length = 20 width = 15 border = 2 inner_length = length - 2 * border inner_width = width - 2 * border inner_area = inner_length * inner_width seed_area = 1 seeds = inner_area // seed_area result = seeds return result
Julia used to jog 5 miles per day. She decreased her jogging distance by 0.5 miles because of her knee injury. If she spends 10 minutes per mile on jogging, how much time does she save per day compared to what she used to spend?
def solve() -> int: jogging_distance = 5 decreased_distance = 0.5 new_distance = jogging_distance - decreased_distance time_per_mile = 10 old_time = jogging_distance * time_per_mile new_time = new_distance * time_per_mile time_saved = old_time - new_time result = time_save...
- Alice and Bob are running a race on a track that is 400 meters long. Alice runs at a speed of 6 meters per second and Bob runs at a speed of 5 meters per second. They start at the same time and same point. How many seconds will it take for Alice to lap Bob, that is, to be 400 meters ahead of him?
def solve() -> int: distance = 400 speed_alice = 6 speed_bob = 5 relative_speed = speed_alice - speed_bob time = distance / relative_speed result = time return result
Alex made a large cake containing 530 grams of sugar. How much sugar would he need to add to the cake if he wanted it to be 800 grams of sugar altogether?
def solve() -> int: original_sugar = 530 target_sugar = 800 sugar_to_add = target_sugar - original_sugar result = sugar_to_add return result
Student: Lucy has 28 markers. She uses five eighths of her markers to draw pictures and the remaining markers to color them. How many markers does Lucy have now?
def solve() -> int: total_markers = 28 fraction_used = 5/8 fraction_left = 1 - fraction_used markers_draw = total_markers * fraction_used markers_color = total_markers * fraction_left markers_now = markers_draw + markers_color result = markers_now return result
Oliver wants to buy drinks for the party. Soda cans cost $1 each and juice boxes cost $3 each. If he wants to spend a total of $20 on drinks, and wants to buy 4 times as many sodas as juice boxes, how many of each should he buy?
def solve() -> int: total_cost = 20 soda_cost = 1 juice_cost = 3 ratio_sodas_to_juice = 4 total_drinks = (total_cost / soda_cost) + (total_cost / juice_cost) num_juice = total_drinks / (ratio_sodas_to_juice + 1) num_sodas = total_drinks - num_juice result = f'Number of sodas to buy: {num...
Mary is a cashier at a grocery store. The store sells 100 loaves of bread per day. The bread costs $1.50 per loaf. Mary gets a 10% commission on all the bread she sells. How much commission does Mary make in a week when she works 6 days a week?
def solve() -> int: bread_per_day = 100 price_per_loaf = 1.50 commission_rate = 0.10 days_worked = 6 total_bread_sold = bread_per_day * days_worked total_sales = total_bread_sold * price_per_loaf total_commission = total_sales * commission_rate result = total_commission * days_worked ...
John is planning a movie night with his friends. He invites 15 people to come and watch a movie. Each person will have a choice of 2 snacks. If he has 3 types of snacks to choose from, how many snacks does he need to buy in total?
def solve() -> int: people = 15 snacks_per_person = 2 types_of_snacks = 3 total_snacks = people * snacks_per_person * types_of_snacks result = total_snacks return result
A rectangle has an area of 72 square meters and a perimeter of 40 meters. What are its dimensions?
def solve() -> int: length = 20 - ((20**2)-288)**(1/2) width = 72 / length result = length, width return result
Student: Jeff has a garden at his house with five varieties of vegetables - carrots, potatoes, celery, onions and lettuce. He can harvest 10 carrots, 4 potatoes, 6 celery, 8 onions and 15 lettuce each hour. For a new order, Jeff needs to harvest 630 carrots, 450 potatoes, 150 celery, 550 onions and 150 lettuce. How man...
def solve() -> int: carrots = 630 potatoes = 450 celery = 150 onions = 550 lettuce = 150 carrots_per_hour = 10 potatoes_per_hour = 4 celery_per_hour = 6 onions_per_hour = 8 lettuce_per_hour = 15 total_hours = (carrots // carrots_per_hour) + (potatoes // potatoes_per_hour) + (...
A teacher assigns homework to their class. The class has 20 students, and the homework will take approximately 2 hours to complete. If the teacher pays all students $10 per hour to complete the homework, how much will the teacher have to pay in total?
def solve() -> int: num_students = 20 homework_hours = 2 payment_per_hour = 10 total_homework_time = homework_hours * num_students total_homework_cost = total_homework_time * payment_per_hour result = total_homework_cost return result
An ice cube tray contains 18 cubes. How many cubes would be needed to fill 3 full trays?
def solve() -> int: number_of_cubes_in_a_tray = 18 number_of_trays = 3 total_number_of_cubes = number_of_cubes_in_a_tray * number_of_trays result = total_number_of_cubes return result
A toy store sells toys at an average profit margin of 40%. If the store sells $20,000 worth of toys in a month, what is its total profit for the month?
def solve() -> int: sales_amount = 20000 profit_margin = 0.40 total_profit = sales_amount*profit_margin result = total_profit return result
Student: Alice purchased a pair of shoes for $68 and a coat for $196. If she uses a coupon that gives her 20% off her total purchase, how much will she owe?
def solve() -> int: shoes = 68 coat = 196 total = shoes + coat discount = total * 0.2 final = total - discount result = final return result
10 friends are having a pizza party. Each person eats 3 slices of pizza. There are 8 slices in each pizza. How many pizzas do they need to order for everyone to get their fill?
def solve() -> int: friends = 10 slices_per_person = 3 slices_per_pizza = 8 pizzas_needed = (friends * slices_per_person) / slices_per_pizza result = pizzas_needed return result
Maria went to the store and bought 2 pounds of oranges and 3 pounds of apples. If each pound of oranges cost $2.25, and each pound of apples cost $2.50, how much money did she spend in total?
def solve() -> int: num_oranges = 2 num_apple = 3 cost_oranges = 2.25 * num_oranges cost_apples = 2.50 * num_apple result = cost_oranges + cost_apples result = 10.00 return result
Blake had $700. He spent $150 on books. Chloe spent 4 times what Blake had left. How much did Chloe spend on books?
def solve() -> int: blake_money = 700 books_cost = 150 blake_money_left = blake_money - books_cost chloe_spent = blake_money_left * 4 result = chloe_spent return result
Mary is a real estate agent. She earns a 2.5% commission on each sale. Last year, she sold four houses. The houses sold for $200,000, $400,000, $600,000, and $800,000. What was Mary's total commission on these four sales?
def solve() -> int: house1 = 200000 house2 = 400000 house3 = 600000 house4 = 800000 total_sales = house1 + house2 + house3 + house4 commission_rate = 0.025 total_commission = total_sales * commission_rate result = total_commission return result
Jill has 5 apples and 10 oranges. She has to divide the fruits evenly among 7 friends. How many pieces of fruits should each friend receive?
def solve() -> int: apples = 5 oranges = 10 friends = 7 total_fruits = apples + oranges fruits_per_friend = total_fruits // friends result = fruits_per_friend return result
A grocery store sells 3 types of apples. Type A costs $1.20 per pound, Type B costs $1.50 per pound, and Type C costs $1.80 per pound. If there are 10 pounds of Type A apples, 5 pounds of Type B apples, and 15 pounds of Type C apples, what is the total cost of all the apples?
def solve() -> int: type_a = 10 type_b = 5 type_c = 15 cost_a = 1.20 cost_b = 1.50 cost_c = 1.80 total_cost = (type_a * cost_a) + (type_b * cost_b) + (type_c * cost_c) result = total_cost return result
David was shopping for a new bike and he found one that he liked for $750. The store offered him an additional 5% discount off the original price. How much did he pay in total with the discount?
def solve() -> int: original_price = 750 discount_percentage = 0.05 discounted_total = original_price - original_price * discount_percentage result = discounted_total return result
A store has a sale, where when a customer buys 4 shirts they get 1 more shirt for free. If 17 shirts are bought, how many shirts will the customer get for free?
def solve() -> int: num_shirts = 17 buy_x_get_y = (4, 1) num_free_shirts = (num_shirts // buy_x_get_y[0]) * buy_x_get_y[1] result = num_free_shirts return result
Sarah, the biologist, starts her day by examining specimens. It takes her 1.5 hours to prepare the samples, 2 hours to study them and 30 minutes to analyze the data. One day, Sarah's microscope was not functioning correctly, and it took her three times as long to study the sample as usual. How long did it take Sarah to...
def solve() -> int: prep_time = 1.5 study_time = 2 analyze_time = 0.5 total_time_normal = prep_time + study_time + analyze_time study_time_new = 3 * study_time total_time_new = prep_time + study_time_new + analyze_time result = total_time_new retur...
Student: A group of friends went out to eat and the total bill came out to $85. If they want to leave a 15% tip, how much will each person contribute?
def solve() -> int: bill = 85 tip_percentage = 0.15 tip = bill * tip_percentage total_amount = bill + tip contribution_per_person = total_amount / 5 result = contribution_per_person return result
Student: Mark earns $10,000 a month, his rent is $750 a month; his monthly food expenses are $400; his car insurance costs 1/4 of what he earns; and his internet bill costs 1/8 of what he earns per month. How much money does Mark have left after paying those four bills?
def solve() -> int: salary = 10000 rent = 750 food = 400 car_insurance = salary / 4 internet = salary / 8 total_bills = rent + food + car_insurance + internet result = salary - total_bills return result
Student: If Debbie bought 5/8 of a bag of apples, how many apples did she buy?
def solve() -> int: fraction = 5/8 bag_of_apples = 8 result = fraction * bag_of_apples return result
A restaurant bill is $75 including tax. If the tax rate is 8%, what is the cost of the meal before tax?
def solve() -> int: bill = 75 tax_percentage = 8 meal_cost = bill * 100 / (100 + tax_percentage) result = meal_cost return result
Kim had a closet with clothes. She had 7 shirts and 5 times as many pants. She decided to donate 2 shirts and 4 pants for every shirt she had. How many clothes were left in the closet after donating?
def solve() -> int: pants = 7 * 5 shirts_donated = 7 * 2 pants_donated = 7 * 4 shirts_left = 7 - shirts_donated pants_left = pants - pants_donated clothes_left = shirts_left + pants_left result = clothes_left return result
Samantha wants to break the record for the highest score in a video game. The current record is 500,000 points. If Samantha has already scored 375,000 points by the halfway point of the game, how many points does she need to score per minute to break the record?
def solve() -> int: current_record = 500000 halfway_score = 375000 time_remaining = 60 points_needed = (current_record - halfway_score) / time_remaining result = points_needed return result
John started with 60 Pokémon cards. He lost 25% of his cards on a trip and then found 40% more as he continued his journey. What percent of his initial cards does he have now?
def solve() -> int: initial_cards = 60 lost_cards = initial_cards * 0.25 remaining_cards = initial_cards - lost_cards found_cards = remaining_cards * 0.40 total_cards = remaining_cards + found_cards percent_of_initial_cards = (total_cards / initial_cards) * 100 result = percent_of_initi...
Maria has a 25% off coupon and wants to buy a jacket that costs $80. She also has to pay a 10% sales tax. How much will she pay in total, including the discount and the tax?
def solve() -> int: sticker_price = 80 discount = 0.25 tax = 0.1 discounted_price = sticker_price * (1-discount) total_price = discounted_price * (1+tax) result = total_price return result
A car travels a distance of 540 km in 6 hours. If the speed is constant, what is the speed of the car?
def solve() -> int: distance = 540 time = 6 speed = distance/time result = speed return result
A classroom has 28 students, and each group project can only consist of 4 students. How many groups can be formed for the project?
def solve() -> int: num_students = 28 group_size = 4 num_groups = num_students // group_size result = num_groups return result
A library has 500 books in total. A group of 100 people came to borrow books from the library. Another group of 200 people arrived at the same time, and the same number of people left the library. Two librarians were present at the library. After the library closed, 40 books were left with 1 librarian. How many people ...
def solve() -> int: books_total = 500 people_borrowing = 100 people_arriving = 200 people_leaving = people_arriving books_left = 40 librarians = 2 books_borrowed = books_total - books_left people_left = people_borrowing + people_arriving - people_leaving - librarians r...
Student: 4. Jimmy has a box of 30 pencils. He uses 20 pencils to draw and gives 4 to his sister. How many pencils does Jimmy have left?
def solve() -> int: pencils_in_box = 30 pencils_used = 20 pencils_given = 4 pencils_left = pencils_in_box - pencils_used - pencils_given result = pencils_left return result
Jack is buying some presents for his cousins. He buys a toy for $20, a book for $10, and a puzzle for $15. If he has a 15% coupon, how much does he pay?
def solve() -> int: toy_cost = 20 book_cost = 10 puzzle_cost = 15 coupon_rate = 0.15 total_cost = toy_cost + book_cost + puzzle_cost discount = total_cost * coupon_rate final_cost = total_cost - discount result = final_cost return result
There are 8 dogs staying at Rachel's animal care and she is in charge of handing out food. For each dog, she needs to give 1 cup of kibble and 2 cups of wet food every day. How many cups of food does Rachel need to give each day?
def solve() -> int: dogs = 8 kibble_per_dog = 1 wetfood_per_dog = 2 total = (dogs * kibble_per_dog) + (dogs * wetfood_per_dog) result = total return result
Student: Nancy is planning to go on a trip. She needs to save 160 dollars in 4 weeks. If she saves the same amount of money each week, how much money should she save each week?
def solve() -> int: total = 160 weeks = 4 weekly_savings = total / weeks result = weekly_savings return result
Student: Cloe worked on her project for a total of 3/4 of an hour on Monday and Wednesday, and for an additional 2 hours on Thursday. How many hours did she work in total from Monday to Thursday?
def solve() -> int: monday_wednesday = 3/4 thursday = 2 total_hours = monday_wednesday + thursday result = total_hours return result
Juanita has four times as many dimes as nickels. If she has a total of $2.20 in change, how many dimes does she have?
def solve() -> int: total_value = 2.20 nickel_value = 0.05 dime_value = 0.10 num_dimes = (4 * nickel_value - dime_value) * total_value / (4 * nickel_value - dime_value * 10) result = int(num_dimes) return result
``` James has 30 dollars. He wants to buy a game that costs 16 dollars. If he works for his neighbor and earns 8 dollars, how much money, in dollars, will James have in total?
def solve() -> int: money = 30 game = 16 earned_money = 8 total_money = money - game + earned_money result = total_money return result
A triangle has a base of 10 cm and an area of 30 square centimeters. What is the height of the triangle in cm?
def solve() -> int: area = 30 base = 10 height = (2*area)/base result = height return result
A factory produces 500 units per hour. How much time will it take to produce 2000 units?
def solve() -> int: units_to_produce = 2000 units_per_hour = 500 total_time = units_to_produce / units_per_hour result = total_time return result
Alex has a garden and has been buying 10 rose plants each year since 2015. Each rose plant costs $7.50. By 2021, how much money has Alex spent on rose plants?
def solve() -> int: price_per_rose = 7.50 number_of_roses = 10 years_passed = 2021 - 2015 total_amount_spent = price_per_rose * number_of_roses * years_passed result = total_amount_spent return result
During a sale, the price of a shirt is marked up by 40% and then discounted by 10%. If a shirt costs $48 before the sale, what is the final cost of the shirt?
def solve() -> int: original_price = 48 markup_percentage = 40 discount_percentage = 10 markup_amount = original_price * markup_percentage / 100 price_after_markup = original_price + markup_amount discount_amount = price_after_markup * discount_percentage / 100 final_price = price_...
A class has 80 students. If 30 students are girls and the rest are boys, what percentage of the class are boys?
def solve() -> int: boys = 80 - 30 percent_boys = (boys / 80) * 100 result = percent_boys return result
Student: Thomas has 22 postcards. Thomas gives three postcards to his friend. If Thomas gives his sister a quarter of the number of postcards he gave to his friend, how many postcards does Thomas have left?
def solve() -> int: postcards = 22 friend_postcards = 3 sister_postcards = friend_postcards / 4 left_postcards = postcards - friend_postcards - sister_postcards result = left_postcards return result
Student: Tariq cut a rectangular piece of cardboard with the length measuring 35 centimeters and the width measuring 25 centimeters. He then folded the cardboard along the diagonal to form a right triangle. If he repeated this process with two more pieces of cardboard, what's the total area of the triangular cardboard ...
def solve() -> int: length1 = 35 width1 = 25 length2 = 35 width2 = 25 length3 = 35 width3 = 25 base1 = length1 height1 = width1 area1 = 0.5 * base1 * height1 base2 = length2 height2 = width2 area2 = 0.5 * base2 * height2 base3 = length3 height3 = widt...