question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
An investment of $3500 yields $550 as interest after 9 months. What is the rate of interest per annum?
def solve() -> int: principal = 3500 interest = 550 time = 0.75 rate = (interest / principal) * (1/time) result = rate return result
A square has an area of 25 square meters. What is the length of one side?
def solve() -> int: area = 25 side = (area) ** 0.5 result = side return result
Jake wants to bake a cake for his birthday. He goes to the store and buys a box of cake mix which requires 3 eggs and 1 cup of water. How many cups of water will he need if he wants to make 2 cakes?
def solve() -> int: num_cakes = 2 eggs_per_cake = 3 water_per_cake = 1 total_water = num_cakes * water_per_cake result = total_water return result
There are 7 red balls, 5 blue balls, and 8 green balls in a bag. What is the probability of drawing a red ball?
def solve() -> int: red_balls = 7 total_balls = red_balls+5+8 probability = red_balls/total_balls result = probability return result
John wants to buy a laptop for $800. If he saves 25% of his monthly salary of $2000, how many months does he need to save up to buy the laptop?
def solve() -> int: monthly_salary = 2000 monthly_savings = monthly_salary * 0.25 months_needed = 800 / monthly_savings result = months_needed return result
A swimming pool can be filled with water by two pipes in 1 hour and 15 minutes. The first pipe can fill the pool in 45 minutes less time than the second pipe. Find the time taken by each pipe to fill the pool separately.
def solve() -> int: fill_time_total = 1.25 fill_time_difference = 0.75 fill_time_second_pipe = (fill_time_total - fill_time_difference) / 2 fill_time_first_pipe = fill_time_second_pipe + fill_time_difference result = fill_time_first_pipe, fill_time_second_pipe return result
Jacob and Noah are brothers. Jacob is 14 years old and Noah is 19 years old. In how many years will their combined age be 53 years old?
def solve() -> int: jacob_age = 14 noah_age = 19 combined_age = jacob_age + noah_age target_age = 53 years_needed = target_age - combined_age result = years_needed return result
Here are some possible questions and programs: A pair of jeans costs $40 and is now sold at 30% off. A shirt costs $25 and is now sold at 15% off. How much will you pay if you buy 2 pairs of jeans and 3 shirts?
def solve() -> int: original_price = (40 * 2) + (25 * 3) jeans_discount = 40 * 0.3 jeans_price = 40 - jeans_discount shirt_discount = 25 * 0.15 shirt_price = 25 - shirt_discount discounted_price = (jeans_price * 2) + (shirt_price * 3) saved = original_price - discounted_price result = sa...
Mr. Chen is a baker who makes cakes and pies for his customers. He uses 4 eggs and 3 cups of flour for each cake, and 2 eggs and 2 cups of flour for each pie. He has 60 eggs and 40 cups of flour in his kitchen. How many cakes and pies can he make with his ingredients?
def solve() -> int: eggs_per_cake = 4 flour_per_cake = 3 eggs_per_pie = 2 flour_per_pie = 2 total_eggs = 60 total_flour = 40 max_cakes = min(total_eggs // eggs_per_cake, total_flour // flour_per_cake) max_pies = min(total_eggs // eggs_per_pie, total_flour // flour_per_pie)...
Susan wants to lose 15 pounds in 3 months. She plans to lose 1 pound per week, 5 days a week. How much more weight should she lose per day to reach her goal?
def solve() -> int: pounds_per_week = 1 days_per_week = 5 weeks_per_month = 4 months = 3 total_pounds_to_lose = 15 total_weeks = months * weeks_per_month pounds_per_day = pounds_per_week / days_per_week pounds_to_lose_per_day = total_pounds_to_lose / total_weeks more_w...
A sports team has won 12 games out of 18 games played so far. What percentage of games have they won?
def solve() -> int: games_played = 18 games_won = 12 win_percentage = (games_won / games_played) * 100 result = win_percentage return result
Nina collects stamps and has 250 stamps in her album. She buys 50 more stamps from a friend for $10 and sells 30 stamps to another friend for $15. She also gives away 20 stamps to her cousin. How many stamps does she have left in her album and how much money does she have left after these transactions?
def solve() -> int: initial_stamps = 250 bought_stamps = 50 bought_cost = 10 sold_stamps = 30 sold_price = 15 given_stamps = 20 initial_money = 0 final_stamps = initial_stamps + bought_stamps - sold_stamps - given_stamps final_money = initial_money - bought_cost + sold_price ...
You have two basketballs. One has a circumference of 75cm, and the other has a circumference of 82cm. If you inflate them both with the same amount of air, what will be the ratio of their volumes?
def solve() -> int: circumference1 = 75 circumference2 = 82 radius1 = circumference1 / (2 * 3.14) radius2 = circumference2 / (2 * 3.14) volume1 = 4 / 3 * 3.14 * radius1 ** 3 volume2 = 4 / 3 * 3.14 * radius2 ** 3 ratio = volume1 / volume2 result = ratio return result
Mark has to restring 5 guitars with 4 strings each, four times as many basses which have 4 strings each, and 8 fewer 6-string violins than basses. How many strings does he need?
def solve() -> int: guitars = 5 guitar_strings = 4 basses = guitars * 4 bass_strings = 4 violins = basses - 8 violin_strings = 6 total_strings = guitars * guitar_strings + basses * bass_strings + violins * violin_strings result = total_strings result return result
A pizza place charges $10.00 for a small, $15.00 for a medium, and $20.00 for a large pizza. If Sarah wants to order 2 medium pizzas and 1 small pizza, how much will it cost her?
def solve() -> int: num_medium = 2 num_small = 1 price_small_pizza = 10 price_medium_pizza = 15 price_large_pizza = 20 total_cost = num_small*price_small_pizza + num_medium*price_medium_pizza result = total_cost return result
A farmer has 400 cows, and each cow produces 20 liters of milk a day. How many liters of milk are produced per week?
def solve() -> int: cow_count = 400 milk_liters_per_cow_per_day = 20 days_per_week = 7 total_milk_liters_per_day = cow_count * milk_liters_per_cow_per_day total_milk_liters_per_week = total_milk_liters_per_day * days_per_week result = total_milk_liters_per_week return result
A recipe calls for a certain number of eggs, sugar, and flour. If there are 4 times as many eggs as sugar, and 10 fewer sugar than butter, and they have the same amount of milk and chocolate chips, how many eggs are there if there are 5 sticks of butter?
def solve() -> int: butter = 5 sugar = butter + 10 eggs = 4 * sugar result = eggs return result
Bob is a contractor who is employed by a company for 6 months. He has six days of paid holidays and works five days a week. For the unpaid vacation period, he is granted a leave. He is making $25 per hour and is working 10 hours a day. What is the amount he will lose during his time off?
def solve() -> int: working_days = 5 * 4 * 6 paid_holidays = 6 unpaid_vacation = working_days - paid_holidays working_hours = 10 hourly_rate = 25 total_working_hours = working_days * working_hours total_hours_off = unpaid_vacation * working_hours total_...
A painter is painting a mural on a wall. The wall is 12 meters long and 3 meters high, and the painter can cover 1 square meter with 0.25 liters of paint. If the painter has 9 liters of paint, how much of the wall can he paint?
def solve() -> int: area = 12 * 3 area_covered = 9 / 0.25 fraction = area_covered / area result = fraction return result
George, Billy and Joe are eating pretzels together. George eats one third as many pretzels as Billy does. Billy eats twice as many pretzels as Joe does. If Joe ate 4 pretzels, how many did George eat?
def solve() -> int: num_joe = 4 num_billy = num_joe * 2 num_george = num_billy / 3 result = num_george return result
A grocery store sells apples for $0.50 each and oranges for $0.75 each. If John buys 12 apples and 8 oranges, how much did he spend in total?
def solve() -> int: apple_cost = 0.50 * 12 orange_cost = 0.75 * 8 total_cost = apple_cost + orange_cost result = total_cost return result
James kept 2 of his pencils for himself, while Ashley kept a quarter of her 12 markers for James. How many markers does Ashley have left?
def solve() -> int: pencils_kept = 2 markers_total = 12 markers_kept = markers_total / 4 markers_left = markers_total - markers_kept result = markers_left return result
Under standard plant growth conditions, a plant doubles in height every month. If a plant starts at a height of 6 inches, how tall will it be after 6 months under standard plant growth conditions? Emma wants to keep track of how many books she reads in a week. She reads two books every day and a newspaper once a week. ...
def solve() -> int: height = 6 growth_rate = 2 months = 6 for i in range(months): height *= growth_rate plant_height = height books_per_day = 2 newspaper_per_week = 1 books_per_week = books_per_day * 7 total_books = books_per_week + newspaper_per_week ...
A plane can travel 500 miles on 30 gallons of fuel. How many gallons of fuel will it need to travel 1400 miles?
def solve() -> int: miles_per_gallon = 500 / 30 miles_to_travel = 1400 gallons_needed = miles_to_travel / miles_per_gallon result = gallons_needed return result
There are 27 pencils in a box. If you take out 5 pencils and then put 3 back, how many pencils are in the box?
def solve() -> int: num_pencils = 27 num_pencils = num_pencils - 5 num_pencils = num_pencils + 3 result = num_pencils return result
A survey of 150 students found that 55% played soccer, 35% played basketball, and the rest played other sports. How many students played other sports?
def solve() -> int: total = 150 soccer = total * 0.55 basketball = total * 0.35 other = total - soccer - basketball result = other return result
Yesterday, James picked 100 berries while Lily picked 40 more berries. Today, James picked 80 while Lily picked 120 berries. How many more berries did Lily pick today than yesterday?
def solve() -> int: yesterday_james = 100 yesterday_lily = yesterday_james + 40 today_james = 80 today_lily = 120 more_berries_today = today_lily - yesterday_lily result = more_berries_today return result
Student: - Kevin wants to paint the walls of his cubical room that measures 10 feet by 10 feet by 10 feet. He can choose from two types of paint: one that covers 300 square feet per gallon and costs $20 per gallon, and one that covers 400 square feet per gallon and costs $25 per gallon. How much money can he save by ch...
def solve() -> int: length = 10 * 12 * 0.08333333333333 width = 10 * 12 * 0.08333333333333 height = 10 * 12 * 0.08333333333333 total_area = 2 * (length * width + length * height + width * height) paint_1 = total_area / 300 paint_2 = total_area / 400 cost_1 = paint_1 * 20 cost_2 = paint_2...
Robert bought two packs of paper for $4.99 each. How much did he pay in total?
def solve() -> int: price_per_pack = 4.99 total_packs = 2 total_payment = price_per_pack * total_packs result = total_payment return result
A cake recipe requires 2 cups of sugar, 1/2 cup of butter, and 3 cups of flour. Lisa wants to make 3 cakes. How much sugar, butter, and flour does she need in total?
def solve() -> int: sugar = 2 * 3 butter = 0.5 * 3 flour = 3 * 3 result = sugar, butter, flour return result
Olivia needs to buy a new carpet for her bedroom. The room is 11 feet long and 8 feet wide. Each square foot of carpet costs $10. How much will Olivia have to spend to buy enough carpet for the room?
def solve() -> int: Room_length = 11 Room_width = 8 Area_of_room = Room_length * Room_width Price_per_sqft = 10 Total_cost = Area_of_room * Price_per_sqft result = Total_cost return result
A fruit vendor bought 5 lbs of apples for $10 and sold each apple for $0.50. If he sold all the apples, how much profit did he make?
def solve() -> int: apples = 5 price = 10.00 price_per_apple = 0.50 revenue = apples * price_per_apple profit = revenue - price result = profit return result
John has a box that is 30 inches in height. The length of the box is twice its height and 8 times its width. What is the volume of the box?
def solve() -> int: height = 30 length = 2 * height width = length / 8 volume = height * length * width result = volume return result
Alex and Olivia are painting a fence. Alex can paint 40 square feet of fence per hour while Olivia paints 10 square feet per hour more than Alex. If Alex paints 240 square feet, how much fence has Olivia painted by then?
def solve() -> int: alex_rate = 40 olivia_rate = alex_rate + 10 alex_paint = 240 alex_time = alex_paint / alex_rate olivia_paint = olivia_rate * alex_time result = olivia_paint return result
Alex read 100 pages of a book this week. On Monday, he read 10 pages. On Tuesday, he read three times as many as he read on Monday. He’s not sure how many pages he read on Wednesday. On Thursday, he read five times as many as he read on Friday. On Friday, he read half of the amount he read on Monday. How many pages did...
def solve() -> int: monday = 10 tuesday = 3 * monday wednesday = 100 - (monday + tuesday) friday = monday / 2 thursday = 5 * friday result = wednesday return result
A train travels at a speed of 90 km/h. How many kilometers does the train travel in 5 hours?
def solve() -> int: speed = 90 time = 5 distance = speed * time result = distance return result
Leo's microwave uses 950 watts of electricity per minute. He uses it for 15 minutes a day. If electricity cost 12 cents per kw/h how many cents does his microwave cost to run for a month (assume 30 days)?
def solve() -> int: kw = 950 / 1000 h = 15 / 60 daily_cost = kw * h * 12 monthly_cost = daily_cost * 30 result = monthly_cost return result
David works at a hardware store. He earns $12 per hour. If he worked 25 hours this week, how much money did he make in total?
def solve() -> int: hourly_rate = 12 hours_worked = 25 total_earned = hourly_rate * hours_worked result = total_earned return result
Student: A recipe serves 6 people and requires 3 eggs. How many eggs are needed to serve 20 people?
def solve() -> int: people_served = 20 people_per_recipe = 6 eggs_per_recipe = 3 num_recipes = people_served / people_per_recipe num_eggs = num_recipes * eggs_per_recipe result = num_eggs return result
Emma is deciding which way to walk her dog. In the first route, they walk for 5 minutes, then run twice this amount of time, followed by a brisk walk for a third of the total running time. In the second route, they do a brisk walk for 15 minutes, then run for half this amount of time. By how many minutes is the second ...
def solve() -> int: walk_time = 5 run_time = 0 brisk_walk_time = 0 run_time = 2 * walk_time total_running_time = run_time + brisk_walk_time brisk_walk_time = total_running_time / 3 first_route_time = walk_time + run_time + brisk_walk_time brisk_walk_time = 15 run_time = bri...
Student: Mary needs to buy 4 bottles of sunscreen for her beach trip. The store has a deal of Buy 2 Get 1 Free. If each bottle costs $8, how much will Mary save on sunscreen?
def solve() -> int: bottles = 4 price = 8 deal = 3 deals = bottles // deal paid_bottles = deals * 2 + bottles % deal total_cost = bottles * price deal_cost = paid_bottles * price savings = total_cost - deal_cost result = savings return result
Juan is three times as old as Kate. If Juan is 22 now, what is Kate's age?
def solve() -> int: age_juan = 22 age_kate = age_juan/3 result = age_kate return result
Clara and Dan are selling lemonade at a fair. Clara sells one cup of lemonade for 50 cents and spends 20 cents on the ingredients for each cup. Dan sells one cup of lemonade for 40 cents and spends 15 cents on the ingredients for each cup. They both start with 10 dollars and sell the same number of cups. How much money...
def solve() -> int: clara_profit = 0.50 - 0.20 dan_profit = 0.40 - 0.15 x = 100 clara_money = 10 + (x * clara_profit) dan_money = 10 + (x * dan_profit) result = (clara_money, dan_money) return result
Student: If a book has 250 pages and you read 30 pages per day, how many days will it take to finish reading the book?
def solve() -> int: book_pages = 250 pages_per_day = 30 days = book_pages / pages_per_day days = int(days) + 1 result = days return result
A bag has 20 red balls and 30 green balls. If one ball is chosen at random from the bag, what is the probability that it is a green ball?
def solve() -> int: total_balls = 20 + 30 num_green_balls = 30 probability = num_green_balls / total_balls result = probability return result
In a bundle of flowers, there are 3 roses for each daisy. If there are 16 daisies in the bundle, how many roses are there?
def solve() -> int: daisies = 16 roses = 3 * daisies result = roses return result
Lisa has a bag of 50 candies. She gives 10% of them to her brother, 20% of them to her sister, and keeps the rest for herself. How many candies does she have left?
def solve() -> int: brother_candies = 0.1 * 50 sister_candies = 0.2 * 50 lisa_candies = 50 - (brother_candies + sister_candies) result = lisa_candies return result
The teacher gave a 20 points quiz to the students. Sandy got 16, Jim got 14, John got 18 and Bridget got 17. Calculate the average score of all the students.
def solve() -> int: sandy_score = 16 jim_score = 14 john_score = 18 bridget_score = 17 total_score = sandy_score + jim_score + john_score + bridget_score average_score = total_score/4 result = average_score return result
The difference between two numbers is 8, and their sum is 28. What are the two numbers?
def solve() -> int: difference = 8 sum_numbers = 28 num1 = (sum_numbers - difference)/2 num2 = num1 + difference result = (num1, num2) return result
During their weekend hike, Matthew and Olivia decided to trek the 5-mile trail up to the mountain top. Matthew managed to complete the trail in 2 hours, while Olivia took twice as long as Matthew did. What was Olivia's average speed, in miles per hour?
def solve() -> int: distance = 5 matthew_time = 2 olivia_time = matthew_time * 2 matthew_speed = distance / matthew_time olivia_speed = distance / olivia_time result = olivia_speed return result
Anna is a tutor who charges $25 for every hour she spends with a student. She has 4 students and spends 3 hours each day on each student. What does she earn in a week?
def solve() -> int: hourly_rate = 25 num_students = 4 hours_per_student_per_day = 3 days_per_week = 7 total_hours_per_day = num_students * hours_per_student_per_day total_hours_per_week = total_hours_per_day * days_per_week total_earnings = total_hours_per_week * hourly_rate re...
Tom was playing a game with his friends. After the first 4 rounds, Tom earned 5 points. After the last two rounds, Tom got 8 more points. What was Tom's total score after all 6 rounds?
def solve() -> int: first_four_round_score = 5 last_two_round_score = 8 total_score = first_four_round_score + last_two_round_score result = total_score return result
If Alex weighs 60 pounds, 5 pounds less than David but 25 pounds more than Emily, what is the average weight of these three people?
def solve() -> int: alex_weight = 60 david_weight = alex_weight + 5 emily_weight = alex_weight - 25 total_weight = alex_weight + david_weight + emily_weight average_weight = total_weight / 3 result = average_weight return result
A swimmer is doing laps in a pool. The swimmer swims at a consistent pace their entire workout unless they stop for a water break. After swimming for 1 hour, the swimmer stops for 5 minutes. They then swim for another 30 minutes, then stop for 10 minutes. After this, the swimmer will stop for 1 minute after every 5 min...
def solve() -> int: swim_time = 60 + 30 + 120 water_breaks = 1 + 1 + 36 moving_time = swim_time - water_breaks swim_intervals = (swim_time - 90) // 5 rest_time = (swim_intervals * 1) + 90 + 5 + 10 result = rest_time - moving_time return result
A car traveled 78 miles in 1.5 hours. What was its average speed in miles per hour?
def solve() -> int: speed_per_min = 78 / (1.5 * 60) speed_per_hour = speed_per_min * 60 result = speed_per_hour return result
Lily saved $8000 to go on a trip. She spent 3/5 of her savings on flight tickets and shared 1/6 of the rest with her sister. How much money did Lily share with her sister?
def solve() -> int: savings = 8000 spent_on_tickets = savings * 3/5 remaining = savings - spent_on_tickets shared_with_sister = remaining * 1/6 result = shared_with_sister return result
Student: Joe has a wallet with 48 coins in it. Half of the coins are in the pocket. How many coins are in the pocket?
def solve() -> int: total_coins = 48 half_coins = total_coins / 2 result = half_coins return result
Mr. Lee drives to his office every day. He leaves at 7:00 a.m. and takes 20 minutes to reach the highway. If his work starts at 8:30 a.m., how long does it take to reach his workplace from the highway?
def solve() -> int: start_time = 7 * 60 highway_time = 20 work_start_time = 8 * 60 + 30 total_time = work_start_time - (start_time + highway_time) result = total_time return result
Maya is planning a road trip from Los Angeles to San Francisco, a distance of 380 miles. She wants to leave at 8 a.m. and arrive by 4 p.m. She estimates that she will drive at an average of 65 miles per hour and she will need to refuel once, which will take 10 minutes. She also wants to stop for lunch at a scenic spot,...
def solve() -> int: distance = 380 speed = 65 time_limit = 8 refuel_time = 0.167 driving_time = distance / speed remaining_time = time_limit - refuel_time - driving_time distance_before_lunch = (remaining_time / 2 + refuel_time) * speed time_before_lunch = distance_be...
Alex bought 6 bags of chips. If one bag contains 10 chips, how many chips did Alex buy?
def solve() -> int: num_of_chips = 6*10 result = num_of_chips return result
A carpenter can make 12 chairs in a day. If he wants to make 50 chairs, how many days will it take him?
def solve() -> int: chairs_per_day = 12 total_chairs = 50 days = total_chairs // chairs_per_day + (total_chairs % chairs_per_day > 0) result = days return result
Student: A group of friends went to a pizza place and ordered 3 large pizzas and 2 medium pizzas. Each large pizza has 10 slices and each medium pizza has 8 slices. The group ate 75% of the large pizzas and 60% of the medium pizzas. How many slices of pizza were left over?
def solve() -> int: large_pizzas = 3 medium_pizzas = 2 large_slices = 10 medium_slices = 8 large_eaten = large_pizzas * large_slices * 0.75 medium_eaten = medium_pizzas * medium_slices * 0.6 result = large_pizzas * large_slices + medium_pizzas * medium_slices - large_eaten - medium_eaten ...
Samantha is three years younger than Michael. If they have a combined age of 32, how old is Michael?
def solve() -> int: michael_age = 0 samantha_age = 0 michael_age = (32 + 3) / 2 samantha_age = michael_age - 3 result = michael_age return result
Sarah is walking her dogs. They walk 1 mile every 20 minutes. They spend 10 minutes taking a water break. Altogether, how long did Sarah take to walk 5 miles, if she spent 15 minutes playing fetch with the dogs?
def solve() -> int: walk_distance = 5 walk_time = walk_distance * 20 water_break_time = 10 fetch_time = 15 total_time = walk_time + water_break_time + fetch_time result = total_time return result
There were 300 crayons that were evenly split among 15 children. Daniel took one-tenth of his share and gave it to his brother. How many crayons did Daniel give to his brother?
def solve() -> int: total_crayons = 300 num_children = 15 crayons_per_child = total_crayons / num_children daniel_crayons = crayons_per_child daniels_gave_away_crayons = daniel_crayons / 10 result = daniels_gave_away_crayons return result
A laptop costs $1,200 and a printer costs $65. If the total cost is $1,410, how much is the laptop more expensive than the printer?
def solve() -> int: laptop_cost = 1200 printer_cost = 65 total_cost = 1410 total_printer_cost = printer_cost total_laptop_cost = total_cost - total_printer_cost difference = total_laptop_cost - laptop_cost result = difference return result
Sarah wants to save $200 within 6 weeks. If she saves the same amount of money each week, how much should she save each week?
def solve() -> int: total_savings = 200 num_weeks = 6 weekly_savings = total_savings/num_weeks result = weekly_savings return result
An investor purchased 6 acres of land for $2,656 per acre. If they divide the land into 9 lots, what should the price of each lot be if they want to break even?
def solve() -> int: per_acre = 2656 acres = 6 lots = 9 total_cost = per_acre * acres cost_per_lot = total_cost / lots result = cost_per_lot return result
In a basket, there are 8 red balls and 4 green balls. If a ball is chosen randomly, what is the probability that it will be red?
def solve() -> int: total_balls = 12 red_balls = 8 probability_of_red_ball = red_balls/total_balls result = probability_of_red_ball return result
-Eve is a baker who sells cupcakes for $2.50 each. She buys the ingredients for $0.50 per cupcake and pays $0.20 per cupcake for packaging. She also pays a fixed rent of $500 a month for her kitchen space. She sells an average of 150 cupcakes a day on weekdays and 300 cupcakes a day on weekends. She works 5 days a week...
def solve() -> int: days = 20 + 2 * 2 cupcakes = days * 150 + 4 * 300 revenue = cupcakes * 2.5 cost = cupcakes * 0.7 profit = revenue - cost net_profit = profit - 500 result = net_profit return result
Olivia is organizing a swimming competition for a high school sports day. The length of each lane is 50 meters. The school has decided to hire a bigger pool this year which is twice as long as last year. Olivia needs to put in markers after every 25 meters on the sides. What is the total distance between the starting p...
def solve() -> int: pool_length = 2 * 50 marker_distance = 25 total_distance = pool_length + (3 * marker_distance) result = total_distance return result
Four students have to bring some number of notebooks for a group project. Two boys brought 20 notebooks each and two girls brought 25 notebooks each. How many more notebooks did the girls bring than the boys?
def solve() -> int: num_boys = 2 num_girls = 2 boys_notebooks = 20 girls_notebooks = 25 num_boys_notebooks = num_boys * boys_notebooks num_girls_notebooks = num_girls * girls_notebooks difference = num_girls_notebooks - num_boys_notebooks result = difference return result
Every summer, a pool needs to be cleaned before anyone can swim in it again. If the pool cleaner spends 20 minutes cleaning each square foot of the pool, and it took 6 hours to clean the entire pool last time, how long (in hours) will they have to spend cleaning if they have to clean a pool that is twice as big?
def solve() -> int: time_per_sqft = 20 total_time_last_clean = 6 pool_size_last_clean = 1 pool_size_new_clean = pool_size_last_clean * 2 total_time_new_clean = (pool_size_new_clean * time_per_sqft) / 60 total_time_new_clean += total_time_last_clean result = total_time_new_clea...
Roy's folder has 3 times as many sheets of paper as Kiana's folder. Kiana's folder is a fourth of the number of pages in Isabella's folder. If Isabella's folder has 84 pages in total, how many pages are in Roy's folder?
def solve() -> int: kianas = 84/4 roys = kianas * 3 result = roys return result
A gym charges a membership fee of $35 plus $4 for each day visited. How much money will it cost for a person who visited the gym for 10 days?
def solve() -> int: membership_fee = 35 cost_per_day = 4 num_of_days = 10 total_cost = membership_fee + (cost_per_day * num_of_days) result = total_cost return result
A group of six friends went to a movie theater. They bought eight tickets for the movie and five boxes of popcorn. One ticket costs $12, and one box of popcorn costs $5. How much did the group of friends spend in total at the movie theater?
def solve() -> int: tickets = 8 popcorn = 5 ticket_cost = 12 popcorn_cost = 5 total_cost = (tickets * ticket_cost) + (popcorn * popcorn_cost) result = total_cost return result
A store has a sale with a 20% discount on any item. A dress originally costs $80. What is the sale price of the dress after the discount?
def solve() -> int: original_price = 80 discount_percentage = 20 discount_amount = original_price * (discount_percentage / 100) sale_price = original_price - discount_amount result = sale_price return result
Ben collects stamps. He has 48 stamps in his album. He gets 6 new stamps every month from his uncle. How many stamps will he have in his album after 7 months?
def solve() -> int: initial = 48 monthly = 6 final = initial + monthly * 7 result = final return result
Student: Ben is going on a camping trip and bought 5 sleeping bags, each sleeping bag costs $40. If the store gives him a discount of 10%, how much money did he save?
def solve() -> int: sleeping_bag_cost = 40 sleeping_bag_number = 5 discount_rate = 0.1 original_total_cost = sleeping_bag_cost * sleeping_bag_number discount_amount = original_total_cost * discount_rate final_total_cost = original_total_cost - discount_amount money_saved = discount_amount...
Mary had $35. She wanted to buy 2 handbags and 5 headbands. Each handbag cost $17 while each headband cost $4. How much money did she have left?
def solve() -> int: handbag_cost = 17 headband_cost = 4 total_money = 35 handbag_number = 2 headband_number = 5 remaining_money = total_money - handbag_cost * handbag_number - headband_cost * headband_number result = remaining_money return result
Rachel and her friends are having a movie night with 25 bags of popcorn. Rachel brought four times as many bags of popcorn as her friends. If Rachel and her friends eat a third of the bags of popcorn, how many bags of popcorn did they eat in total?
def solve() -> int: rachel_bags = 4 friends_bags = 1 total_bags = 25 rachel_bags_eaten = rachel_bags / 3 friends_bags_eaten = friends_bags / 3 total_bags_eaten = rachel_bags_eaten + friends_bags_eaten result = total_bags_eaten return result
Sarah baked 24 cookies. She gave 8 cookies to her sister and 5 cookies to her neighbor. How many cookies does Sarah have left?
def solve() -> int: cookies_baked = 24 cookies_sister = 8 cookies_neighbor = 5 cookies_left = cookies_baked - cookies_sister - cookies_neighbor result = cookies_left return result
Tom has $800 in his savings account. He deposited $200 in his account for 6 months, with an interest rate of 2.5% per year. How much money does Tom have in his account after the 6 months is over?
def solve() -> int: initial_amount = 800 deposit_amount = 200 interest_rate = 0.025 num_months = 6 monthly_interest_rate = interest_rate / 12 interest_earned = (initial_amount + deposit_amount) * (monthly_interest_rate) * num_months final_balance = initial_amount + deposit_amount + interest_...
Aidan has 16 stickers. His sister has 3 times as many stickers as him. How many stickers do they have together?
def solve() -> int: Aidans_stickers = 16 Sisters_stickers = Aidans_stickers*3 total_stickers = Aidans_stickers + Sisters_stickers result = total_stickers return result
Maria has $120. She spent 1/3 of her money on clothes and 1/6 of it on shoes. She also gave $7 to a charity. How much money does she have left?
def solve() -> int: money = 120 money *= (1-1/3-1/6) money -= 7 result = money return result
A construction worker worked for 8 hours per day for 5 days. His hourly rate is 25 dollars. How much money did he earn?
def solve() -> int: hours_worked_per_day = 8 days_worked = 5 hourly_rate = 25 total_hours_worked = hours_worked_per_day * days_worked total_money_earned = total_hours_worked * hourly_rate result = total_money_earned return result
Sarah had a box of chocolates with 24 pieces. She ate 2 pieces every night for a week and shared 6 pieces with her co-worker. How many pieces of chocolate are still in the box?
def solve() -> int: box_of_chocolates = 24 pieces_eaten_per_night = 2 pieces_shared_with_coworker = 6 total_pieces_eaten = pieces_eaten_per_night * 7 total_pieces_shared = pieces_shared_with_coworker pieces_remaining = box_of_chocolates - total_pieces_eaten - total_pieces_shared ...
A bookshelf contains 4 rows, with 5 books on each row. If each book costs 10 dollars, what is the total cost of the books on the bookshelf?
def solve() -> int: rows = 4 books = 5 price = 10 total_books = rows*books total_cost = total_books*price result = total_cost return result
Jared is growing a garden and has currently harvested 20 tomatoes. If he harvests twice the number of tomatoes each week for the next 4 weeks, how many tomatoes will he have harvested by the end of the 4 weeks?
def solve() -> int: tomatoes_harvested = 20 weekly_harvest = tomatoes_harvested * 2 total_harvest = tomatoes_harvested + (weekly_harvest * 4) result = total_harvest return result
A homeowner is building a fence around their backyard. The backyard measures 60 feet by 40 feet. Every 5 feet, a fence post is placed. If there is a 20-foot wide section where the fence will not be placed because of a garden, how many fence posts will be needed for the rest of the perimeter?
def solve() -> int: length = 60 width = 40 post_spacing = 5 garden_width = 20 perimeter = 2 * (length + width) fence_length = perimeter - garden_width num_posts = fence_length / post_spacing result = num_posts return result
Maggie has a rectangular garden plot that is 12 feet longer than it is wide. If Maggie wants to fence the entire garden and she has 256 feet of fencing material, how wide and long is her plot?
def solve() -> int: l = 0 w = 0 p = 0 l = w + 12 p = 2 * (l + w) w = (256 - p) / 4 result = w, l return result
A painter had 400 ml of paint in a can he was using to paint a wall. He used 1/5 of the paint for the first coat. He then mixed the remaining paint with 200 ml of water to make it thinner. He used 2/3 of the diluted paint for the second coat. How much paint did he have left in the can after the second coat?
def solve() -> int: initial = 400 first = initial / 5 remaining = initial - first water = 200 diluted = remaining + water second = diluted * 2 / 3 left = diluted - second result = left return result
A phone plan costs $50 for the first 5GB of data and $10 for each additional GB. If John used 8.5GB of data, what is his total bill?
def solve() -> int: first_data_limit = 5 additional_cost_per_gb = 10 additional_data = 8.5 - first_data_limit if additional_data > 0: total_cost = 50 + (additional_data * additional_cost_per_gb) else: total_cost = 50 result = round(total_cost,2) return result
Kevin has a jar with 36 marbles. He wants to divide them equally in 5 bags. How many marbles will he have in each bag?
def solve() -> int: marbles = 36 bags = 5 marbles_per_bag = marbles // bags result = marbles_per_bag return result
Jane has twice as much money as Peter. jane has a total of 140 dollars. How much money does Peter have?
def solve() -> int: jane_money = 140 peter_money = jane_money / 2 result = peter_money return result
Student: If a triangle has a base of 5 cm and a height of 8 cm, what is the area of the triangle?
def solve() -> int: base = 5 height = 8 area = 0.5 * base * height result = area return result
A factory workers worked 620 minutes and got paid $76. What was their wage per hour?
def solve() -> int: total_minutes = 620 total_paid = 76 total_hours = total_minutes / 60 wage_per_hour = total_paid / total_hours result = wage_per_hour return result
In a bag with 100 marbles, 25% are yellow and 10% are blue. How many marbles are neither yellow nor blue?
def solve() -> int: total_marbles = 100 yellow_percentage = 0.25 blue_percentage = 0.1 yellow_marbles = total_marbles * yellow_percentage blue_marbles = total_marbles * blue_percentage other_marbles = total_marbles - yellow_marbles - blue_marbles result = other_marbles return result
The area of a rectangle is 64 square meters. If the width of the rectangle is 4 meters, what is the length of the rectangle?
def solve() -> int: area = 64 width = 4 length = area / width result = length return result
Student: A rectangle has a length of 8 inches and a width of 4 inches. What is the perimeter of the rectangle?
def solve() -> int: length = 8 width = 4 perimeter = (length + width) * 2 result = perimeter return result