question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Five ants are going up a wall. Their speeds are 4 ft/min, 5 ft/min, 6 ft/min, 7 ft/min, and 8 ft/min respectively. How long will it take for them to reach the top of the wall that is 10 feet tall?
def solve() -> int: time1 = 10 / 4 time2 = 10 / 5 time3 = 10 / 6 time4 = 10 / 7 time5 = 10 / 8 result = max(time1, time2, time3, time4, time5) return result
A bottle of shampoo weighs 18 ounces and a bottle of conditioner weighs 14 ounces. If Jasmine buys 5 bottles of shampoo and 3 bottles of conditioner, how many pounds does she have to carry?
def solve() -> int: shampoo_weight = 18 conditioner_weight = 14 num_shampoo_bottles = 5 num_conditioner_bottles = 3 total_weight = (shampoo_weight * num_shampoo_bottles + conditioner_weight * num_conditioner_bottles) / 16 result = total_weight return result
Mike has 40 coins. He gave away one-third of his coins to his friend. Then, his friend gave him half of the coins he received from Mike. After that, Mike gave away one-sixth of the coins he had left. How many coins does Mike have now?
def solve() -> int: coins = 40 coins *= 2/3 coins += (1/2)*(40*1/3) coins *= 5/6 result = coins return result
A train ticket costs $25 and a bus ticket costs $15. If John needs to take 3 trains and 4 buses, how much money will he need to purchase all the tickets?
def solve() -> int: price_train = 25 price_bus = 15 num_trains = 3 num_buses = 4 total_price_train = price_train * num_trains total_price_bus = price_bus * num_buses result = total_price_train + total_price_bus return result
A recipe for cookies calls for 2 cups of sugar to make 24 cookies. How much sugar is needed to make 36 cookies?
def solve() -> int: cookies_needed = 36 sugar_needed = cookies_needed * 2 / 24 result = sugar_needed return result
John runs 3 miles every day. He spends an additional 20 minutes stretching after running. Each day he spends 8 hours sleeping and 6 hours working. How many hours are left over in his day?
def solve() -> int: minutes_run = 30 minutes_stretch = 20 hours_sleep = 8 hours_work = 6 total_minutes = (24*60) total_minutes_left = total_minutes - (minutes_run + minutes_stretch + (hours_sleep * 60) + (hours_work * 60)) total_hours_left = total_minutes_left / 60 result = to...
Hannah, Emily, and Sarah harvested 45 apples. If Emily and Sarah harvested the same number of apples and Hannah harvested 15, how many apples did Sarah harvest?
def solve() -> int: hannah_apples = 15 total_apples = 45 emily_sarah_apples = (total_apples - hannah_apples) / 2 sarah_apples = emily_sarah_apples result = sarah_apples return result
Garrett is stocking up his store and he buys 8 containers of chips at $4 each, 20 cotton candy boxes at $2 each and 12 boxes of chocolates at $6 each. How much does he spend in total?
def solve() -> int: chips = 8 * 4 cotton_candy = 20 * 2 chocolates = 12 * 6 result = chips + cotton_candy + chocolates return result
A family of 4 spends $180 on groceries every week. What is the average amount of money they spend on groceries per person each month?
def solve() -> int: weekly_spending = 180 people_count = 4 monthly_spending_per_person = (weekly_spending * 4) / (people_count * 12) result = monthly_spending_per_person return result
There are 96 pencils and 120 erasers in a school supply store. If the cost for the erasers is $1.50 per eraser, what is the cost of the entire store?
def solve() -> int: num_pencils = 96 num_erasers = 120 cost_eraser = 1.50 cost_store = (num_pencils * 0.25) + (num_erasers * cost_eraser) result = cost_store return result
William works as a software developer and earns $60 per hour. If he works 32 hours a week, but he also gets a sick leave of 2 days every month (8 sick leaves a year), how much will he earn annually?
def solve() -> int: hourly_rate = 60 hours_weekly = 32 weeks_yearly = 52 sick_leaves = 8 hours_worked_yearly = (hours_weekly * weeks_yearly) - (sick_leaves * 8) yearly_pay = hourly_rate * hours_worked_yearly result = yearly_pay return result
A company had a revenue of $60,000 in a month. If the company’s expenses for that month is $20,000, what is the company’s profit margin for that month?
def solve() -> int: revenue = 60000 expenses = 20000 profit = revenue - expenses profit_margin = profit/revenue*100 result = profit_margin return result
A recipe calls for 3 eggs to make a cake. If you want to make 6 cakes, how many eggs will you need?
def solve() -> int: eggs_per_cake = 3 cakes = 6 eggs_needed = eggs_per_cake * cakes result = eggs_needed return result
If John's age is 10 years more than three times his younger brother's age, and his younger brother is 6 years old, how old is John?
def solve() -> int: younger_brother_age = 6 three_times_younger_brother_age = 3 * younger_brother_age john_age = three_times_younger_brother_age + 10 result = john_age return result
Some possible new questions are: Kelly is making lemonade for a party. She squeezes 8 lemons and gets 3/4 cup of juice. She adds 4 cups of water and 1/2 cup of sugar to the juice. How much lemonade does she have in cups?
def solve() -> int: lemons = 8 juice_per_lemon = 3/4 / lemons water = 4 sugar = 1/2 juice = lemons * juice_per_lemon lemonade = juice + water + sugar result = lemonade return result
Student: If Mae has 7 apples and she gives away 2 apples, how many apples does she have left?
def solve() -> int: mae_apples = 7 given_apples = 2 mae_apples = mae_apples - given_apples result = mae_apples return result
A family has 3 times as many sons as daughters. If the family has 15 daughters, how many sons do they have?
def solve() -> int: daughters = 15 sons = 3 * daughters result = sons return result
Student: Leo collected 4 dozen stamps from different countries. He traded one-third of them with Mia for some baseball cards. Then he gave one-sixth of his remaining stamps to Noah. How many stamps did Leo have after these transactions?
def solve() -> int: stamps_collected = 4 * 12 stamps_traded = stamps_collected // 3 stamps_given = (stamps_collected - stamps_traded) // 6 result = stamps_collected - stamps_traded - stamps_given return result
Student: Jack has $90 and he decides to spend half of it on buying a book and some candies. Then, he saves $15 from what he has left. How much money did Jack spend on buying the book and candies?
def solve() -> int: initial_amount = 90 saved_amount = 15 spent_amount = initial_amount - saved_amount half_spent_amount = spent_amount / 2 result = half_spent_amount return result
Eric's spelling bee team is one word away from breaking the county record for most words spelled correctly. The current record is an average of 12 words per player. Each team has 6 players and there are 15 rounds in the bee. Through the first 14 rounds, his team has spelled a total of 204 words correctly. How many word...
def solve() -> int: num_players = 6 current_record = 12 num_rounds = 15 total_words = current_record * num_players * num_rounds words_so_far = 204 min_words_needed = (total_words - words_so_far) / (num_players * (num_rounds - 1)) + 1 difference = min_words_needed - current_record ...
A farmer has 24 sheep and 12 cows. He sells half of his sheep and 4 of his cows. How many animals does he have left on his farm?
def solve() -> int: sheep_sold = 24 / 2 cows_sold = 4 sheep_left = 24 - sheep_sold cows_left = 12 - cows_sold animals_left = sheep_left + cows_left result = animals_left return result
If the cost of producing 10 laptops is $3000, what is the cost of producing 20 laptops?
def solve() -> int: cost_per_laptop = 3000/10 cost_of_20_laptops = cost_per_laptop * 20 result = cost_of_20_laptops return result
During a sale, a shirt that normally sells for $25 is 15% off. How much does the shirt cost during the sale?
def solve() -> int: discounted_price = 25*0.85 result = discounted_price return result
Student: Fred has 8 apples and Paul has twice the amount of apples. He then decided to give 5 of his apples to his friend Paula. How many apples do they have altogether?
def solve() -> int: fred_apples = 8 paul_apples = fred_apples * 2 paula_apples = 5 total_apples = fred_apples + paul_apples + paula_apples result = total_apples return result
``` A kitchen floor measures 12 ft by 15 ft. What is the area of the floor in square yards?
def solve() -> int: length = 12 * 12 width = 15 * 12 area = (length * width) / (3 * 3) result = area return result
A rectangular garden has a length of 20 feet and a width of 12 feet. If you have enough soil to lay it 6 inches deep on an area of 160 square feet, how many cubic feet of soil will you need in total?
def solve() -> int: length = 20 width = 12 area = length*width volume = (area*160)/6 result = volume return result
Student: David goes to the store to buy 3 notebooks at a cost of $4 each and a pen for $2. He also pays 15% tax. How much did David pay in total?
def solve() -> int: notebooks = 3 notebook_cost = 4 pen = 1 pen_cost = 2 tax_rate = 0.15 subtotal = notebooks * notebook_cost + pen * pen_cost tax = subtotal * tax_rate total = subtotal + tax result = total return result
A grocery store is calculating the cost of a fruit basket. The basket contains 3 apples, 2 oranges, and 1 banana, and each apple costs $0.75, each orange costs $1.25, and each banana costs $0.50. If the store wants to add a 20% markup to the total cost, what is the final cost of the fruit basket?
def solve() -> int: num_apples = 3 num_oranges = 2 num_bananas = 1 cost_per_apple = 0.75 cost_per_orange = 1.25 cost_per_banana = 0.50 markup_percentage = 0.20 total_cost = num_apples * cost_per_apple + num_oranges * cost_per_orange + num_bananas * cost_per_banana final_cost = total_...
In a survey of 500 people, 60% said they prefer coffee to tea. How many people prefer tea?
def solve() -> int: total_people = 500 coffee_prefer = 0.6 * total_people result = total_people - coffee_prefer return result
Sophia and Noah are planning a backpacking trip. They need to bring food that will last for 10 days. Each meal they bring will last for 2 days, and they have 3 meals per day. How many meals do they need to bring in total?
def solve() -> int: days = 10 meal_duration = 2 meals_per_day = 3 total_meals = days * meals_per_day / meal_duration result = total_meals return result
Student: Tom spends 32 hours per week at his part-time job. He spends 2 hours per day reading. He sleeps for 7 hours each day. He attends a 1-hour meeting twice a week. He spends every other day working on his photography for 2 hours. How much free time does he have left?
def solve() -> int: job_hours = 32 reading_hours = 2 sleep_hours = 7 meeting_hours = 2 photo_hours = 2 total_reading_hours = reading_hours * 7 total_sleep_hours = sleep_hours * 7 total_meeting_hours = meeting_hours * 2 total_photo_hours = photo_hours * 3 total_work_hours = job_ho...
A company hired 5 workers. Each worker worked for 8 hours a day. In a week, they worked for 40 hours. If they worked for 4 hours on the first day, how many hours did they work for the remainder of the week?
def solve() -> int: workers = 5 hours_per_day = 8 total_hours = workers * hours_per_day * 5 first_day_hours = 4 remaining_hours = total_hours - first_day_hours - 40 result = remaining_hours return result
Katy is baking a cake and she needs 2 cups of sugar. She already put 1 cup in the cake mix. How much more sugar does she need to add?
def solve() -> int: sugar_in_cake = 1 needed_sugar = 2 sugar_to_add = needed_sugar - sugar_in_cake result = sugar_to_add return result
Andrew's turtle, Sheldon, was born on the same day that Anna turned 7 years old. Anna is exactly 5 years younger than is Lily. On Lily's 12th birthday, how many years old was Andrew's turtle, Sheldon?
def solve() -> int: anna_age = 7 lily_age = anna_age + 5 years_passed = 12 - anna_age sheldon_age = lily_age + years_passed result = sheldon_age return result
A restaurant paid $2,000 in rent last month. If the restaurant owner wants to spend no more than 1/3 of the remaining budget on food costs, and the remaining budget is $7,500, how much can the restaurant spend on food?
def solve() -> int: rent = 2000 remaining_budget = 7500 max_food_budget = (remaining_budget - rent) * 1/3 result = max_food_budget return result
Jasmine likes to bake cakes. She needs 3 eggs, 2 cups of flour, and 1 cup of sugar for each cake. She has 15 eggs, 10 cups of flour, and 6 cups of sugar in her pantry. How many cakes can she bake with the ingredients she has?
def solve() -> int: EGGS_PER_CAKE = 3 FLOUR_PER_CAKE = 2 SUGAR_PER_CAKE = 1 EGGS = 15 FLOUR = 10 SUGAR = 6 cakes_with_eggs = EGGS // EGGS_PER_CAKE cakes_with_flour = FLOUR // FLOUR_PER_CAKE cakes_with_sugar = SUGAR // SUGAR_PER_CAKE cakes = min(cakes_with_eggs, cakes_with_flour, ...
Mr. Lee walked at 4 mph for 15 minutes. After the walk, he ran at 7 mph for 45 minutes. How many miles did he walk and run in total?
def solve() -> int: time_walk = 15/60 speed_walk = 4 distance_walk = speed_walk * time_walk time_run = 45/60 speed_run = 7 distance_run = speed_run * time_run total_distance = distance_walk + distance_run result = total_distance return result
Student: Jodie takes 7 exams a week. Each exam takes 2 hours. In 75 days, how many hours does Jodie spend taking exams?
def solve() -> int: exams_per_week = 7 exam_duration = 2 days = 75 weeks = days / 7 exams = weeks * exams_per_week exam_time = exams * exam_duration result = exam_time return result
John bought a package of 10 markers and 8 erasers. Each marker costs $1.50 and each eraser costs $0.75. How much did he spend in total?
def solve() -> int: markers = 10 erasers = 8 markerCost = 1.50 eraserCost = 0.75 totalCost = (markers * markerCost) + (erasers * eraserCost) result = totalCost return result
John drove 472 miles from his home in Ny to his destination in Illinois. If the car rental fee costs 37 cents per mile, how much will John pay in total?
def solve() -> int: miles=472 rate= 0.37 fee=miles*rate result = fee return result
Liam's mom gave him 4 toy cars and his dad gave him 6 more. He gave 3 to his little brother. His friend gave him 5 more toy cars. How many toy cars does Liam have now?
def solve() -> int: toys_from_mom = 4 toys_from_dad = 6 toys_to_brother = 3 toys_from_friend = 5 total_toys = toys_from_mom + toys_from_dad - toys_to_brother + toys_from_friend result = total_toys return result
A music producer hired eight singers to create a new album. After the album was released, Emma received $2,300 more than three times the amount that Lily and Sophia received combined. If the total payout was $60,000, how much did Lily and Sophia receive combined?
def solve() -> int: total_payout = 60000 emma_received = 0 lily_sophia_received = 0 emma_received = (total_payout - 2300) / 4 lily_sophia_received = (total_payout - emma_received) / 2 result = lily_sophia_received return result
Max has a savings goal of $500. His grandparents gave him $100, but he needs to earn the rest by doing household chores for $7 per task. How many tasks does Max need to complete to reach his savings goal?
def solve() -> int: goal = 500 gift = 100 task_payment = 7 remaining_amount = goal - gift tasks_needed = remaining_amount / task_payment result = tasks_needed return result
Student: Karen earns $45000 a year from her work. She needs to pay 20% of her salary for rent and 15% of what's left after rent for groceries. How much money will she have left after paying for rent and groceries?
def solve() -> int: salary = 45000 rent = salary * 0.2 groceries = (salary - rent) * 0.15 result = salary - rent - groceries return result
A team played four games, winning two and losing two. How many points did they make if each win gave them three points?
def solve() -> int: win = 2 points = win*3 result = points return result
A group of siblings opened a savings account. Each sibling committed to saving a certain amount every week. After 4 months of savings, they decided to use a quarter of their savings to buy cryptocurrency, priced at $500 per coin. If there were 5 siblings involved in this, how many coins can they buy altogether?
def solve() -> int: num_siblings = 5 savings_per_week = 50 months_saving = 4 price_per_coin = 500 total_savings = num_siblings * savings_per_week * months_saving num_coins = total_savings // price_per_coin result = num_coins return result
Jack is shopping for fruits. He buys 3 apples, 5 oranges, and 2 bananas. If the apples cost $1 each, the oranges cost $2 each, and the total cost is $15, how much, in dollars, did each banana cost?
def solve() -> int: apples = 3 oranges = 5 bananas = 2 apple_cost = 1 orange_cost = 2 total_cost = 15 fruit_cost = (apples * apple_cost) + (oranges * orange_cost) banana_cost = (total_cost - fruit_cost) / bananas result = banana_cost return result
On his birthday, Carl received 12 dimes from his grandmother. He had 5 dimes already. How many dimes does he have now?
def solve() -> int: total_dimes = 0 dimes_from_grandma = 12 dimes_original = 5 total_dimes = dimes_from_grandma + dimes_original result = total_dimes return result
Student: **** Lily has 5 boxes, each having 24 books. What is the total number of books Lily has?
def solve() -> int: num_boxes = 5 books_per_box = 24 total_books = num_boxes * books_per_box result = total_books return result
Possible new questions: Ben and Ethan are collecting stamps for their hobby. Ben has 36 stamps and Ethan has 24 stamps. They decide to exchange some stamps so that they have the same number of stamps. How many stamps does each of them have after the exchange?
def solve() -> int: result = (48, 12) return result
Terry bought a laptop worth $700 and decided to pay for it in two installments, the first installment was 28% of the total cost, how much was the first installment?
def solve() -> int: total_cost = 700 percent_first_installment = 0.28 first_installment = total_cost*percent_first_installment result = first_installment return result
A city's health department is organizing a health check-up, and half of all the residents will participate. The city has 1000 residents, and the number of adults participating is equal to the number of children participating. How many adults and children are participating in the health check-up?
def solve() -> int: total_residents = 1000 adults_participating = total_residents / 2 children_participating = adults_participating result = f'<<<{adults_participating} adults and {children_participating} children are participating in the health check-up.>>>' return result
A pizza costs $12 and is divided into 8 slices. If 3 people share the pizza equally, how much does each person pay?
def solve() -> int: cost = 12 slices = 8 people = 3 slice_per_person = slices / people price_per_person = cost / slice_per_person result = price_per_person return result
Student: Kim has a coupon for 15% off her purchase of dog food. If the original cost of the dog food is $45, how much will she save with the coupon?
def solve() -> int: original_cost = 45 discount_rate = 0.15 discount_amount = original_cost * discount_rate result = discount_amount return result
A pack of pencils has 20 pencils. Each pencil costs 25 cents. If Kelly buys 3 packs of pencils, how much money does she spend in total?
def solve() -> int: kelly_pencils = 3 * 20 total_cost = kelly_pencils * 0.25 result = total_cost return result
There are 365 apples in a basket. Every day 10 apples are eaten and 5 new ones are added. How many apples will be left in the basket after 20 days?
def solve() -> int: apples = 365 days = 20 eaten_per_day = 10 added_per_day = 5 result = (apples - (eaten_per_day*days)) + (added_per_day*days) return result
In a company, the ratio of managers to employees is 1:5. If there are 210 people in the company, how many are managers?
def solve() -> int: manager_ratio = 1 employee_ratio = 5 total_people = 210 total_ratio = manager_ratio + employee_ratio manager_count = manager_ratio / total_ratio * total_people result = manager_count return result
Ethan has 20 trading cards. He bought 6 more and then gave away 4. How many trading cards does Ethan have now?
def solve() -> int: cards = 20 cards += 6 cards -= 4 result = cards return result
Sarah spends $200 per month on groceries, accounting for 20% of her monthly budget. How much money does she have budgeted per month?
def solve() -> int: budgeted_amount = 200 / 0.2 result = budgeted_amount return result
Eddie is a sculptor who creates stunning sun dials. Most recently he sold one for $4,600 less than seven times what he had made on the one before. If Eddie made $800 on the one before, how much, in dollars, did he make for selling his most recent sun dial?
def solve() -> int: previous_price = 800 new_price = 0 seven_times = 7 result = previous_price * seven_times new_price = result - 4600 result = new_price return result
Mike wants to complete a lap around a square swimming pool. Each side of the pool measures 25 meters. If Mike can swim twice as fast as he can run and it takes him 10 minutes to run 1 mile, how long, in minutes, will it take Mike to swim a lap around the pool?
def solve() -> int: side_length = 25 running_speed = 10 distance = 4 * side_length distance_miles = distance / 1609.34 running_time = distance_miles * running_speed swimming_speed = 2 * running_speed swimming_time = distance_miles * swimming_speed resu...
Student: If a train has twice as many passenger cars as cargo cars, and the total number of cars is 90, counting the engine and caboose, how many passenger cars are in the train?
def solve() -> int: passenger_cars = 0 cargo_cars = 0 engine = 1 caboose = 1 total_cars = passenger_cars + cargo_cars + engine + caboose passenger_cars = 2 * cargo_cars total_cars = 2 * cargo_cars + cargo_cars + engine + caboose cargo_cars = (total_cars - engine - caboose) / 3 total_...
Joe went camping and bought 12 bottles of water. He drank two thirds of the bottles and then gave the remaining water to his three friends. How many bottles of water did each of his friends get?
def solve() -> int: total_bottles = 12 drunk_bottles = total_bottles * 2//3 num_people = 3 each_person = (total_bottles - drunk_bottles) // num_people result = each_person return result
Xavier is buying food for his upcoming camping trip. He needs 800 ounces of food and each meal is 4 ounces. How many meals will Xavier need in order to cover the 800 ounces?
def solve() -> int: number_of_meals = 800 / 4 result = number_of_meals return result
Student: A store has a sale of 20% off on all items for the first 2 hours of the day. If a customer buys items worth $150 during the sale, what is the total amount saved?
def solve() -> int: original_price = 150 discount_rate = 0.2 sale_duration = 2 discount_amount = original_price * discount_rate final_price = original_price - discount_amount result = discount_amount return result
Danny bikes 7 kilometers to school every day. After school, he bikes to the park and then bikes back home. If he bikes a total of 21 kilometers, how many kilometers does he bike from the park to his house?
def solve() -> int: distance_to_school = 7 total_distance = 21 distance_to_park = total_distance - distance_to_school - distance_to_school result = distance_to_park return result
Jack, Jill and Joe play a game of cards. Jack wins 6 rounds. Jill wins 4 more rounds than Jack. Joe wins 2 fewer rounds than Jill. If each round is worth 3 points, how many points did they score in total?
def solve() -> int: jack = 6 jill = jack + 4 joe = jill - 2 total_rounds = jack + jill + joe points = total_rounds * 3 result = points return result
In a Trigonometry exam, Anna got 5 mistakes which are half as many mistakes as Maria. John scored 30 and has the same quantity of mistakes as Maria. What is Anna's score?
def solve() -> int: marias_mistakes = 10 annas_mistakes = marias_mistakes / 2 johns_score = 30 annas_score = johns_score - annas_mistakes result = annas_score return result
Sophie was one-third her mother-in-law's age when her mother-in-law passed away. If her mother-in-law were alive today, 9 years later, she would be 90. How old is Sophie currently? At the bakery, there were 2 cakes, 4 muffins, 7 cookies, and 3 croissants for sale. How many treats were there in total?
def solve() -> int: mother_in_law_age = 90 - 9 sophie_age = mother_in_law_age / 3 total_treats = 2 + 4 + 7 + 3 result = sophie_age + total_treats return result
Maria had solved three math problems on her calculator. The answer to the first problem was 350, the answer to the second problem was half of the answer to the first problem, and the answer to the third problem was 300 more than the sum of the answers to the first and the second problems. How much was the difference be...
def solve() -> int: a1 = 350 a2 = a1 / 2 a3 = a1 + a2 + 300 diff = a3 - a1 result = diff return result
Jack had to paint a room that would usually take him 3 days. If he took 2 five-hour breaks, how long did he spend painting the room?
def solve() -> int: time_to_paint = 3 break_length = 5 total_break_time = 2 * break_length total_painting_time = time_to_paint * 24 - total_break_time result = total_painting_time return result
He also spends 8 minutes on the bus each way. How long does he spend on transportation in a 5-day school week?
def solve() -> int: walking_time = 12 + 12 bus_time = 8 + 8 total_time = walking_time + bus_time weekly_time = total_time * 5 result = weekly_time return result
Ryan found 18 coins and Robert found 15 coins. How many coins have they found altogether?
def solve() -> int: total_coins = 18 + 15 result = total_coins return result
A pool is being filled with water at a rate of 4 gallons per minute. If the pool holds 20,000 gallons of water, how many hours will it take to fill the pool?
def solve() -> int: rate = 4 pool = 20000 minutes = pool / rate hours = minutes / 60 result = hours return result
A group of 50 students are split into two classes in such a way that one class has 20 more students than the other. How many students are in the larger class?
def solve() -> int: total_students = 50 larger_class_size = (total_students + 20)/2 result = larger_class_size return result
There are 84 books in a bookshelf. If 6 books have been taken away from the bookshelf, what is the new number of books in the bookshelf?
def solve() -> int: books = 84 taken_away = 6 new_books = books - taken_away result = new_books return result
Max wants to make his favorite smoothie for breakfast. He has $10 and each bag of frozen fruit costs $2. If he needs 2 bags of fruit to make 16 ounces of smoothie, how many ounces of smoothie can he make for his money?
def solve() -> int: money = 10 cost_per_bag = 2 bags_needed = 2 ounces_per_bag = 16 total_cost = cost_per_bag * bags_needed total_bags = money // total_cost total_ounces = total_bags * ounces_per_bag result = total_ounces return result
A car can travel 30 miles per gallon of gas. If a driver has a 15-gallon tank, how far can the car travel before running out of gas?
def solve() -> int: miles_per_gallon = 30 num_gallons_in_tank = 15 total_distance = miles_per_gallon * num_gallons_in_tank result = total_distance return result
Ann added 8 pins to a group of 20 people who were averaging 12 pins per day. How many pins would this group have after 3 days?
def solve() -> int: total_pins = 20 * 12 daily_increase = 8 days = 3 total_pins += days * daily_increase result = total_pins return result
3. Rachel bought 15 pencils and shared them with 3 friends. How many pencils did each of her friends get?
def solve() -> int: n_pencils = 15 n_friend = 3 result = n_pencils/n_friend return result
John can run a mile in 8 minutes. Rachel can run double the speed of John. How long would it take for Rachel to run a mile?
def solve() -> int: john_time = 8 rachel_speed = 2*60/john_time distance = 1 rachel_time = distance * 60 / rachel_speed result = rachel_time return result
Amanda worked 4 hours in the morning the first day and then worked 8 hours the second day. Her rate was $17 an hour for the first day and $20 an hour for the second day. How much money did Amanda make over the two days?
def solve() -> int: hoursDayOne = 4 payDayOne = 17 hoursDayTwo = 8 payDayTwo = 20 totalPay = (hoursDayOne * payDayOne) + (hoursDayTwo * payDayTwo) result = totalPay return result
A store offered a 10% discount on all items during a sale. If a customer bought a sweater originally priced at $50, what was the sale price of the sweater?
def solve() -> int: original_price = 50 discount = 0.1 sale_price = original_price - original_price*discount result = sale_price return result
A ladder leans against a wall and reaches 15 feet high. If the bottom of the ladder is 12 feet from the wall, what is the length of the ladder?
def solve() -> int: height = 15 distance = 12 ladder_length = (height ** 2 + distance ** 2) ** 0.5 result = ladder_length return result
A baker made 120 cupcakes and sold them for $2 each. He spent $0.40 on ingredients and $0.15 on packaging for each cupcake. How much profit did he make in total from the cupcake sales?
def solve() -> int: total_cupcakes = 120 sale_price = 2 ingredient_cost = 0.4 packaging_cost = 0.15 total_revenue = total_cupcakes * sale_price total_cost = (ingredient_cost + packaging_cost) * total_cupcakes total_profit = total_revenue - total_cost result = total_...
If Jane works 4 hours at a rate of $15 per hour, and works 6 hours at a rate of $18 per hour, how much did she earn?
def solve() -> int: c1_hours = 4 c1_rate = 15 c2_hours = 6 c2_rate = 18 total_earnings = (c1_hours * c1_rate) + (c2_hours * c2_rate) result = total_earnings return result
-Here are some examples of potential questions: Lila baked 12 muffins and 18 cookies for a bake sale. She sold each muffin for $1.50 and each cookie for $0.75. How much money did she make in total?
def solve() -> int: muffins = 12 muffin_price = 1.5 cookies = 18 cookie_price = 0.75 muffin_money = muffins * muffin_price cookie_money = cookies * cookie_price total_money = muffin_money + cookie_money result = total_money return result
A recipe needs 2 cups of flour and 1 cup of sugar. If you want to triple the recipe, how many cups of flour and sugar do you need?
def solve() -> int: flour = 2 * 3 sugar = 1 * 3 result = (flour, sugar) return result
In a toy store, William picked out 45 toys. Tina picked out 5 times as many toys as William. If William played with 1/3 of his toys and Tina lost 1/2 of hers, how many toys do they have left between them?
def solve() -> int: william_toys = 45 tina_toys = 5 * william_toys william_played = william_toys / 3 tina_lost = tina_toys / 2 total_left = william_toys - william_played + tina_toys - tina_lost result = total_left return result
A car travels 345 kilometers in 5 hours. How fast is it going in kilometers per hour?
def solve() -> int: distance_traveled = 345 time_taken = 5 speed = distance_traveled / time_taken result = speed return result
There are 28 marbles in a jar. 12 of them are red, 8 are blue, and the rest are yellow. If 4 red marbles and 2 blue marbles are removed, what percentage of the marbles in the jar are yellow?
def solve() -> int: red = 12 blue = 8 yellow = 28 - red - blue total_marbles = red + blue + yellow red -= 4 blue -= 2 new_total_marbles = red + blue + yellow percentage_yellow = (yellow / new_total_marbles) * 100 result = percentage_yellow return result
Student: Mary has 12 red ribbons and 6 green ribbons. If the red ribbons cost $1 each and the green ribbons cost $1.50 each, how much did she spend?
def solve() -> int: red_ribbons = 12 green_ribbons = 6 red_ribbon_price = 1 green_ribbon_price = 1.50 total_cost = red_ribbons * red_ribbon_price + green_ribbons * green_ribbon_price result = total_cost return result
arah is baking 18 cupcakes for a party and needs to add 4 teaspoons of sugar for each cupcake. How many teaspoons of sugar should she add in all?
def solve() -> int: num_cupcakes = 18 ts_sugar = 4 total_sugar = num_cupcakes * ts_sugar result = total_sugar return result
Rachel is making a sandwich. She needs 3 slices of ham and 2 slices of cheese. The ham costs $1 per slice and the cheese is five times that price. How much does everything cost?
def solve() -> int: ham_slices = 3 cheese_slices = 2 ham_price = 1 cheese_price = 5 * ham_price total_cost = (ham_slices * ham_price) + (cheese_slices * cheese_price) result = total_cost return result
The average of 5 numbers is 20. If one of the numbers is 15, find the average of the remaining numbers.
def solve() -> int: num_list = [x for x in range(1, 6)] total_sum = sum(num_list) given_num = 15 num_sum = total_sum - given_num new_average = num_sum / (len(num_list)-1) result = new_average return result
A person loses 12% of his salary to taxes. If his salary is $3000.00, what is the amount he gets to take home?
def solve() -> int: taxes = 0.12 * 3000.00 salary = 3000.00 - taxes result = f'<<<{salary}>>>' result = salary return result
Student: Cameron is making fettuccine Alfredo for his family of 3. His recipe serves 6 people and calls for 1.5 pounds of pasta. How many pounds of pasta does Cameron need to make enough for his family?
def solve() -> int: recipe_serves = 6 family_size = 3 pasta_needed_for_recipe = 1.5 pasta_needed_for_family = pasta_needed_for_recipe / recipe_serves * family_size result = pasta_needed_for_family return result
A school has 800 students in four grades. In a math test, 10% of the students in grade 1 scored above 90%, 20% of the students in grade 2 scored above 90%, 30% of the students in grade 3 scored above 90%, and 40% of the students in grade 4 scored above 90%. If each grade has the same number of students, how many studen...
def solve() -> int: students_per_grade = 800 / 4 grade_1_above_90 = 0.1 * students_per_grade grade_2_above_90 = 0.2 * students_per_grade grade_3_above_90 = 0.3 * students_per_grade grade_4_above_90 = 0.4 * students_per_grade total_above_90 = grade_1_above_90 + grade_2_ab...
Student: A bag contains 60 marbles, 30 of which are red and 10 of which are green. What is the probability of drawing a green marble?
def solve() -> int: total_marbles = 60 green_marbles = 10 probability = green_marbles / total_marbles result = probability return result
Student: Lucas has 8 more balls than his sister Julia. If Julia has 16 balls, and the two siblings sell their balls at $10 each, calculate the profit they make together if they bought the balls at $6 each?
def solve() -> int: lucas_balls = 8 julia_balls = 16 cost_per_ball = 6 sell_price_per_ball = 10 total_cost = (lucas_balls + julia_balls) * cost_per_ball total_sell_price = (lucas_balls + julia_balls) * sell_price_per_ball total_profit = total_sell_price - total_cost result = total_profit...