question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A bakery sells cupcakes for $1.5 each and pies for $10 each. They make a profit of 20% on cupcakes and 40% on pies. One day, they sell 120 cupcakes and 15 pies. How much profit do they make in total?
def solve() -> int: cupcakes = 120 pies = 15 cupcake_price = 1.5 pie_price = 10 cupcake_profit = 0.2 pie_profit = 0.4 cupcake_revenue = cupcakes * cupcake_price cupcake_cost = cupcake_revenue / (1 + cupcake_profit) pie_revenue = pies * pie_price pie_cost = pie_revenue / (1 + pie_...
A train travels 540 miles in 9 hours. If it maintains this speed, how long will it take to travel 270 miles?
def solve() -> int: distance = 270 speed = 540/9 time = distance / speed result = time return result
A grocery store wants to offer a 10% discount on all fruits for a day. If a watermelon usually costs $15, what would be the new price during the discount?
def solve() -> int: original_price = 15 discounted_price = original_price*(1 - 0.1) result = discounted_price return result
Result = 20 knots A jogger runs 8 kilometers in 45 minutes. What is the average speed of the jogger in miles per hour?
def solve() -> int: distance = 8 time = 0.75 distance_in_miles = distance * 0.621371 speed = distance_in_miles / time result = speed return result
Tom has $500 in his savings account. He deposits $50 every month. After how many months will he have $1000 in his savings account?
def solve() -> int: savings = 500 deposit = 50 goal = 1000 months = 0 while savings < goal: savings += deposit months += 1 result = months return result
Jack starts his day at 8:00 a.m. He works in his office up to 11:30 a.m. then he takes a break for half an hour and continues working from 12:00 p.m. to 3:30 p.m. How many hours does Jack stay at work?
def solve() -> int: timeInMinutes = 0 timeInMinutes = timeInMinutes + (30 + 180) timeInMinutes = timeInMinutes + 180 result = timeInMinutes/60 return result
Lily drives 120 miles every day. She drives at 40 miles per hour for 1/5 of the time and drives at 50 miles per hour for the rest of the time. If she drives at 50 miles per hour for thrice the amount of time she drives at 40 miles per hour, how long does she drive at 50 miles per hour in minutes?
def solve() -> int: distance = 120 speed1 = 40 speed2 = 50 time1 = 1/5 time2 = 1 - time1 time3 = 3 * time1 distance1 = distance * time1 distance2 = distance * time2 time2_50 = distance2 / speed2 time1_50 = time3 * time1 total_time_50 = time1_50 + time2_50 t...
John has 20 red balls and 30 blue balls. He adds 10 red balls and 15 blue balls. What is the total number of balls John has now?
def solve() -> int: red_balls = 20 + 10 blue_balls = 30 + 15 total_balls = red_balls + blue_balls result = total_balls return result
Mark went on a vacation that cost $3000. He purchased a travel insurance that costs 5% of his vacation cost, a camera that costs $250, and a tripod that costs 70% of the cost of his camera. How much will Mark spend on his vacation in the first year?
def solve() -> int: vacation_cost = 3000 insurance_cost = vacation_cost * 0.05 camera_cost = 250 tripod_cost = camera_cost * 0.70 total_cost = vacation_cost + insurance_cost + camera_cost + tripod_cost result = total_cost return result
Maria is a writer. She owns four fewer notebooks than she has pens, and three more books than she has bookmarks. She also owns two more laptops than she has hands, and one fewer coffee mug than she has notebooks. What is the total number of writing supplies that Maria owns?
def solve() -> int: pens = 0 notebooks = 0 books = 0 bookmarks = 0 laptops = 0 hands = 0 coffee_mug = 0 pens = 10 notebooks = pens - 4 books = bookmarks + 3 laptops = hands + 2 coffee_mug = notebooks - 1 total_supplies = pens + notebooks + books + bookmarks ...
John had 50 marbles, and he gave 10 of them to his sister. Now, John has 2 times more marbles than his sister. How many marbles did his sister have in the beginning?
def solve() -> int: john_marbles = 50 john_gave = 10 john_marbles_after_giving = john_marbles - john_gave sister_marbles = john_marbles_after_giving / 2 result = sister_marbles return result
Lila watches TV shows for 1 hour and 30 minutes every day. On weekends, she watches 2 hours of movies in the morning and 1 hour of TV shows in the afternoon. How many hours does she spend watching TV in a month?
def solve() -> int: daily_tv_time = 1.5 weekend_movie_time = 2 weekend_tv_time = 1 days_in_month = 30 daily_tv_time_month = daily_tv_time * days_in_month weekend_tv_time_month = (weekend_movie_time + weekend_tv_time) * 4 total_tv_time_month = daily_tv_time_month + weekend_tv_tim...
**** Sarah has a total of 252 candy pieces. She gives away 72 pieces to her friends. How many pieces of candy does she have left?
def solve() -> int: initial_amount = 252 given_away = 72 result = initial_amount - given_away return result
A toy store has 150 toys. If the store sells 3/5 of the toys, how many toys are left?
def solve() -> int: initial_toys = 150 percent_of_toys_sold = 3/5 toys_sold = initial_toys * percent_of_toys_sold toys_left = initial_toys - toys_sold result = toys_left return result
John has $50 in his wallet and wants to go to a concert. The ticket price is $28 and he wants to buy at least 2 drinks for $6 each. Does he have enough money for the concert and drinks?
def solve() -> int: ticket_price = 28 num_drinks = 2 drink_price = 6 money_in_wallet = 50 total_cost = (ticket_price + (num_drinks * drink_price)) enough_money = (total_cost <= money_in_wallet) result = enough_money return result
Student: You buy three items of furniture. Item 1 costs $45, item 2 costs $54 and item 3 costs $76. How much money will you spend in total on five sets of 3 items of furniture?
def solve() -> int: item1 = 45 item2 = 54 item3 = 76 total_cost = item1 + item2 + item3 total_cost_5_sets = total_cost * 5 result = total_cost_5_sets return result
In 9 years, Ethan will be three times as old as his cousin Luke. If Luke is currently 10 years old, how old is Ethan?
def solve() -> int: luke_age = 10 ethan_age_in_9_years = 3 * (luke_age + 9) ethan_age = ethan_age_in_9_years - 9 result = ethan_age return result
Student: Peter takes dancing lessons in a local studio. The studio has a $50 enrollment fee, and the monthly lessons cost $120. He also takes special workshops that cost an additional $30 per workshop twice a month. How much money does Peter spend on dancing lessons in the first 6 months?
def solve() -> int: enrollment_fee = 50 monthly_lessons = 120 workshop_fee = 30 months = 6 total_cost = enrollment_fee + (monthly_lessons * months) + (workshop_fee * months * 2) result = total_cost return result
Emily made a big bowl of popcorn with 48 kernels for her movie night. She wants to divide them equally among her and her 3 friends. How many kernels of popcorn will each person get?
def solve() -> int: kernels_of_popcorn = 48 number_of_friends = 3 total_kernels = kernels_of_popcorn / (number_of_friends + 1) result = total_kernels return result
Patrick has 1/4 of a bag of candy left which weighs 9.4 ounces. If the full bag of candy weighed 32 ounces, how much candy did Patrick eat?
def solve() -> int: full_bag_weight = 32 left_bag_weight = 9.4 consumed_candy_weight = full_bag_weight - left_bag_weight result = consumed_candy_weight return result
Assume an economy has a marginal propensity to consume of 0.6. If there is a decrease in investment spending of $100, what will be the new equilibrium level of GDP in the economy?
def solve() -> int: MPC = 0.6 delta_Investment = -100 delta_Y = delta_Investment * (1/(1-MPC)) result = delta_Y return result
Lily paid for a book with 10 $1 bills and a dime. If the book cost $10.10, how much change did Lily receive?
def solve() -> int: num_bills = 10 bill_value = 1 dime_value = 0.1 book_cost = 10.10 total_paid = num_bills * bill_value + dime_value change = total_paid - book_cost result = round(change, 2) return result
A square has a perimeter of 20 cm. What is the length of each side?
def solve() -> int: perimeter = 20 side_length = perimeter / 4 result = side_length return result
A group of friends go out to eat and the meal costs $100 altogether. If there were 5 friends in the group and they each pay an equal amount, how much will each friend pay?
def solve() -> int: total_cost = 100 num_people = 5 price_per_person = total_cost/num_people result = price_per_person return result
A bakery uses twice as much sugar as flour in each cake. If a cake requires 2 cups of flour, how many cups of sugar are needed?
def solve() -> int: flour = 2 sugar = flour * 2 result = sugar return result
Ken bought 6 boxes of cupcakes for $2 each and 6 donuts for $1 each. How much did he spend in total?
def solve() -> int: no_boxes_cupcakes = 6 price_cupcake = 2 no_donuts = 6 price_donut = 1 total_price_cupcakes = no_boxes_cupcakes * price_cupcake total_price_donuts = no_donuts * price_donut total_price = total_price_cupcakes + total_price_donuts result = total_price return re...
A company pays their employees $15 per hour for the first 40 hours per week, and $22.50 per hour for every hour worked over 40 hours. If an employee works 50 hours in one week, how much will they be paid for that week?
def solve() -> int: wage_per_hour = 15 overtime_wage_per_hour = 22.5 hours_worked = 50 if hours_worked <= 40: total_wages = hours_worked * wage_per_hour else: regular_wages = 40 * wage_per_hour overtime_wages = (hours_worked - 40) * overtime_wage_per_hour total_wages ...
Ava and Ethan are planning a beach vacation and need to rent a car for $40 per day. They also need to pay $15 per person per day for a beach cabana. If they are staying for 3 days, how much money will they spend in total?
def solve() -> int: car_rental_per_day = 40 cabana_rental_per_person_per_day = 15 number_of_days = 3 total_car_rental = car_rental_per_day * number_of_days total_cabana_rental = cabana_rental_per_person_per_day * 2 * number_of_days total_money_spent = total_car_rental + total_cabana_re...
If Alex is currently 5 years younger than his sister Rachel, and in 12 years Rachel will be twice as old as him, how old is Alex now?
def solve() -> int: alex_age = 0 rachel_age = 0 alex_age = rachel_age - 5 rachel_age_in_12_years = rachel_age + 12 alex_age_in_12_years = alex_age + 12 rachel_age_in_12_years = 2 * alex_age_in_12_years alex_age = rachel_age_in_12_years / 2 result = alex_age ...
Kevin collected 36 stamps from different countries. He gave 6 of them to his friend Lisa and 4 of them to his brother Tim. Then he bought 12 more stamps from a shop. How many stamps does he have now?
def solve() -> int: stamps = 36 stamps -= 6 + 4 stamps += 12 result = stamps return result
Student: A pizza restaurant has 30 pepperoni pizzas and 15 cheese pizzas. What percentage of the pizzas are pepperoni?
def solve() -> int: pepperoni_pizzas = 30 cheese_pizzas = 15 total_pizzas = pepperoni_pizzas + cheese_pizzas percentage_pepperoni = (pepperoni_pizzas / total_pizzas) * 100 result = percentage_pepperoni return result
Maria bought 4 yards of fabric to make a quilt. The fabric was 44 inches wide. What is the total area, in square inches, of the fabric she bought?
def solve() -> int: yards = 4 width = 44 length = yards * width area = length * width result = area return result
A cake recipe calls for 2 cups of sugar. If Stephanie wants to make 1/3 of the recipe, how much sugar does she need to use?
def solve() -> int: sugar_needed = 2 partial_recipe = 1/3 sugar_partial = sugar_needed * partial_recipe result = sugar_partial return result
John needed to buy a set of appliances for his new apartment. He saw that the store was offering a deal - 10% off if he bought all the items together. He bought a refrigerator, stove, and a dishwasher altogether for $2,845. How much did he save with the deal?
def solve() -> int: total_price = 2845 discount = 0.10 original_price = total_price / (1 - discount) saved_amount = original_price - total_price result = saved_amount return result
A store sells apples for $0.75 a pound. John bought 5 pounds of apples. If he paid $4.00 for the apples, how much change will he receive?
def solve() -> int: price_per_pound = 0.75 pounds_of_apples = 5 total_price = 4.00 change = total_price - (price_per_pound * pounds_of_apples) result = change return result
A fashion store orders 400 shirts from its supplier. Each package of shirts contains 16 shirts. How many packages does the store receive?
def solve() -> int: total_shirts = 400 shirts_per_package = 16 num_packages = total_shirts // shirts_per_package result = num_packages return result
Student: Tim runs a T-shirt printing company and he charges $10 per T-shirt. He is currently selling the T-Shirts at a discount of 20%. What is the discounted price of a T-Shirt?
def solve() -> int: price_per_tshirt = 10 discount_percentage = 20 discounted_price = price_per_tshirt * (1 - discount_percentage/100) result = discounted_price return result
A rectangular prism has a length of 10 cm, a width of 5 cm, and a height of 3 cm. What is the volume of the prism?
def solve() -> int: length = 10 width = 5 height = 3 volume = length * width * height result = volume return result
Mr. Lee has 5 buckets of paint, each with a capacity of 8 liters. He uses the paint to paint his house, and he uses different amounts of paint for different walls. He uses 5/8 of the first bucket for the front wall, 3/4 of the second bucket for the back wall, 2/3 of the third bucket for the left wall, 4/5 of the fourth...
def solve() -> int: bucket_capacity = 8 front_wall = bucket_capacity * 5/8 back_wall = bucket_capacity * 3/4 left_wall = bucket_capacity * 2/3 right_wall = bucket_capacity * 4/5 roof = bucket_capacity * 1/4 total_paint = front_wall + back_wall + left_wall + right_wall + roof result = tot...
A store has 120 pencils and 28 erasers. If they sold 45 pencils and 12 erasers, how many items are left in the store?
def solve() -> int: pencils_remaining = 120 - 45 erasers_remaining = 28 - 12 total_items_remaining = pencils_remaining + erasers_remaining result = total_items_remaining return result
A rectangular prism has a length of 15 cm, a width of 10 cm, and a height of 5 cm. It is cut into smaller cubes with a side length of 1 cm. How many cubes are there and what is the total surface area of all the cubes?
def solve() -> int: length_cubes = 15 // 1 width_cubes = 10 // 1 height_cubes = 5 // 1 total_cubes = length_cubes * width_cubes * height_cubes surface_area_cube = 6 * 1 * 1 total_surface_area = total_cubes * surface_area_cube result = (total_cubes, total_surface_area) return result
A pizza has 8 slices, and each slice has 4 pepperoni pieces. John ate 3 slices of pizza, and Mary ate 2 slices. How many pepperoni pieces did John and Mary eat in total?
def solve() -> int: slices_per_pizza = 8 pepperoni_per_slice = 4 john_slices = 3 mary_slices = 2 pepperoni = (john_slices + mary_slices) * pepperoni_per_slice result = pepperoni print (f'<<<{result}>>>') return result
Chris worked 100 hours and receives $1.50 for every hour worked. How much money did Chris make in total?
def solve() -> int: hours = 100 pay_rate = 1.50 total_pay = hours * pay_rate result = total_pay return result
At a bakery, cupcakes cost $2 each, cookies cost $1.50 each, and brownies cost $2.50 each. How much would it cost to buy six cupcakes, eight cookies, and four brownies?
def solve() -> int: cupcake_price = 2 cookie_price = 1.50 brownie_price = 2.50 cupcake_quantity = 6 cookie_quantity = 8 brownie_quantity = 4 cupcake_cost = cupcake_price * cupcake_quantity cookie_cost = cookie_price * cookie_quantity brownie_cost = brownie_price * brownie_q...
A rectangular garden measures 20 meters by 30 meters. If a person wants to fence the garden, how many meters of fencing will they need?
def solve() -> int: length_in_meters = 20 width_in_meters = 30 perimeter_in_meters = (length_in_meters + width_in_meters) * 2 result = perimeter_in_meters return result
A recipe serves six people. If the ingredients must be doubled to serve twelve people, how many people will be served if the ingredients are tripled?
def solve() -> int: original_serving = 6 new_serving = 12 triple_serving = (new_serving / original_serving) * 3 result = triple_serving return result
The world record for the highest score in a game of chess is 589. Paul currently has a score of 350. He increases his score by 25 points per day. How many days will it take for him to break the world record?
def solve() -> int: record_score = 589 paul_score = 350 increase_per_day = 25 days = (record_score - paul_score) / increase_per_day result = days return result
Ava has a box of crayons with 45 crayons, 60% of which are red. She also has a box of markers with 30 markers, 40% of which are red. What percentage of all her art supplies are red?
def solve() -> int: crayons_total = 45 crayons_red = crayons_total * 0.6 markers_total = 30 markers_red = markers_total * 0.4 total_supplies = crayons_total + markers_total total_red = crayons_red + markers_red percentage_red = (total_red / total_supplies) * 100 resul...
Here are some possible questions: Maria baked 12 more than twice the number of cupcakes as her sister. If her sister baked 15 cupcakes, how many cupcakes did Maria bake?
def solve() -> int: sister_cupcakes = 15 maria_cupcakes = 12 + 2 * sister_cupcakes result = maria_cupcakes return result
Nick drove for 5 hours and 45 minutes on the highway. How far did he drive if he averaged 65 miles per hour?
def solve() -> int: hours = 5 mins = 45 time_in_mins = (hours * 60) + mins total_distance = (time_in_mins/60) * 65 result = total_distance return result
A recipe calls for 3 cups of flour to make 12 cupcakes. If you want to make 30 cupcakes, how many cups of flour do you need?
def solve() -> int: cups_per_cupcake = 3/12 total_cupcakes = 30 total_cups = cups_per_cupcake * total_cupcakes result = total_cups return result
Student: A pizza parlor makes 20 pizzas in 2 hours. How many pizzas can they make in 6 hours?
def solve() -> int: pizzas_made = 20 time_in_hours = 2 time_in_hours_2 = 6 pizzas_made_2 = pizzas_made * (time_in_hours_2 / time_in_hours) result = pizzas_made_2 return result
Mr. Lau keeps 50 rabbits and 4.2 times more chickens. Today, he sold 12 rabbits and three times more chickens than he had yesterday. How many chickens had he left if each rabbit he sells can buy 6 chickens?
def solve() -> int: rabbits = 0 chickens = 0 rabbits = 50 - 12 chickens = 4.2 * (50 - 12) - 3 * 12 result = chickens return result
A bookstore normally sells a book for $20. If Brianna wants to buy 7 books, how much does she need to save? What if there is a sale and the books are sold for $15 each, how much can she save?
def solve() -> int: num_books = 7 original_price = 20 total_cost_original = num_books * original_price sale_price = 15 total_cost_sale = num_books * sale_price amount_saved = total_cost_original - total_cost_sale result = amount_saved return result
Ethan is selling lemonade at a stand near his house. He spends $12 on the ingredients and cups and then sells each cup for $0.75. He also has to pay a $3 fee to the park where he sets up his stand. If he sells 60 cups of lemonade, what is his profit?
def solve() -> int: cost = 12 price = 0.75 fee = 3 sales = 60 revenue = price * sales profit = revenue - cost - fee result = profit return result
ofia is making bracelets with beads. She has 3 boxes of beads, each containing 120 beads. She uses 15 beads for each bracelet, and she makes 4 bracelets of different colors. Each color needs a different number of beads: red needs 5, blue needs 4, yellow needs 3, and green needs 2. How many beads of each color does Sofi...
def solve() -> int: total_beads = 3 * 120 red_beads = 5 * 4 blue_beads = 4 * 4 yellow_beads = 3 * 4 green_beads = 2 * 4 beads_used = red_beads + blue_beads + yellow_beads + green_beads red_left = total_beads - red_beads blue_left = total_beads - blue_beads yellow_left ...
Christina is remodeling a room that measures 15 meters by 10 meters. She wants to tile the room with rectangular tiles which measures 30 cm by 20 cm. How many tiles does Christina need in total?
def solve() -> int: room_length = 15 room_width = 10 total_area_of_room = room_length*room_width tiles_needed = total_area_of_room/0.3/0.2 result = tiles_needed return result
A toy store sells board games for $30, puzzles for $15, and stuffed animals for $20. If they sold 3 board games, 5 puzzles, and 10 stuffed animals, how much did they make in total?
def solve() -> int: board_games_sold = 3 puzzles_sold = 5 stuffed_animals_sold = 10 cost_per_board_game = 30 cost_per_puzzle = 15 cost_per_stuffed_animal = 20 total_earned = board_games_sold * cost_per_board_game + puzzles_sold * cost_per_puzzle + stuffed_animals_sold * cost_per_stuffed...
Student: A store has to buy 12 new refrigerators. Each refrigerator costs $750. If the store has already bought 9 refrigerators, how much money has the store spent so far?
def solve() -> int: price_per_refrigerator = 750 number_of_refrigerators_bought = 9 total_cost = price_per_refrigerator * number_of_refrigerators_bought result = total_cost return result
Kate is paid $12 per hour and also earns $0.50 for every item sold. If Kate worked for 8 hours and sold 15 items, how much did she earn that day?
def solve() -> int: hourly_rate = 12 items_sold = 15 hourly_wage = hourly_rate * 8 item_wage = 0.5 * items_sold total_earnings = hourly_wage + item_wage result = total_earnings return result
A jacket is on sale for $64, which is 80% of its original price. What is its original price?
def solve() -> int: sale_price = 64 percentage = 80 original_price = (sale_price * 100) / percentage result = original_price return result
A box contains 30 pieces of candy. If you took out 20% of the candy, how many pieces of candy are left in the box?
def solve() -> int: total_candy = 30 percent_taken = 0.2 candy_left = total_candy - (total_candy*percent_taken) result = candy_left return result
Student: At Isabelle's 7th birthday party, her parents bought a Ladybug piñata for $15 and filled it with snacks. They bought 5 bags of Skittles for $7 each, 4 bags of Hershey's for $8 per bag, and 3 bags of Kit Kat for $6 per bag. How much did the Ladybug piñata and the treats cost altogether?
def solve() -> int: pinata_cost = 15 skittles_cost = 7 hersheys_cost = 8 kitkat_cost = 6 total_treats_cost = (5 * skittles_cost) + (4 * hersheys_cost) + (3 * kitkat_cost) total_cost = pinata_cost + total_treats_cost result = total_cost return result
The sum of the ages of John and his father is 45. If John's age is 15, what is his father's age?
def solve() -> int: johnAge = 15 totalAge = 45 fatherAge = totalAge - johnAge result = fatherAge return result
If there are 6 more oranges than 8 times the number of bananas John has and John has a total of 62 oranges, how many bananas does he have?
def solve() -> int: bananas = (62 - 6) / 8 result = bananas return result
Student: At a bakery, Tom bought 2 chocolate cakes, 1 apple pie, and 3 muffins for a total of $30. If a chocolate cake costs $11, an apple pie is $4 more than a chocolate cake, and a muffin is $2 less than a chocolate cake, how much is an apple pie?
def solve() -> int: chocolate_cake_price = 11 apple_pie_price = chocolate_cake_price + 4 muffin_price = chocolate_cake_price - 2 total_price = 30 total_chocolate_cake_price = 2 * chocolate_cake_price total_apple_pie_price = apple_pie_price total_muffin_price = 3 * muffin_price total_pric...
Yesterday, Mia received $50 from her aunt and $20 from her brother. Today, she spent $30 on groceries and $15 on gas for her car. She then found a lost $10 bill on the ground. How much money does Mia have now?
def solve() -> int: money = 50 + 20 money = money - 30 money = money - 15 money = money + 10 result = money return result
Erik invested $10,000 in a stock market on January 1, 2021. On May 1, 2021, he checked that the investment value reduced to $8,000. If the value of his investment decreases by $25 every day, what was the total loss he incurred between January 1 and May 1, 2021?
def solve() -> int: initial_investment = 10000 current_value = 8000 daily_decrease = 25 days = (current_value - initial_investment) / daily_decrease total_loss = days * daily_decrease result = total_loss return result
Student: Lorenzo wants to rent a car for a weekend trip. The rental company charges $50 per day and $0.25 per mile. Lorenzo expects to drive 200 miles on the first day, 150 miles on the second day, and 100 miles on the last day. How much will he pay for the rental, excluding any fees or taxes?
def solve() -> int: day1_miles = 200 day2_miles = 150 day3_miles = 100 day1_cost = 50 * 1 + day1_miles * 0.25 day2_cost = 50 * 1 + day2_miles * 0.25 day3_cost = 50 * 1 + day3_miles * 0.25 total_cost = day1_cost + day2_cost + day3_cost result = total_cost return result
Bill can peel 50 potatoes in 10 minutes. How many minutes would it take him to peel 80 potatoes at the same rate?
def solve() -> int: potatoes_peeled = 50 minutes_taken = 10 potatoes_to_peel = 80 rate_of_peeling = potatoes_peeled / minutes_taken minutes_required = potatoes_to_peel / rate_of_peeling result = minutes_required return result
There are 25 marbles in a jar. If there are only 10 marbles left after a week and John took out twice the number of marbles each day, how many marbles did he take out in five days?
def solve() -> int: jar = 25 left = 10 days = 7 took_out_each_day = (jar - left) / (2 * days) took_out_in_five_days = took_out_each_day * 5 result = took_out_in_five_days return result
A company has two divisions. The first division earns $100,000 per month, while the second division earns $80,000 per month. What is the total earning of both divisions in a year?
def solve() -> int: division1_monthly_earnings = 100000 division2_monthly_earnings = 80000 total_monthly_earnings = division1_monthly_earnings + division2_monthly_earnings total_yearly_earnings = total_monthly_earnings * 12 result = total_yearly_earnings return result
Q10: At the start of a tour, 18 people got on the bus. 9 of them departed and 5 joined the tour group. How many people are on the tour now?
def solve() -> int: start_number = 18 departed_number = 9 joined_number = 5 result = start_number - departed_number + joined_number return result
Wilma bought 6 notebooks for €7.20. If she wants to buy 9 more notebooks, how much will she pay?
def solve() -> int: notebooks_bought = 6 total_cost = 7.20 cost_per_notebook = total_cost / notebooks_bought additional_notebooks = 9 additional_cost = cost_per_notebook * additional_notebooks total_payment = total_cost + additional_cost result = total_payment return resul...
Samantha and Jason are choosing between two laptops. The first laptop was affordable but had lower specifications. The second laptop was twice as expensive as the first one, but had top-notch specifications. They chose to buy the first laptop, knowing that the total cost of both laptops was $2000. How much did Samantha...
def solve() -> int: x = 2000/3 result = x return result
Ethan is baking cookies for his class. He follows a recipe that makes 24 cookies and uses 2 cups of flour. He wants to make 36 cookies instead. How many cups of flour does he need to use?
def solve() -> int: ratio = 24 / 2 flour = 36 * ratio result = flour return result
Bailey collected 180 marbles and sorted them into three jars. The first jar had 40% of the marbles, the second jar had twice as many marbles as the first jar, and the third jar had the rest of the marbles. How many marbles were in the third jar?
def solve() -> int: first = 180 * 0.4 second = first * 2 third = 180 - first - second result = third return result
Student: Tom and Jerry were buying candy for Halloween. They found a store that sold 3 types of candy: chocolate bars, gummy bears, and lollipops. The chocolate bars cost $0.75 each, the gummy bears cost $0.50 for a pack of 10, and the lollipops cost $0.10 each. They wanted to buy 50 pieces of candy in total, with at l...
def solve() -> int: choco_bars = 10 gummy_bears_packs = 2 lollipops = 38 choco_bars_cost = choco_bars * 0.75 gummy_bears_cost = gummy_bears_packs * 0.50 lollipops_cost = lollipops * 0.10 total_cost = choco_bars_cost + gummy_bears_cost + lollipops_cost result = total_cost return resu...
David is saving money for a new video game. He has $20 in his piggy bank and gets $5 every week for doing chores. He spends $3 every week on candy. How many weeks will it take him to save $50?
def solve() -> int: money = 20 week = 0 while money < 50: money = money + 5 - 3 week = week + 1 result = week return result
John had to restring 7 trumpets with 3 strings each, 12 trombones with 6 strings each and 3 fewer 7 string trumpets compared to the trombone sets. How many strings does he need?
def solve() -> int: number_of_trumpets = 7 number_of_3_string_trumpets = number_of_trumpets * 3 number_of_trombones = 12 number_of_6_string_trombones = number_of_trombones * 6 number_of_7_string_trumpets = number_of_trombones - 3 total_strings = number_of_3_string_trumpets + number_of_6_string_t...
Tom is a window washer and has to climb ladders multiple times a day. He climbs his full ladder, which has 8 steps, 15 times today. He also climbs his smaller ladder, which has 4 steps, 10 times today. He did not climb any steps otherwise. In total, how many times has Tom climbed a step today?
def solve() -> int: full_ladder = 8 small_ladder = 4 full_ladder_climbs = 15 small_ladder_climbs = 10 total_climbs = (full_ladder * full_ladder_climbs) + (small_ladder * small_ladder_climbs) result = total_climbs return result
Student: In a jewelry shop, Tina bought 5 rings at $9 each, 7 necklaces at $15 each and 4 lockets at $11 each. How much change does she get if she pays with a hundred dollar bill?
def solve() -> int: rings = 5 necklaces = 7 lockets = 4 cost_rings = rings * 9 cost_necklaces = necklaces * 15 cost_lockets = lockets * 11 total_cost = cost_rings + cost_necklaces + cost_lockets payment = 100 change = payment - total_cost result = change return result
John had 15 baseball cards. He gave away 3 and bought 10 more. How many baseball cards does John have now?
def solve() -> int: baseball_cards = 15 baseball_cards -= 3 baseball_cards += 10 result = baseball_cards return result
A rectangle has a length of 10 cm and a perimeter of 28 cm. What is the width of the rectangle?
def solve() -> int: length = 10 perimeter = 28 width = (perimeter - 2 * length) / 2 result = width return result
Lucy needs to buy 28 gallons of gasoline. If one gallon costs $4, how much does she need to pay?
def solve() -> int: price_per_gallon = 4 number_of_gallons = 28 total_cost = price_per_gallon * number_of_gallons result = total_cost return result
A company had 500 employees last year. This year, 10% of the employees quit and 5% were fired. How many employees does the company have now?
def solve() -> int: employees_last_year = None quit_percentage = None fired_percentage = None employees_quit = None employees_fired = None total_employees = None result = total_employees return result
A box of 12 pens costs $20. If the store wants to make a profit of $5, how much should they sell each pen?
def solve() -> int: num_pens = 12 box_price = 20 profit = 5 total_cost_per_pen = (box_price + profit) / num_pens result = total_cost_per_pen return result
A rectangular piece of fabric is 9 feet long and 5 feet wide. How many inches of trim are needed to go all the way around the piece of fabric, if the trim will be placed exactly on the edges?
def solve() -> int: fabric_length_ft = 9 fabric_width_ft = 5 fabric_length_in = fabric_length_ft * 12 fabric_width_in = fabric_width_ft * 12 trim_needed_in = 2 * (fabric_length_in + fabric_width_in) result = trim_needed_in return result
-Kevin collected 36 rocks. He gave away 1/3 of his rocks to his brother and 1/4 of his remaining rocks to his sister. How many rocks did Kevin have left?
def solve() -> int: rocks_brother = 36 * 1/3 rocks_left = 36 - rocks_brother rocks_sister = rocks_left * 1/4 rocks_left = rocks_left - rocks_sister result = rocks_left return result
A bucket contains 5 liters of water. If 2 liters are removed, what percentage of water is left in the bucket?
def solve() -> int: initial_water = 5 removed_water = 2 remaining_water = initial_water - removed_water percentage_left = (remaining_water / initial_water) * 100 result = percentage_left return result
A store sells packs of pencils that each contain 6 pencils and erasers that come in packs of 4. If Jack buys 2 packs of pencils and 3 packs of erasers, how many erasers does he have in total?
def solve() -> int: num_pencil_packs = 2 pencils_per_pack = 6 num_eraser_packs = 3 erasers_per_pack = 4 total_erasers = num_eraser_packs * erasers_per_pack result = total_erasers return result
Two numbers differ by 7. The sum of their squares is 269. What are the two numbers?
def solve() -> int: squares_sum = 269 difference = 7 x = (squares_sum - difference ** 2) / 2 y = x - difference result = (x, y) return result
A car leaves a city at a speed of 50 miles per hour. Another car leaves the same city 2 hours later at a speed of 70 miles per hour. How long does it take for the second car to catch up with the first one?
def solve() -> int: speed_difference = 70-50 initial_distance = 50*2 time = initial_distance/speed_difference result = time return result
On Monday, Scott lifted 50 pounds. On Tuesday, he lifted 25% less as he did on Monday. On Wednesday, he lifted twice as much as he did on Tuesday. How many pounds did Scott lift in total during those three days?
def solve() -> int: weight_monday = 50 weight_tuesday = weight_monday * 0.75 weight_wednesday = weight_tuesday * 2 total_weight = weight_monday + weight_tuesday + weight_wednesday result = total_weight return result
John has bought 6 candy bars, each costing $2. How much will it cost him if he wants to buy an equal number of packs of gum that each cost $0.7?
def solve() -> int: candy_cost = 2 * 6 gum_cost = 0.7 * 6 total_cost = candy_cost + gum_cost result = total_cost return result
Student: Pete had 83 channels as part of his cable package and decided to add the premium sports package and asked the cable company to take away 10 of his existing channels and replace them with 9 new channels. How many channels does Pete have now?
def solve() -> int: channels_before = 83 premium_sports = 9 channels_removed = 10 channels_after = channels_before + premium_sports - channels_removed result = channels_after return result
A baker has 20 kg of flour. He uses 500 g of flour to bake 1 cake. If he bakes 5 cakes every day, how long will the flour last before he needs a new stock of flour?
def solve() -> int: flour_amount = 20 * 1000 cake_flour = 500 cakes_per_day = 5 total_cake_flour = cakes_per_day * cake_flour days_left = flour_amount / total_cake_flour result = days_left return result
Tom is running a race. The race is 3 miles long. If he runs at a pace of 6 miles per hour, how many minutes will it take him to finish the race?
def solve() -> int: distance = 3 speed = 6 time = distance/speed * 60 result = time return result
James has a flower bed consisting of 2 large sections and 4 small sections. Each large section can hold 20 flowers and each small section can hold 15 flowers. If he plants in all sections, what is the maximum number of flowers James can plant?
def solve() -> int: large_section_capacity = 20 small_section_capacity = 15 number_of_large_sections = 2 number_of_small_sections = 4 total_large_section_capacity = large_section_capacity * number_of_large_sections total_small_section_capacity = small_section_capacity * number_of_small...
Janine ran 3 miles in 20 minutes. How many miles did she run in 30 minutes?
def solve() -> int: miles_ran_in_20_minutes = 3 minutes_needed = 30 miles_ran_in_30_minutes = miles_ran_in_20_minutes * (30/20) result = miles_ran_in_30_minutes return result