question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Sarah is getting ready for a long walk. She packs 10 pounds of water, 6 pounds of snacks, and 14 pounds of clothing. During her hike, she drinks 1/2 gallon of water per hour and eats 1/4th the weight of snacks per hour as water per hour. How much weight is she carrying after seven hours?
def solve() -> int: water_weight = 10 snacks_weight = 6 clothing_weight = 14 water_consumed = 1/2 * 7 snacks_consumed = 1/4 * water_consumed total_weight = water_weight - water_consumed + snacks_weight - snacks_consumed + clothing_weight result = total_weight return result...
A recipe calls for 2 tablespoons of butter and makes 6 cookies. If you want to make 36 cookies, how much butter do you need?
def solve() -> int: butter_per_cookie = 2 / 6 total_cookies = 36 total_butter = butter_per_cookie * total_cookies result = total_butter return result
Student: After buying a set of 10 pencils, Elaine gave 2 pencils to Sarah, 4 pencils to Rick and kept the remaining for herself. How many pencils did Elaine keep?
def solve() -> int: pencils_bought = 10 pencils_given_to_sarah = 2 pencils_given_to_rick = 4 pencils_kept_by_elaine = pencils_bought - pencils_given_to_sarah - pencils_given_to_rick result = pencils_kept_by_elaine return result
Some possible new questions are: Lucas is baking a cake for his sister's birthday. He needs to cut the cake into 12 equal slices and decorate each slice with a strawberry. He also wants to write "Happy Birthday" on the cake with chocolate syrup. He has a bottle of chocolate syrup that contains 8 ounces and each letter ...
def solve() -> int: letters = 12 syrup_per_letter = 0.2 syrup_needed = letters * syrup_per_letter syrup_price = 3 bottles_needed = syrup_needed / 8 syrup_cost = bottles_needed * syrup_price strawberries = 12 strawberry_price = 0.25 discount = 0.2 strawberry_cost = strawb...
David and his friend Rachel each earned $15 for mowing their neighbor's lawn. If they decide to buy a large pizza for $23, how much more money will they need to cover the cost, and how much change will they have left?
def solve() -> int: david_earnings = 15 rachel_earnings = 15 total_earnings = david_earnings + rachel_earnings pizza_cost = 23 remaining_money = total_earnings - pizza_cost change = total_earnings - remaining_money result = f'<<<{remaining_money}>>>, <<<{change}>>>' return result
Henry makes pizza. He needs 2 cups of cheese for one pizza. He has 10 cups of cheese in his fridge. How many pizzas can he make with the cheese he has?
def solve() -> int: cheese_needed = 2 cheese_available = 10 pizzas = cheese_available // cheese_needed result = pizzas return result
Student: Jacob is baking cupcakes. He needs 12 eggs for the cake mix. He currently has 5 cartons, each containing 6 eggs. How many cupcakes can he make?
def solve() -> int: cartons = 5 eggs_per_carton = 6 eggs_needed = 12 total_eggs = cartons * eggs_per_carton cupcakes = total_eggs // eggs_needed result = cupcakes return result
Every weekend, Lisa makes oatmeal for her family. She and her husband each eat 1 cup, while her child eats half a cup. If a container of oatmeal makes 5 cups, how many containers will she need for a year?
def solve() -> int: cups_per_weekend = 2 child_cups_per_weekend = 0.5 total_cups_per_weekend = cups_per_weekend + child_cups_per_weekend containers_per_weekend = total_cups_per_weekend / 5 weekends_per_year = 52 containers_per_year = containers_per_weekend * weekends_per...
On Wednesday, Kim made 16 bracelets for her craft fair. On Thursday, she made 6 more than on Wednesday. On Friday, she sold half of what she made on Thursday. How many bracelets did she have left after Friday?
def solve() -> int: wednesday = 16 thursday = wednesday + 6 friday = thursday / 2 result = wednesday + thursday - friday return result
Q8: Sam had 50 cards, but gave away 8 of them. He then won 9 more cards. Tara has 10 more than one fifth of what Sam has now. How many cards does Tara have?
def solve() -> int: sam = 50 sam = sam - 8 sam = sam + 9 sam_fifth = sam * 1/5 tara = sam_fifth + 10 result = tara return result
A store sells hats for $15 and shirts for $20. On Monday, the store sold 50 hats and 30 shirts. On Tuesday, the store sold 40 hats and 25 shirts. On Wednesday, the store sold 35 hats and 40 shirts. How much money did the store make overall?
def solve() -> int: num_hats_monday = 50 num_shirts_monday = 30 num_hats_tuesday = 40 num_shirts_tuesday = 25 num_hats_wednesday = 35 num_shirts_wednesday = 40 hat_price = 15 shirt_price = 20 total_sales = (num_hats_monday + num_hats_tuesday + num_hats_wednesday) * hat_price ...
Student: A bank offers a savings account with 0.5% annual interest rate. If you deposit $500 into the account, how much will you have after 3 years?
def solve() -> int: principal = 500 rate = 0.005 time = 3 interest = principal * rate * time total = principal + interest result = total return result
There are 240 students at a music school. If 30% of them play guitar and 20% of those who do not play guitar play piano, how many students play piano?
def solve() -> int: num_guitar_players = 240 * 0.30 num_non_guitar_players = 240 - num_guitar_players num_piano_players = num_non_guitar_players * 0.20 result = num_piano_players return result
The Zebra Army Base has 300 more than twice as many submarines as the Lion Army Base, and 50 less than half as many rockets as the Lion Army Base. The Gorilla Army Base has 8 times as many grenades as the Lion Army Base. If the Lion Army Base has a total of 6000 war supplies, how many do the four army bases have altoge...
def solve() -> int: lion_subs = 0.5 * 6000 zebra_subs = 2 * lion_subs + 300 zebra_rockets = 0.5 * 6000 - 50 gorilla_grenades = 8 * lion_subs total_supplies = lion_subs + zebra_subs + zebra_rockets + gorilla_grenades result = total_supplies return result
Jacob went to the hardware store and bought 3 cans of paint, a brush, and 2 rollers. If the brush cost $5 and the rollers cost $3 each, and Jacob spent a total of $24, how much did each can of paint cost?
def solve() -> int: brush_cost = 5 roller_cost = 3 total_cost = 24 num_rollers = 2 num_cans = (total_cost - (brush_cost + (num_rollers * roller_cost))) / 3 result = num_cans return result
A watch costs $250. Tom has $100 and wants to save the remaining amount in 3 months by saving equal amounts of money every week. How much should he save per week?
def solve() -> int: weekly_payment = (250-100) / (3*4) result = weekly_payment return result
A rectangular garden has a length of 15 meters and a width of 10 meters. If you want to build a fence around the perimeter of the garden, how many meters of fence do you need?
def solve() -> int: garden_length = 15 garden_width = 10 perimeter = 2*(garden_length + garden_width) result = perimeter return result
A grocery store has 15 apples. The number of oranges is 6 times the number of apples and the number of bananas is 4 times the number of oranges. The number of pears is half the number of oranges and there are 5 fewer grapes than pears. What is the difference in number between the grapes and the bananas?
def solve() -> int: apples = 15 oranges = 6 * apples bananas = 4 * oranges pears = oranges / 2 grapes = pears - 5 difference = grapes - bananas result = difference return result
Olivia collected 120 stones. She gave 1/3 of the stones to her brother and 1/4 of the remaining to her friend. How many stones did Olivia give to her brother?
def solve() -> int: stones_collected = 120 stones_given_to_brother = stones_collected * (1/3) remaining_stones = stones_collected - stones_given_to_brother stones_given_to_friend = remaining_stones * (1/4) result = stones_given_to_brother return result
Student: Two friends each buy cookies. The first friend buys 5 boxes of cookies for $4 each and the second friend buys 3 boxes for $5 each. What is the total price for the 8 boxes of cookies?
def solve() -> int: box1 = 5 price1 = 4 box2 = 3 price2 = 5 total_price = (box1 * price1) + (box2 * price2) result = total_price return result
Olivia is baking cookies and needs 1/2 a cup of sugar for each batch. If she has 6 cups of sugar, how many batches of cookies can she make?
def solve() -> int: sugar_per_batch = 1/2 total_sugar = 6 batches = total_sugar / sugar_per_batch result = batches return result
Alex spent 30% more time studying for his final exam this year than he did last year. Last year, he spent 2 hours studying and paid a tutor $25 per hour. This year, he paid a different tutor 1.5 times as much per hour to study. What was the total cost of his tutoring for both years?
def solve() -> int: last_year_hours = 2 last_year_rate = 25 this_year_rate = last_year_rate * 1.5 this_year_hours = last_year_hours * 1.3 last_year_cost = last_year_hours * last_year_rate this_year_cost = this_year_hours * this_year_rate total_cost = last_year_cost + this_year...
A company produces 1000 units of a product per day. Each unit costs $4 to produce and they sell each unit for $10. If they sell 80% of their daily production, how much profit did they make in a week (7 days)?
def solve() -> int: daily_production = 1000 unit_cost = 4 unit_price = 10 sell_percentage = 0.8 daily_profit = (unit_price - unit_cost) * daily_production * sell_percentage weekly_profit = daily_profit * 7 result = weekly_profit return result
James is a scientist who needs to mix some chemicals and twice as much water. If he needs to mix a total of 60 units of chemicals and water today and mixes seven times as much water as chemicals, how many units of chemicals does he need to mix?
def solve() -> int: chemicals = 20 result = chemicals return result
Student: Susan stayed at a hotel for 3 nights, and the hotel charged $35 per night plus a $78 flat fee for the whole stay. How much was the total charge for her stay?
def solve() -> int: nights = 3 rate = 35 fee = 78 total = rate * nights + fee result = total return result
Sarah is making vegetarian chili. A can of black beans costs $1.00, a can of crushed tomatoes costs $2.50, and an onion costs $0.75. The recipe requires 3 cans of black beans, 2 cans of crushed tomatoes, and 1 onion. The recipe yield is 8 servings. How much does each serving cost?
def solve() -> int: black_beans_cost = 1.00 crushed_tomatoes_cost = 2.50 onion_cost = 0.75 black_beans_needed = 3 crushed_tomatoes_needed = 2 onion_needed = 1 recipe_yield = 8 total_cost = (black_beans_cost*black_beans_needed + crushed_tomatoes_cost*crushed_tomatoes_needed + onion_cost*o...
am buys 4 packs of stickers every month for 6 months. Each pack has 24 stickers and he uses one-third of them for his scrapbook. How many stickers does he have left after 6 months?
def solve() -> int: packs = 4 months = 6 stickers_per_pack = 24 fraction_used = 1/3 total_stickers = packs * months * stickers_per_pack stickers_used = total_stickers * fraction_used stickers_left = total_stickers - stickers_used result = stickers_left retur...
Emily was originally able to read 50 pages of a book in one hour. After some training, she was able to increase her reading speed by 30%. She then decided to specialize and was able to read an extra 5 pages per hour. How many pages can she read in 2.5 hours now?
def solve() -> int: original_speed = 50 increase_percentage = 30 extra_pages = 5 hours = 2.5 increased_speed = original_speed + (original_speed * increase_percentage / 100) total_pages = increased_speed * hours + extra_pages result = total_pages return result
``` A recipe calls for 3 cups of flour, 2 cups of sugar, and 4 eggs. If you want to make the recipe half of the original, how many eggs do you need?
def solve() -> int: half_eggs = 4 / 2 result = half_eggs return result
A rectangle has a length of 8cm and a width of 5cm. What is the area of the rectangle in square centimeters?
def solve() -> int: length = 8 width = 5 area = length * width result = area return result
arah can bake 12 cupcakes in 8 minutes, how much time does it take her to bake 72 cupcakes?
def solve() -> int: num_cupcakes = 72 num_cupcakes_per_minute = 12 minutes = num_cupcakes/num_cupcakes_per_minute result = minutes return result
Rachel watched 4 movies on Monday and 3 movies on Tuesday. Kevin watched 1 more movie than Rachel on Monday and twice as many movies as Rachel on Tuesday. How many movies did Kevin watch in total?
def solve() -> int: rachel_monday = 4 rachel_tuesday = 3 kevin_monday = rachel_monday + 1 kevin_tuesday = rachel_tuesday * 2 kevin_total = kevin_monday + kevin_tuesday result = kevin_total return result
A dance group has 7 members and they practice twice a week. If each practice lasts 2 hours and they practice for 4 weeks, how many hours do they practice in total?
def solve() -> int: members = 7 practice_per_week = 2 hours_per_practice = 2 weeks = 4 total_hours = members * practice_per_week * hours_per_practice * weeks result = total_hours return result
In a restaurant, a plate of spaghetti costs $9, and a pizza is sold for $12.50. Emma and her friends ordered 3 plates of spaghetti, 2 pizzas, and also two drinks which cost $4 per drink. How much did they need to pay in total?
def solve() -> int: spaghetti_cost = 9 pizza_cost = 12.5 num_spaghetti = 3 num_pizzas = 2 drink_cost = 4 num_drinks = 2 spaghetti_total = num_spaghetti * spaghetti_cost pizza_total = pizza_cost * num_pizzas drink_total = drink_cost * num_drinks total_cost = spaghetti_total + pizz...
In a farm, 4 farmers harvest 7 acres of land in an hour. As a group, they harvest an additional acre every 9 hours. How many acres have been harvested after 18 hours?
def solve() -> int: farmers = 4 land_per_hour = 7 additional_land_per_hour = 1/9 total_land_harvested = farmers * land_per_hour * 18 + farmers * additional_land_per_hour * (18//9) result = total_land_harvested return result
Mark sells smoothies for $4 each. If a cup of frozen berries costs $1, a cup of almond milk costs $0.80, and a teaspoon of honey costs $0.05, how much does it cost Mark to make one smoothie that contains one cup of each ingredient and one teaspoon of honey?
def solve() -> int: cup_of_frozen_berries_cost = 1 cup_of_almond_milk_cost = 0.80 teaspoon_of_honey_cost = 0.05 smoothie_cost = cup_of_frozen_berries_cost + cup_of_almond_milk_cost + teaspoon_of_honey_cost result = smoothie_cost return result
The cost of a camping trip is $50 per person. If 6 people went camping and each person paid for themselves, how much was the total cost?
def solve() -> int: num_people = 6 cost_per_person = 50 total_cost = num_people * cost_per_person result = total_cost return result
A car rental company has 50 cars. 30% of them are sedans, and 50% of the rest are SUVs. If the number of SUVs is 6 more than the number of sedans, how many SUVs are there?
def solve() -> int: num_sedans = 0 num_suvs = 0 total_cars = 50 num_sedans = 0.3 * total_cars num_suvs = (total_cars - num_sedans) * 0.5 + 6 result = int(num_suvs) return result
Max wants to ride the drop tower ride. The minimum height to ride the drop tower ride is 130 cm. Max's sister is 150 cm, Max is 4/5 the height of his sister. How many more centimeters does Max need to grow to ride the drop tower ride?
def solve() -> int: sister_height = 150 max_height = (4/5) * sister_height minimum_height = 130 height_difference = minimum_height - max_height result = height_difference return result
Anastasia put $250 into a savings account that pays a 10% interest rate every year. How much money does she have after 5 years?
def solve() -> int: principle = 250 interest_rate = 0.10 year = 5 interest = principle * interest_rate * year result = principle + interest return result
During the year, Sarah's stock portfolio doubled in value. If she sold $500 worth of stock at the end of the year and her current portfolio value is $1,500, how much was her portfolio worth at the beginning of the year?
def solve() -> int: portfolio_end = 1500 sold = 500 portfolio_start = (portfolio_end - sold) / 2 result = portfolio_start return result
Noah paints rocks. He bought 4 bottles of 25 milliliters of paint and 2 bottles of 50 milliliters of paint. If he uses 5 milliliters of paint to paint one rock, how many rocks will Noah be able to paint out of the paint he bought?
def solve() -> int: paint_per_bottle1 = 25 paint_per_bottle2 = 50 bottles_bought1 = 4 bottles_bought2 = 2 paint_per_rock = 5 total_paint = (paint_per_bottle1 * bottles_bought1) + (paint_per_bottle2 * bottles_bought2) rocks = total_paint // paint_per_rock result = rocks return result...
A toy store sells action figures and stuffed animals. For every action figure you buy, you must buy 2 stuffed animals which cost 1/8 the price of the action figures. If the store sold 50 action figures and earned $500, how much do stuffed animals cost?
def solve() -> int: action_figures = 50 action_figure_cost = 500 / 50 stuffed_animals_cost = action_figure_cost / 8 one_stuffed_animal_cost = stuffed_animals_cost / 2 result = one_stuffed_animal_cost return result
Brian buys 10 comics for $23, and receives a discount of $3. How much does he pay after the discount?
def solve() -> int: initial_amount_paid = 23 discount = 3 final_amount_paid = initial_amount_paid - discount result = final_amount_paid return result
A triangle has sides of length 10 cm, 15 cm, and 18 cm. Is it a right triangle?
def solve() -> int: a = 10 b = 15 c = 18 if a ** 2 + b ** 2 == c ** 2 or b ** 2 + c ** 2 == a ** 2 or c ** 2 + a ** 2 == b ** 2: is_right_triangle = True else: is_right_triangle = False result = is_right_triangle return result
A shirt costs $25 and is on sale for 15% off. A pair of jeans costs $40 and is on sale for 10% off. How much does Adam pay for the shirt and the jeans after the sale, if he also has to pay 5% sales tax?
def solve() -> int: shirt_discount = 25 * 0.15 shirt_sale = 25 - shirt_discount jeans_discount = 40 * 0.1 jeans_sale = 40 - jeans_discount subtotal = shirt_sale + jeans_sale sales_tax = subtotal * 0.05 total = subtotal + sales_tax total = round(total, 2) result = f'Adam pays $...
Megan, Lucy, and Noah share a bag of candies. Megan has 12 more candies than Lucy, but Lucy has 3 times as many candies as Noah. If Noah has 9 candies, how many candies are in the bag?
def solve() -> int: noah = 9 lucy = 3 * noah megan = lucy + 12 total = noah + lucy + megan result = total return result
A company produces 200 units of a product each day. The cost of producing one unit is $10. They sell each unit for $15. If they produce the product for 5 days in a week and sell all the units, what is their weekly profit?
def solve() -> int: units_produced_per_day = 200 unit_cost = 10 unit_price = 15 days_in_week = 5 units_sold_per_week = units_produced_per_day*days_in_week weekly_profit = units_sold_per_week*(unit_price-unit_cost) result = weekly_profit return result
Amanda had 120 stickers. She traded one-fifth of her stickers for colored pencils and two-thirds of her stickers for stickers of her favorite cartoon character. After that, she was left with 15 stickers. Then, her grandfather gifted her four times the number of stickers she had left. How many stickers does Amanda have ...
def solve() -> int: initial_stickers = 120 colored_pencils = initial_stickers / 5 cartoon_stickers = initial_stickers * 2 / 3 left_stickers = initial_stickers - colored_pencils - cartoon_stickers grandfather_stickers = left_stickers * 4 total_stickers = left_stickers + g...
A pack of cookies contains 12 cookies. Ben eats 3 cookies and shares the rest equally with his 4 friends. How many cookies does each person get?
def solve() -> int: cookies_left = 12 - 3 cookies_per_person = cookies_left / 5 result = round(cookies_per_person, 2) return result
Zoe bought a package of 20 face masks for $8. If she plans to sell each mask for $0.50, how many masks will she need to sell to recoup her initial investment?
def solve() -> int: total_masks = 20 cost = 8 selling_price = 0.50 total_cost = total_masks * cost masks_needed = total_cost / selling_price result = masks_needed return result
- A fruit stand sells apples for $2 per kilogram and bananas for $3 per kilogram. A customer buys 3 kilograms of apples and 2 kilograms of bananas. The customer also has a coupon that gives a 15% discount for the total purchase. How much does the customer pay after using the coupon?
def solve() -> int: apple_price = 2 banana_price = 3 coupon_discount = 0.15 apple_weight = 3 banana_weight = 2 apple_total = apple_price * apple_weight banana_total = banana_price * banana_weight total_price = apple_total + banana_total coupon_price = total_price * (1 - coupo...
Student: Prince purchased 4 bottles of soda each containing 16 fluid ounces. How many total ounces of soda did he buy?
def solve() -> int: bottles = 4 ounces_per_bottle = 16 total_ounces = bottles * ounces_per_bottle result = total_ounces return result
A bookshelf has 3 shelves. Each shelf can hold 10 books. If there are already 17 books on the shelf, how many more books can fit?
def solve() -> int: shelves = 3 shelf_capacity = 10 books_on_shelf = 17 books_can_fit = (shelves * shelf_capacity) - books_on_shelf result = books_can_fit return result
Emily is planning a road trip and wants to calculate the cost of gas. She will be driving 500 miles and her car gets 20 miles per gallon of gas. If gas costs $3.00 per gallon, how much will Emily spend on gas for the whole trip?
def solve() -> int: distance = 500 fuel_efficiency = 20 gas_cost = 3.00 total_gas = distance / fuel_efficiency total_cost = total_gas * gas_cost result = total_cost return result
am ran 12 miles in 2 hours. Stephen ran 6 miles in 1 hour. How many more miles did Sam run than Stephen per hour?
def solve() -> int: sam_speed = 12 / 2 stephen_speed = 6 result = sam_speed - stephen_speed return result
Student: Jim can finish 80 pages in 40 minutes. How long, in minutes, would it take him to finish 120 pages?
def solve() -> int: pages = 120 time_for_80_pages = 40 time_for_120_pages = time_for_80_pages * (pages / 80) result = time_for_120_pages return result
Mia can knit a scarf in 4 hours. If she wants to knit 3 scarves in a week, and she has already knitted 2 scarves, how many more hours does she need to spend knitting in order to make all 3 scarves?
def solve() -> int: scarf_time = 4 total_scarves = 3 scarves_knitted = 2 scarves_left = total_scarves - scarves_knitted total_time = scarf_time * scarves_left result = total_time return result
Student: 6. If Sarah has eight notebooks and each one costs $3.50, how much money does she need for all eight notebooks?
def solve() -> int: num_notebooks = 8 cost_per_notebook = 3.50 total_cost = num_notebooks * cost_per_notebook result = total_cost return result
In a car dealership, there are SUVs, sedans, and trucks. There are eight more than 3 times the number of sedans as trucks. There are 4 less SUVs than trucks. If there are 244 vehicles, how many sedans are there?
def solve() -> int: trucks = 0 suv = 0 sedans = 0 trucks = suv + 4 sedans = 3 * trucks + 8 suv = 244 - sedans - trucks result = sedans return result
A baseball team has 25 players. If each player needs to drink 5 ounces of water per inning and there are 9 innings in a game, how many gallons of water are needed for each game?
def solve() -> int: num_of_players = 25 water_needed_per_inning = 5/128 num_of_innings = 9 water_needed_per_game = num_of_players * water_needed_per_inning * num_of_innings result = water_needed_per_game return result
John has 24 pencils. Sarah has two times as many pencils as John plus 5. How many pencils does Sarah have?
def solve() -> int: pencils_john = 24 pencils_sarah = 2 * pencils_john + 5 result = pencils_sarah return result
Evan is buying nuts from the store. One bag of nuts costs $4. Evan buys 12 bags of nuts. How much money does Evan spend?
def solve() -> int: price_per_bag = 4 number_of_bags = 12 result = price_per_bag * number_of_bags return result
Student: Mrs. Lee planted 50 tulips and 5 times as many roses in her garden. What is the difference between the number of tulips and the number of roses?
def solve() -> int: tulips = 50 roses = tulips * 5 difference = tulips - roses result = difference return result
James is making a $20,000 loan. If the notice rate is 5% and the loan is to be paid back in 30 months, how much will James have to pay each month?
def solve() -> int: loan_amount = 20000 interest_rate = 0.05 months = 30 monthly_payment = loan_amount * (interest_rate/12) * ((1+interest_rate/12)**months) / ((1+interest_rate/12)**months - 1) result = monthly_payment return result
John has a game on his phone where he gets double points every day. On the first day, he scores 10 points. How many points will he have after 7 days?
def solve() -> int: points = 10 for i in range(1, 8): points *= 2 result = points return result
``` Tom has $200 in his bank account. He withdrew $50 and spent $20 on clothes. He then won $100 in a lottery. He then went and bought a watch for $85. How much money does he have left?
def solve() -> int: money_left = 200 - 50 - 20 + 100 - 85 result = money_left return result
A movie theater sells tickets for $10 each. On the first day of the new movie release, 30 people bought tickets. On the second day, 40 people bought tickets, but on the third day, there was an 8% increase in the number of tickets sold. Calculate the total income of the theater.
def solve() -> int: ticket_price = 10 day1_tickets_sold = 30 day2_tickets_sold = 40 day3_tickets_sold = day2_tickets_sold*1.08 total_tickets_sold = day1_tickets_sold + day2_tickets_sold + day3_tickets_sold total_income = total_tickets_sold*ticket_price result = total_income return resul...
A recipe calls for 3 cups of flour for every 2 cups of sugar. If you want to make a cake with 12 cups of flour, how many cups of sugar do you need?
def solve() -> int: flour = 3 sugar = 2 needed_flour = 12 needed_sugar = (sugar / flour) * needed_flour result = needed_sugar return result
Karen's age is five times what it was ten years ago. How old is Karen?
def solve() -> int: age_ten_years_ago = 0 karens_age = 0 age_ten_years_ago = karens_age / 5 karens_age = age_ten_years_ago + 10 result = karens_age return result
Student: Anna has seven times as many pens as pencils. If she has 56 pens, how many pencils does she have?
def solve() -> int: pens = 56 pencils = 0 pencils = pens / 7 result = pencils return result
Anna likes to read at night and uses a bedside lamp that uses 40 watts per hour. Her ceiling fan is also on to cool down the room and uses 120 watts per hour. The hallway light outside her door is always on and uses 20 watts per hour. If Anna reads for two hours before going to sleep, how many watts has she used?
def solve() -> int: bedside_lamp = 40 ceiling_fan = 120 hallway_light = 20 total_energy = (bedside_lamp + ceiling_fan + hallway_light) * 2 result = total_energy return result
Student: How much money will Mark save if he buys a laptop for $720 with a 10% discount?
def solve() -> int: price = 720 discount = 0.1 saving = price * discount total_price = price - saving result = saving return result
A container holds 350 liters of water. If 20% of the water in the container is used in cooking, calculate the volume of water used for cooking.
def solve() -> int: water_in_container = 350 percent_used = 20 water_used_for_cooking = (percent_used/100) * water_in_container result = water_used_for_cooking return result
John works as a postal worker. Every morning he sorts letters for 12 minutes, and for every person on his route, he spends 5 minutes delivering and 2 minutes collecting outgoing mail. If John has 15 people on his route, how long does his morning routine take?
def solve() -> int: sort_time = 12 delivery_time = 0 outgoing_time = 0 num_people = 15 delivery_time = num_people*5 outgoing_time = num_people*2 total_time = sort_time + delivery_time + outgoing_time result = total_time return result
A book costs $15. If the bookstore offers a discount of 10%, what is the final price of the book?
def solve() -> int: book_price = 15 discount_percentage = 0.10 discount_amount = book_price * discount_percentage final_price = book_price - discount_amount result = final_price return result
Kate bought a painting for $2,000. Its value increased by 40% and she then sold 25% of it. What was the selling price?
def solve() -> int: initial_price = 2000 increase_percentage = 40 selling_percentage = 25 increased_value = initial_price * (increase_percentage / 100) final_price = initial_price + increased_value selling_price = final_price * (1 - (selling_percentage / 100)) result = se...
Student: The price of a shirt is $25 but there is a 20% discount. How much is the discounted price?
def solve() -> int: price = 25 discount = 0.2 discounted_price = price * (1 - discount) result = discounted_price return result
If Karen has a bag with 12 marbles: 4 red, 3 blue, and 5 green marbles, what is the probability of drawing a blue marble, and then a red marble (without replacement)?
def solve() -> int: numerator = 3/12 * 4/11 result = numerator return result
Emma and Lucas are organizing a potluck. They have 2 lasagnas, 3 pans of enchiladas, and 1 tray of meatballs. If each guest will have 2 servings, how many guests can they serve?
def solve() -> int: lasagnas = 2 enchiladas = 3 meatballs = 1 servings_per_guest = 2 total_servings = lasagnas + enchiladas + meatballs guests = total_servings // servings_per_guest result = guests return result
Juan has a lawnmower that advertised an estimated mowing capacity of 30 square meters. The lawnmower's gas tank can hold 2 liters. He filled his lawnmower full of gas and was able to mow a total of 25 square meters. What was the difference, in square meters, between Juan's mowing capacity and the advertised mowing capa...
def solve() -> int: mowing_capacity = 30 gas_tank_capacity = 2 mowed_area = 25 area_per_liter = mowing_capacity / gas_tank_capacity actual_mowing_capacity = area_per_liter * gas_tank_capacity difference = mowing_capacity - actual_mowing_capacity result = difference re...
Rachel always wins the award for traveling to the most places over the summer. This year is no different. Summer break is 100 days long. WhenAngela is a painter and has to climb ladders multiple times a day. She climbs her full ladder, which has 8 steps, 12 times today. She also climbs her smaller ladder, which has 4 s...
def solve() -> int: summer_days = 100 full_ladder_steps = 8 full_ladder_climbs = 12 small_ladder_steps = 4 small_ladder_climbs = 5 total_steps = full_ladder_steps * full_ladder_climbs + small_ladder_steps * small_ladder_climbs result = total_steps * summer_days ...
am is baking a cake for his friend's birthday. The recipe calls for 250 grams of flour, 150 grams of sugar, 100 grams of butter, and 4 eggs. Sam has a kitchen scale that can measure in grams, but not in eggs. He knows that one egg weighs about 50 grams on average. How many grams of ingredients does he need in total for...
def solve() -> int: f = 250 s = 150 b = 100 e = 4 * 50 g = f + s + b + e result = 'He needs'+ str(g) +'grams of ingredients in total for the cake.' return result
In a picnic, there are 90 people. 10 people brought 5 sandwiches each, 25 people brought 3 sandwiches each, and the rest brought 1 sandwich each. How many sandwiches were brought altogether on average?
def solve() -> int: num_people = 90 num_sandwiches = 10*5 + 25*3 + (num_people-10-25)*1 average_sandwiches = num_sandwiches / num_people result = average_sandwiches return result
Nina has 30 coins, consisting of quarters and nickels. If the total value of her coins is $4.55, how many nickels does Nina have?
def solve() -> int: total_coins = 30 coin_sum = 4.55 quarter_value = 0.25 nickel_value = 0.05 quarter_num = (coin_sum - (nickel_value * total_coins)) / (quarter_value - nickel_value) nickel_num = total_coins - quarter_num result = nickel_num return result
imon has four uncles. If the number of Sam's uncles is two less than five times the number of Simon's uncles, what is the number of Sam's uncles?
def solve() -> int: u1 = 4 d = 2 result = u1 * 5 - d return result
Maya and Sarah went to the mall. Maya spent $20 on clothes and $15 on shoes. Sarah spent $25 on clothes and $10 on shoes. How much did they spend in total?
def solve() -> int: maya_clothes = 20 maya_shoes = 15 sarah_clothes = 25 sarah_shoes = 10 total_spent = maya_clothes + maya_shoes + sarah_clothes + sarah_shoes result = total_spent return result
Student: 7. Jill has two glasses of juice. One is twice the price of the other. The total cost is $2.80. What is the price of each glass?
def solve() -> int: price1 = 0 price2 = 0 total_cost = 2.80 price1 = total_cost / 3 price2 = price1 * 2 result = (price1, price2) return result
Student: A car wash is offering a special deal where they charge $12 for a regular wash and $15 for a deluxe wash. They also give a $2 discount for every fifth wash. If they wash 50 cars in a day and 40% of them are deluxe washes, how much money do they earn?
def solve() -> int: regular_wash_price = 12 deluxe_wash_price = 15 discount = 2 total_cars = 50 percent_deluxe = 0.4 num_regular_washes = total_cars * (1 - percent_deluxe) num_deluxe_washes = total_cars * percent_deluxe total_regular_cost = num_regular_washes * regular_wash_price tot...
Jacob has 48 pieces of candy. He eats 7 pieces of candy. How many pieces of candy does he have left?
def solve() -> int: candy = 48 candy = candy - 7 result = candy return result
Possible additional questions are: Amy has twice as many books as Ben, who has 15 books. How many books will they have in total if Amy gives Ben 5 books and Ben gives Amy 10 books?
def solve() -> int: amy_books_before = 15 * 2 amy_books_after = amy_books_before - 5 + 10 ben_books_after = 15 - 10 + 5 total_books = amy_books_after + ben_books_after result = total_books return result
A farmer owns a total of 9 chickens and 5 pigs. Each chicken eats 1 sq.meters of grass per month, and each pig eats 5 sq.meters of grass per month. The farmer buys 8 bags of feed pellets for $7 each, which can feed the pigs each month and the chickens for two months. His pasture contains 190 sq.meters of grass. How muc...
def solve() -> int: chicken_monthly = 1 * 9 pig_monthly = 5 * 5 pasture = 190 total_monthly = chicken_monthly + pig_monthly total_yearly = total_monthly * 12 feed_pellets = 7 bags_required = total_yearly / (chicken_monthly *2 + pig_monthly) cost = bags_required * feed_pelle...
Michael collects stamps. He has 10 binders with each binder holding 50 stamps. If he adds 3 new stamps to each binder per week, how many stamps will he have after one month?
def solve() -> int: binders = 10 stamps_per_binder = 50 new_stamps_per_week = 3 weeks_in_a_month = 4 total_stamps = binders * stamps_per_binder total_stamps_after_one_month = total_stamps + (new_stamps_per_week * weeks_in_a_month * binders) result = total_stamps_after_one_month ...
Alice is baking cookies for a school sale. She has 3 bags of chocolate chips, each containing 15 ounces. She uses 2 ounces of chocolate chips for every dozen cookies. She plans to bake 8 dozen cookies. How many ounces of chocolate chips will she have left?
def solve() -> int: chips = 3 * 15 used = 2 * 8 chips = chips - used result = chips return result
Student: A company has 30 employees. If there are twice as many females as males, how many males work for the company?
def solve() -> int: num_employees = 30 ratio = 2 num_males = num_employees // (ratio + 1) result = num_males return result
A store sells cans of tomato soup for $3.25 per can. Nick bought two cans and his sister bought five. How much money did they spend altogether?
def solve() -> int: total_price = 3.25 * (2 + 5) result = total_price return result
Morgan is saving $10 a week to buy a bike. The bike is $150. How many weeks will it take for Morgan to save enough to buy the bike?
def solve() -> int: target_money = 150 weekly_saving = 10 weeks_to_reach_goal = target_money / weekly_saving result = weeks_to_reach_goal return result
A bookstore marks up a novel by 15% above the cost. Later, a 5% discount is offered on all books. If the store paid $10 for the novel, how much profit did they make?
def solve() -> int: cost = 10 markup_percentage = 15 discount_percentage = 5 markup_amount = cost * (markup_percentage / 100) selling_price = cost + markup_amount discount_amount = selling_price * (discount_percentage / 100) final_selling_price = selling_price - discount_...
Henry is filling a pool. The pool is 20 feet long, 10 feet wide, and 6 feet deep. How many gallons of water does he need to fill the pool?
def solve() -> int: length = 20 width = 10 depth = 6 cubic_feet = length * width * depth gallons = cubic_feet * 7.48 result = gallons return result
Mike actively travels for 3 days per week. He got an increase in pay and now earns twice as much as before. If Mike earns $1200 per week, how much did he used to earn before?
def solve() -> int: income_delta = 1200 income_before = income_delta/2 result = income_before return result