question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Daniela baked 4 pies to share with her 30 coworkers. If each pie was cut into 12 slices and Daniela and her coworkers each had 1 slice, how many slices are left?
def solve() -> int: pies = 4 coworkers = 30 slices_per_pie = 12 slices_taken = 1 total_slices = pies * slices_per_pie slices_left = total_slices - (coworkers * slices_taken) result = slices_left return result
A recipe calls for 3/4 cup of flour for every 2 eggs. If we want to make 12 cupcakes, how much flour do we need?
def solve() -> int: flour_per_egg = 3/4 eggs_per_cupcake = 2/12 total_flour = flour_per_egg * eggs_per_cupcake * 12 result = total_flour return result
In a school, 60% of the students are girls and the remaining are boys. If there are 800 students in the school, how many are boys?
def solve() -> int: total_students = 800 girls_percent = 60 boys_percent = 100 - girls_percent boys = (boys_percent / 100) * total_students result = boys return result
A store is having a sale with 20% off all items. If a shirt originally costs $25, what is the sale price?
def solve() -> int: original_price = 25 discount_percentage = 20 discount_amount = original_price * (discount_percentage/100) sale_price = original_price - discount_amount result = sale_price return result
A car travels at a speed of 60 mph for the first part of a trip. It then slows down to 40 mph for the remaining distance. The total length of the trip is 360 miles. How long does the trip take?
def solve() -> int: first_speed = 60 second_speed = 40 total_distance = 360 d1 = (first_speed/(first_speed+second_speed))*total_distance d2 = (second_speed/(first_speed+second_speed))*total_distance time1 = d1/first_speed time2 = d2/second_speed total_time = time1 + time2 result = to...
A class has 25 students. If there are 5 girls, how many boys are in the class?
def solve() -> int: students = 25 girls = 5 boys = students - girls result = boys return result
Janine goes to the gym 3 times a week and burns 350 calories each time. She also does a 1-hour Zumba class on Saturday and burns 500 calories. If she eats 1800 calories every day, what is her weekly caloric deficit?
def solve() -> int: calories_burnt = (350*3) + 500 caloric_intake = 1800*7 deficit = caloric_intake - calories_burnt result = deficit return result
A boy bird hunts for worms and catches 13 worms. He puts them with the 25 already in his nest, but accidentally drops 4. A girl bird brings 11 more worms, but eats 6. How many worms are left in the nest?
def solve() -> int: boy_worms = 13 nest_worms = 25 dropped_worms = 4 girl_worms = 11 girl_eats = 6 total_worms = boy_worms + nest_worms - dropped_worms + girl_worms - girl_eats result = total_worms return result
Lisa had 72 markers. She gave 8 to her brother and then divided the rest evenly between herself and her sister. How many markers did Lisa end up with?
def solve() -> int: markers = 72 markers -= 8 result = markers / 2 return result
Tommy has $48. He wants to buy one toy for $12 and as many video games as he can for the remaining money. If each video game costs $8, how many video games can he buy?
def solve() -> int: total_money = 48 toy_cost = 12 video_game_cost = 8 remaining_money = total_money - toy_cost num_video_games = remaining_money // video_game_cost result = num_video_games return result
A bottle of juice has 8 servings with 100 calories each. Tom drinks two thirds of the bottle. How many calories did he drink?
def solve() -> int: calories_per_serving = 100 servings = 8 calories = servings * calories_per_serving part = 2 whole = 3 fraction = part / whole calories_drunk = fraction * calories result = calories_drunk return result
At Sophia's bakery, she has 50 cakes to sell. If she wants to sell them in pre-packaged boxes with 10 cakes each, how many boxes does she need?
def solve() -> int: cakes = 50 cakes_per_box = 10 boxes = cakes // cakes_per_box result = boxes return result
The sum of Atticus, Jensen, and Cruz's marbles is 42. Atticus has four more marbles than Jensen, and Jensen has twice as many marbles as Cruz. How many marbles does Cruz have?
def solve() -> int: marblesAtticus = 0 marblesJensen = 0 marblesCruz = 0 marblesJensen = marblesAtticus - 4 marblesCruz = marblesJensen / 2 marblesAtticus = marblesJensen + 4 result = marblesCruz return result
The local animal shelter is hosting a fundraiser and needs to raise at least $500. They have collected donations totaling $375 so far. If each donation is worth $25, how many more donations do they need to reach their fundraising goal?
def solve() -> int: donations_goal = 500 donations_collected = 375 donation_amount = 25 donations_needed = (donations_goal - donations_collected) / donation_amount result = int(donations_needed) return result
9. Maria drinks 3 glasses of water every 4 hours. How many glasses of water does she drink in 24 hours?
def solve() -> int: glasses = 3 hours = 24 interval = 4 num_sessions = hours // interval total_glasses = num_sessions * glasses result = total_glasses return result
Jason runs 8 miles in 1 hour. If he runs at the same speed, how many miles can he run in 40 minutes?
def solve() -> int: time_in_hours = 40/60 distance = 8*(time_in_hours/1) result = distance return result
Joe is planning his grocery trip and needs to know how many packs of apples he should buy for his family. If there are 5 apples in a pack and his family of 4 people would need 20 apples for the week, how many packs of apples should Joe buy?
def solve() -> int: apples_needed = 20 apples_per_pack = 5 total_packs = apples_needed / apples_per_pack result = total_packs return result
A recipe calls for 2/3 cup of flour and yields 12 cookies. How much flour is needed to make 30 cookies?
def solve() -> int: flour_per_cookie = 2/3 cookies_needed = 30 total_flour_needed = flour_per_cookie * cookies_needed/12 result = round(total_flour_needed, 2) return result
am had 64 pieces of candy and Kristen had twice the number of pieces that Sam had. How many pieces of candy did Kristen have?
def solve() -> int: candy_for_kristen = (2)*64 result = candy_for_kristen return result
Building A has 3 windows per each floor, Building B has 1 window per each floor, and Building C has twice as many windows as Building A. How many windows does Building C have?
def solve() -> int: windows_A = 3 floors_A = 4 windows_B = 1 floors_B = floors_A + 9 windows_C = windows_A * 2 floors_C = floors_B - 6 total_windows_C = windows_C * floors_C result = total_windows_C return result
3. Of the 400 homes in the town of Belize, one fourth are white and the other three fourths are a mix of colors. One eighth of the non-white homes have a balcony. How many of the homes in the town of Belize do not have a balcony?
def solve() -> int: total_homes = 400 white_homes = total_homes/4 non_white_homes = total_homes - white_homes balconied_homes = non_white_homes/8 non_balconied_homes = non_white_homes - balconied_homes result = non_balconied_homes return result
A train travels at 60 km/h for the first hour, 80 km/h for the second hour, and 100 km/h for the third hour. What is the average speed of the train for the entire journey?
def solve() -> int: distance_first_hour = 60 * 1 distance_second_hour = 80 * 1 distance_third_hour = 100 * 1 total_distance = distance_first_hour + distance_second_hour + distance_third_hour total_time = 1 + 1 + 1 average_speed = total_distance / total_time result = average_speed return ...
A photographer works for 9 hours a day for a total of 5 days and charges $50 per hour. What is the total cost of the services?
def solve() -> int: hours_per_day = 9 days_worked = 5 hourly_rate = 50 total_hours_worked = hours_per_day * days_worked total_cost = total_hours_worked * hourly_rate result = total_cost return result
At the start of a game, John has 10 points. Each time he wins, he gains 5 additional points. If John won 4 games, how many points does he have?
def solve() -> int: number_of_wins = 4 points_per_win = 5 start_points = 10 total_points = start_points + number_of_wins * points_per_win result = total_points return result
The museum wants to increase the attendance of visitors. For every promotional offer they provide, the attendance increases by 15%. If a promotional offer costs $2,000, how much will they need to spend to increase attendance by 75%?
def solve() -> int: promo_cost = 2000 promo_increase = 0.15 attendance_increase = 0.75 one_promo_attendance = promo_increase + 1 num_promos_needed = (attendance_increase / promo_increase) total_cost = num_promos_needed * promo_cost result = total_cost return result
Grace has 6 stickers. Lila has 3 times as many stickers as Grace, and Penelope has 2 less stickers than Lila. How many stickers do they have altogether?
def solve() -> int: grace_stickers = 6 lila_stickers = grace_stickers * 3 penelope_stickers = lila_stickers - 2 total_stickers = grace_stickers + lila_stickers + penelope_stickers result = total_stickers return result
Maggie has 4 dozen marbles in her collection. Steve has two-third as many marbles as Maggie. Lilly has half as many marbles as Steve. Justin has 3 times as many marbles as Lilly. How many marbles do the four friends have altogether?
def solve() -> int: maggie_marbles = 4 * 12 steve_marbles = (2 / 3) * maggie_marbles lilly_marbles = 0.5 * steve_marbles justin_marbles = 3 * lilly_marbles total_marbles = maggie_marbles + steve_marbles + lilly_marbles + justin_marbles result = total_marbles return result
A gardener plants tulips and daffodils in a flower bed. He plants 60 tulips and 40 daffodils, but one-fourth of the tulips and one-eighth of the daffodils die before they bloom. How many flowers bloom in the flower bed?
def solve() -> int: tulips = 60 daffodils = 40 tulips_die = tulips / 4 daffodils_die = daffodils / 8 tulips_bloom = tulips - tulips_die daffodils_bloom = daffodils - daffodils_die flowers_bloom = tulips_bloom + daffodils_bloom result = flowers_bloom return result...
Student: 10. George and Charlie went on a hot air balloon ride. They pulled the lift chain for 18 minutes and released it for 12 minutes. If the balloon rises at a rate of 40 feet per minute when the lift chain is pulled, and descends at a rate of 30 feet per minute when the chain is released, what was the highest elev...
def solve() -> int: pull_time = 18 release_time = 12 rise_rate = 40 descend_rate = 30 rise_distance = pull_time * rise_rate descend_distance = release_time * descend_rate result = rise_distance - descend_distance return result
Student: Mr. Legend needs to buy 20 flower pots for his plants. He needs 1.25 liters of soil for each pot. How many liters of soil does he need in total?
def solve() -> int: num_pots = 20 soil_per_pot = 1.25 total_soil = num_pots * soil_per_pot result = total_soil return result
Maya purchased a bike for $700 and 25% of her bike's value for accessories. If she had four times the money than the cost of the bike before the purchase, how much money does she have remaining?
def solve() -> int: bike_cost = 700 accessories_cost = 0.25 * bike_cost total_cost = bike_cost + accessories_cost money_before_purchase = total_cost / 0.25 money_remaining = money_before_purchase - total_cost result = money_remaining return result
A bakery sells 150 cupcakes and 50 cakes per day. How many desserts does it sell in a month if the month has 30 days?
def solve() -> int: cupcakes_per_day = 150 cakes_per_day = 50 days_per_month = 30 desserts_per_day = cupcakes_per_day + cakes_per_day desserts_per_month = desserts_per_day * days_per_month result = desserts_per_month return result
A rectangle has length 9cm and width 7cm. What is its area?
def solve() -> int: length = 9 width = 7 area = length * width result = area return result
``` Mark has 24 cupcakes and he wants to divide them evenly among his 6 children. How many cupcakes will each child get?
def solve() -> int: cupcakes_per_child = 24 // 6 result = cupcakes_per_child return result
A bell pepper costs $1.50 and a cucumber costs $1.00. If someone bought 2 bell peppers and 3 cucumbers, how much did they spend in total?
def solve() -> int: bell_pepper_cost = 1.5 cucumber_cost = 1 total_bell_pepper_cost = bell_pepper_cost * 2 total_cucumber_cost = cucumber_cost * 3 total_cost = total_bell_pepper_cost + total_cucumber_cost result = total_cost return result
Adrian has a rectangular garden that is 10 feet wide and 20 feet long. She wants to add a fence around the entire perimeter of the garden. How many feet of fence will she need?
def solve() -> int: width = 10 length = 20 perimeter = (2 * width) + (2 * length) result = perimeter return result
A laptop costs $800. The store is having a 15% discount sale. How much will the laptop cost after the discount?
def solve() -> int: original_price = 800 discount = 0.15 new_price = original_price - (original_price * discount) result = new_price return result
Taylor can mow a lawn in 4 hours. Kyle can mow the same lawn in 3 hours. How long would it take them to mow the lawn together?
def solve() -> int: taylor_time = 4 kyle_time = 3 taylor_rate = 1/taylor_time kyle_rate = 1/kyle_time combined_rate = taylor_rate + kyle_rate combined_time = 1/combined_rate result = combined_time return result
If it takes Alex and his team, the Sharks, 45 minutes to swim 2 laps across a pool, how many laps can they swim in 2 hours?
def solve() -> int: laps_per_time = 2/0.75 total_time = 2 total_laps = laps_per_time * total_time result = total_laps return result
The perimeter of a rectangle is 24 cm. If the width is 2 cm less than twice the length, what is the area of the rectangle?
def solve() -> int: perimeter = 24 w_l_ratio = 2 w_l_diff = 2 l = (perimeter / 2) / (w_l_ratio + 1) w = w_l_ratio * l - w_l_diff area = w * l result = area return result
The perimeter of a rectangle is 26 and one side is 7. What is the length of the other side?
def solve() -> int: perimeter = 26 known_side = 7 unknown_side = (perimeter - (2 * known_side)) / 2 result = unknown_side return result
If 3 pencils cost $0.75, how many pencils can you buy for $2.25?
def solve() -> int: cost_of_three_pencils = 0.75 cost_of_one_pencil = cost_of_three_pencils / 3 pencils_afforded = 2.25 / cost_of_one_pencil result = pencils_afforded return result
In a pond, fish feed on 5 insects each day. After 2 weeks, the water level rises and 20 more insects appear. One week later, a group of birds eats some of the fish. If there were 120 fish in the pond to start with, how many are left after the bird attack?
def solve() -> int: fish_per_day = 5 days_in_two_weeks = 14 insects_after_two_weeks = 20 days_in_one_week = 7 fish_start = 120 total_insects = fish_per_day * days_in_two_weeks + insects_after_two_weeks fish_after_bird_attack = fish_start - total_insects result = fish_after_bird...
A train travels at a speed of 60 miles per hour for 3 hours, then slows to 40 miles per hour for the next 2 hours. How many miles did the train travel in total?
def solve() -> int: speed_1 = 60 time_1 = 3 speed_2 = 40 time_2 = 2 distance_1 = speed_1 * time_1 distance_2 = speed_2 * time_2 total_distance = distance_1 + distance_2 result = total_distance return result
arah is knitting a scarf. For every inch of the scarf, she uses three yards of yarn. If Sarah wants to knit a scarf that is 5 feet long, how many yards of yarn will she need?
def solve() -> int: yards_of_yarn = 3 * (5*12) result = yards_of_yarn return result
Jennifer went to a store to buy cakes, ice cream, and donuts. She bought 5 cakes for $12 each, 8 ice creams for $4 each, and 3 donuts for $1 each. If she has $59, how much change was she given?
def solve() -> int: total_cakes = 5 * 12 total_ice_creams = 8 * 4 total_donuts = 3 * 1 total_purchases = total_cakes + total_ice_creams + total_donuts amount_given = 59 result = amount_given - total_purchases return result
The local farmers' market sells strawberries for $3.50 per pound. If Sarah bought $10.50 worth of strawberries, how many pounds of strawberries did she buy?
def solve() -> int: strawberries_price = 3.5 total_spent = 10.5 total_pounds = total_spent/strawberries_price result = total_pounds return result
Rachel has a ruler that is 20 cm long. She wants to cut it into 4 equal parts. How long will each part be?
def solve() -> int: ruler_length = 20 num_parts = 4 part_length = ruler_length / num_parts result = part_length return result
Emily bakes 3 batches of brownies each week. She plans to sell them at a bake sale, and wants to make 50 batches. If she has already baked 12 batches, how many more batches does she need to bake?
def solve() -> int: batches_per_week = 3 total_batches = 50 batches_baked = 12 batches_needed = total_batches - batches_baked result = batches_needed return result
In a class of 30 students, 60% of them passed a math test. If 20% of the students who passed were girls, how many boys passed the test?
def solve() -> int: num_students = 30 pass_percentage = 0.6 num_pass = num_students * pass_percentage girl_percentage = 0.2 num_girls_passed = num_pass * girl_percentage num_boys_passed = num_pass - num_girls_passed result = num_boys_passed return result
A classroom has 15 desks and five times as many chairs as desks. How many pieces of furniture total are in the classroom?
def solve() -> int: desks = 15 chairs_per_desk = 5 chairs = desks * chairs_per_desk furniture = desks + chairs result = furniture return result
Student: Bob traveled to Europe and exchanged 300 USD for Euros, getting 250 EUR. He spent 50 EUR on dinner one night and then another 75 EUR on souvenirs. If the exchange rate changes to 1 EUR = 1.1 USD, how much USD is Bob's remaining money worth now?
def solve() -> int: usd = 300 eur = 250 dinner = 50 souvenirs = 75 rate = 1.1 left = eur - dinner - souvenirs result = left * rate return result
A school has a total of 500 students. If 40% of the students are in 4th grade, how many 4th grade students are there?
def solve() -> int: total_students = 500 fourth_grade_percentage = 40/100 fourth_grade_students = total_students * fourth_grade_percentage result = fourth_grade_students return result
There are 132 pairs of shoes in a store and the storekeeper would like to distribute them evenly into 8 boxes. How many shoes should each box contain?
def solve() -> int: numberOfPairs = 132 numberOfBoxes = 8 numberOfShoesPerBox = numberOfPairs/numberOfBoxes result = numberOfShoesPerBox return result
An architect is working on a triangular design. The base of the triangle is 10 meters, and the height is 8 meters. What is the area of the triangle?
def solve() -> int: Base = 10 Height = 8 Area = 0.5 * Base * Height result = Area return result
A company has a total of 300 employees. 10% of them are engineers, 30% are assistants, and the rest are clerks. How many clerks does the company have?
def solve() -> int: engineers = 0.1*300 assistants = 0.3*300 clerks = 300 - engineers - assistants result = clerks return result
Result: 240 A company hired 20 new employees. Their average salary increased from $50,000 to $53,000. What is the total cost of the company's new payroll?
def solve() -> int: increase = 3000 new_salary = 53000 old_salary = new_salary - increase total_payroll = new_salary * 20 result = total_payroll return result
hirley needs to buy two books and a notebook from the store. The first book costs $25, the second book costs 20% more than the first one, and the notebook costs $9. How much does Shirley need to spend in total?
def solve() -> int: book_1 = 25 book_2 = book_1*1.2 notebook_cost = 9 total_cost = book_1 + book_2 + notebook_cost result = total_cost return result
8. Keith went to a restaurant and ordered 5 items for the table. The bill came out to $95. What was the average cost of each item?
def solve() -> int: total_bill = 95 number_of_items = 5 average_cost_per_item = total_bill / number_of_items result = average_cost_per_item return result
Jennifer needs 7 books for her book club. She has already bought 3 of them. Each book costs $9. How much more does Jennifer need to spend to buy all the books?
def solve() -> int: num_books = 7 books_bought = 3 book_cost = 9 total_cost = (num_books - books_bought) * book_cost result = total_cost return result
Student: A person invested $17,000 in the stock market. After 4 months, the person gained a profit of 25% from the investment. How much money did he gain in the 4 months?
def solve() -> int: investment = 17000 profit_rate = 0.25 months = 4 profit = investment * profit_rate final_amount = investment + profit result = profit return result
Chloe has a flower garden with 4 rows of flowers. Each row has 6 flowers of the same color. The first row has red flowers, the second row has yellow flowers, the third row has pink flowers and the fourth row has purple flowers. Chloe wants to make a bouquet with one flower from each row. How many different bouquets can...
def solve() -> int: rows = 4 flowers = 6 bouquets = flowers ** rows result = bouquets return result
There are 1000 pencils in a box. After 6 months, only 400 pencils are left, and if Sam took out the same amount each day, how many pencils did he take out in three days?
def solve() -> int: total_pencils = 1000 pencils_left = 400 months = 6 pencils_per_day = (total_pencils - pencils_left) / (months * 30) pencils_in_three_days = pencils_per_day * 3 result = pencils_in_three_days return result
Abigail bought 3 books at the bookstore. Each book cost $8.95. What was the total price of the books?
def solve() -> int: num_books = 3 price_per_book = 8.95 result = num_books*price_per_book return result
A container can hold 500 ml of water. If it is filled 40% with water and the rest with milk, how much milk is in the container?
def solve() -> int: total_volume = 500 water_volume = total_volume * 40 // 100 milk_volume = total_volume - water_volume result = milk_volume return result
Jason takes 30 minutes to mow his front yard and half as long to trim the hedges. Then he cycles on a 6-mile trail at 12 miles per hour. How much time does he spend in all?
def solve() -> int: mow_time = 30 trim_time = mow_time / 2 trail_distance = 6 trail_speed = 12 mow_time_in_hours = mow_time / 60 trim_time_in_hours = trim_time / 60 trail_time = trail_distance / trail_speed total_time = mow_time_in_hours + trim_time_in_hours + trail_time ...
Evan had some basketballs, and he gave two of them to Max. Now, Evan has 7 times as many basketballs as Max. If Max had 1 basketball at first, how many basketballs did Evan have at first?
def solve() -> int: max_basketballs = 1 evan_basketballs = max_basketballs + 2 evan_basketballs *= 7 result = evan_basketballs return result
Alex spent 5 hours doing 600 work tasks at $0.20 each. Then Alex spent 2 hours doing 15 work tasks at $1.75 each. How much more did Alex make doing the higher-paid work compared to the lower-paid work?
def solve() -> int: hours1 = 5 tasks1 = 600 rate1 = 0.20 hours2 = 2 tasks2 = 15 rate2 = 1.75 total1 = tasks1 * rate1 total2 = tasks2 * rate2 difference = total2 - total1 result = difference return result
Jake eats 1/4 pound of cheese per day. He buys them by the kilogram at a specialty shop. They are currently on sale for $20.00 per kilogram. If Jake wants to buy enough cheese to last him for 365 days, how much will he spend?
def solve() -> int: cheese_per_day = 1/4 price_per_kg = 20.00 days = 365 cheese_per_kg = 1 / 0.45359237 cheese_needed = cheese_per_day * days kg_needed = cheese_needed / cheese_per_kg total_cost = kg_needed * price_per_kg result = total_cost return result
A bus travels 120km in 2 hours. If the speed remains the same, how far will it travel in 3.5 hours?
def solve() -> int: distance = 120 time = 2 speed = distance / time time = 3.5 distance = speed * time result = distance return result
David owes Julie $800, which is half of what David owes Samantha. David decides to pay 75% of his debt to Julie, and Samantha pays Julie 60% of her total debt. If Julie's savings account has $200 in it and she adds the money she's been paid by her debtors to the savings account, what is the new balance in her savings?
def solve() -> int: davids_debt = 800 julies_debt = davids_debt * 2 samanthas_debt = julies_debt + davids_debt davids_payment = davids_debt * 0.75 samanthas_payment = samanthas_debt * 0.6 julies_savings = 200 + davids_payment + samanthas_payment result = julies_savings ret...
A train travels a distance of 500 km at a speed of 100 km/h. What is the total time the train spends on its journey?
def solve() -> int: distance = 500 speed = 100 time = distance / speed result = time return result
Josh wants to buy a new video game console for $600, but his parents will only give him an allowance of $20 a week. How many weeks does Josh need to save up for the console?
def solve() -> int: cost_of_console = 600 allowance = 20 number_of_weeks = cost_of_console/allowance result = number_of_weeks return result
Student: Kim earns $400 from her biweekly allowance. She wants to save up $2,000 for her tuition. How many months will it take for Kim to save up the total amount?
def solve() -> int: allowance = 400 total_amount = 2000 months = total_amount // allowance * 2 result = months return result
A toy factory produces toy helicopters and toy cars. There are a total of 450 toys. The number of toy helicopters is four times as many as the number of toy cars. How many toy helicopters are there?
def solve() -> int: total_toys = 450 toy_cars = total_toys / 5 toy_helicopters = 4 * toy_cars result = toy_helicopters return result
Ava is 20 years old. When she was born, her elder sister Emma was 14 years old. Ethan is their elder brother and is 8 years older than Emma. How old will Ethan be after 5 years?
def solve() -> int: ava_age = 20 emma_age = ava_age - 14 ethan_age = emma_age + 8 ethan_age_after_5_years = ethan_age + 5 result = ethan_age_after_5_years return result
Student: What is the area of a room that is 7 feet wide and 22 feet long?
def solve() -> int: width = 7 length = 22 area = width * length result = area return result
A toy store sells a robot for $15.50, a game for $8.75, and a puzzle for $4.80. If Aaron bought one of each and then a robot for his friend, how much did he spend in total?
def solve() -> int: robot = 15.50 game = 8.75 puzzle = 4.80 total = (robot + game + puzzle) + robot result = total return result
Student: Sarah has six times more pencils than Sam and four times more than Alex. If Sarah has 36 pencils, how many pencils do Sam and Alex have together?
def solve() -> int: sarah_pencils = 36 sam_pencils = sarah_pencils / 6 alex_pencils = sarah_pencils / 4 total_pencils = sam_pencils + alex_pencils result = total_pencils return result
Maria works in a store. She earns $11 per hour and works 6 hours per day. If she works for 5 days a week, how much will she earn in a week?
def solve() -> int: hours = 6 rate = 11 days = 5 total_earnings = hours * rate * days result = total_earnings return result
A company that sells laptops has a 30-day return period. If a customer buys a laptop on August 1st, by what date must they return the laptop to be eligible for a full refund?
def solve() -> int: purchase_date = 1 days_in_month = 30 max_return_date = purchase_date + days_in_month result = max_return_date return result
Rachel and Ryan were hired to work at a library for 16 hours per week each for 4 months. During that time, Ryan was selected for a conference and had to miss one week. Rachel covered his shifts. How many hours did Rachel work in total?
def solve() -> int: hours_per_week = 16 months = 4 total_hours = hours_per_week * months * 2 hours_missed = hours_per_week hours_worked_by_rachel = total_hours - hours_missed result = hours_worked_by_rachel return result
A recipe for a cake requires 2 cups of flour for every 1 cup of sugar. If you want to make a cake that requires 6 cups of flour, how much sugar do you need?
def solve() -> int: flour = 6 sugar = flour / 2 result = sugar return result
In Mrs. Green's art class there are 32 students. Of those students, 60 percent like painting. Of those who like painting, 40% also like sculpting. How many students like both painting and sculpting?
def solve() -> int: total_students = 32 painting_students = total_students * 0.6 sculpting_students = painting_students * 0.4 result = sculpting_students return result
Keenan and Sydney drove to deliver some documents. Sydney used 8 fewer bottles of gas than three times the number of bottles that Keenan used for her trip. Together they used 48 bottles of gas. How many bottles did Keenan use?
def solve() -> int: result = 16 bottles_keenan = 0 bottles_sydney = 0 total_bottles = 48 bottles_sydney = total_bottles - (8 + (3 * bottles_keenan)) bottles_keenan = (total_bottles - bottles_sydney) / 3 result = bottles_keenan return result
Olivia, the gardener, needs to water a garden. It takes her 0.2 hours to collect the hose, 0.5 hours to water the garden, and another 0.3 hours to put everything away. One day, the garden hose gets a puncture. It now takes her three times as long to water the garden. How long did it take Olivia to water the garden that...
def solve() -> int: collect_time = 0.2 water_time = 0.5 put_away_time = 0.3 total_time = collect_time + water_time + put_away_time water_time_puncture = water_time * 3 total_time_puncture = collect_time + water_time_puncture + put_away_time time_taken = total_ti...
A caterer needs to make 150 cookies for an event. If each batch of cookies makes 24 cookies and the ingredients for each batch cost $10, what will the total cost of the ingredients be?
def solve() -> int: num_cookies = 150 cookies_per_batch = 24 num_batches = num_cookies/cookies_per_batch cost_per_batch = 10 total_cost = num_batches*cost_per_batch result = total_cost return result
Kevin is four times as old as his daughter Lucy. If Lucy was 6 when Kevin was 36, how old will Kevin be when Lucy is 18?
def solve() -> int: age_diff = 36 / 4 age_diff_2 = 18 - 6 kevin_age = 36 + age_diff + age_diff_2 result = kevin_age return result
A food company has 500 employees. If the company provides 1 microwave for every 10 employees and 1 fridge for every 15 employees, how many microwaves and fridges does the company need?
def solve() -> int: microwaves = 500 // 10 fridges = 500 // 15 result = microwaves, fridges return result
Aiden has 5 cats and each cat has 4 legs. How many legs are there in total?
def solve() -> int: a_cats = 5 l_legs = 4 total_legs = a_cats * l_legs result = total_legs return result
A train covers a distance of 1000 km in 12 hours. If it maintains the same speed, how long will it take to cover a distance of 1500 km?
def solve() -> int: speed = 1000/12 time = 1500/speed result = time return result
In a book club, the ratio of fiction books to non-fiction books is 2:3. If there are 70 books in the club, how many of them are fiction?
def solve() -> int: fiction_books = 2 non_fiction_books = 3 total_books = 70 fiction_books = (fiction_books / (fiction_books + non_fiction_books)) * total_books result = fiction_books return result
Student: A rectangular pool has a length of 20m and a width of 10m. It needs to be refilled, but the hose fills only 0.5m^3 of water per minute. How many hours will it take to completely fill the pool?
def solve() -> int: length = 20 width = 10 fill_rate = 0.5 volume = length * width * 1 time = volume / fill_rate time = time / 60 result = time return result
Ava's grandmother is 8 times as old as Ava's rabbit. If in 9 years, Ava's grandmother will be 72 years old, how old is Ava's rabbit now?
def solve() -> int: grandmother_age = 72 - 9 rabbit_age = grandmother_age / 8 result = rabbit_age return result
A bakery sells cupcakes for $2 each and muffins for $3 each. They have a special offer that if you buy 10 or more cupcakes, you get a $5 discount. Joe wants to buy 12 cupcakes and 6 muffins. How much money does he need to pay?
def solve() -> int: cupcake_price = 2 muffin_price = 3 cupcakes = 12 muffins = 6 cupcake_cost = cupcake_price * cupcakes if cupcakes >= 10: discount = 5 else: discount = 0 cupcake_cost = cupcake_cost - discount muffin_cost = muffin_price * muffins ...
If a box contains 500 grams of tea that is 30% denser than normal tea and is 90% full, what is the weight of the tea in the box?
def solve() -> int: normal_tea_density = 1.0 tea_density = normal_tea_density * 1.3 box_volume = 1000 tea_volume = box_volume * 0.9 tea_weight = tea_volume * tea_density result = tea_weight return result
Oliver and Ava were both born on October 6th, but in different years. To consolidate celebrations they also got married on October 6th when Oliver turned 28. If today they're celebrating 19 years of marriage and their combined age is exactly 6 times what Oliver's age was when they married, how old was Ava when they got...
def solve() -> int: oliver_age_when_married = 28 years_of_marriage = 19 oliver_current_age = oliver_age_when_married + years_of_marriage combined_age_when_married = 6 * oliver_age_when_married ava_age_when_married = combined_age_when_married - oliver_age_when_married result =...
A pack of gum has 5 calories. Jessica does not want to consume more than 50 calories from gum per day. If she chews 10 pieces of gum, how many calories will Jessica have exceeded her limit?
def solve() -> int: calories_per_gum = 5 daily_limit = 50 gum_pieces = 10 total_calories = calories_per_gum * gum_pieces exceeded_calories = total_calories - daily_limit result = exceeded_calories return result
A swimming pool is 15 meters long, 10 meters wide, and 2 meters deep. If the pool is being filled with water at a rate of 7 liters per second, how many hours will it take to fill the pool completely?
def solve() -> int: length = 15 width = 10 depth = 2 total_volume = length * width * depth water_per_second = 7 water_per_hour = water_per_second * 60 * 60 hours_to_fill = total_volume / water_per_hour result = hours_to_fill return result
Student: Sharon used her calculator to find the area of a rectangle with a length of 15 cm and a width of 10 cm. Then she found the area of a square with a side length of 12 cm. The third shape she calculated had an area that was 25 more than the difference between the areas of the rectangle and the square. What was th...
def solve() -> int: rectangle_length = 15 rectangle_width = 10 square_side_length = 12 rectangle_area = rectangle_length * rectangle_width square_area = square_side_length ** 2 difference = rectangle_area - square_area third_shape_area = difference + 25 result = rectangle_area + square_a...