question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
am buys 6 pencils, 4 pens, and 3 erasers from the store. Each pencil costs 25 cents, each pen costs 50 cents, and each eraser costs 75 cents. How much does Sam spend in total?
def solve() -> int: pencils = 6 pencil_cost = 0.25 pens = 4 pen_cost = 0.50 erasers = 3 eraser_cost = 0.75 pencil_total = pencils * pencil_cost pen_total = pens * pen_cost eraser_total = erasers * eraser_cost purchase_total = pencil_total + pen_total + eraser_total ...
Tim's new video game sells 2,000 copies. His investors provided funds to manufacture 500 copies. He earns $10 for each copy sold, but his distributor takes 5%. How much money did Tim keep not counting the investment funds?
def solve() -> int: copies_sold = 2000 investment_funds = 500 earnings_per_copy = 10 distributor_fee_percentage = 5 total_earnings = copies_sold * earnings_per_copy distributor_fee = total_earnings * distributor_fee_percentage / 100 money_kept = total_earnings - distributor_fee - invest...
Student: Rachel owns 70 tickets. She wants to go on the Ferris wheel 5 times, the roller coaster 8 times and the log ride 15 times. How much money will Rachel need to buy to complete all of her rides?
def solve() -> int: ferris_wheel_price = 10 roller_coaster_price = 15 log_ride_price = 5 num_ferris_wheel_tickets = 5 num_roller_coaster_tickets = 8 num_log_ride_tickets = 15 total_cost = (ferris_wheel_price * num_ferris_wheel_tickets) + (roller_coaster_price * num_roller_coaster_tickets) + ...
Student: Vicki purchased 64 ounces of peanut butter. If one ounce cost 27 cents, how much did Vicki pay for the peanut butter?
def solve() -> int: ounces = 64 cost_per_ounce = 27 total_cost = ounces * cost_per_ounce result = total_cost return result
If Ethan's age was 9 more than five times his younger sister's age when she was 2 and she is now 7, what is the sum of their ages?
def solve() -> int: ethan_age = (5 * 2) + 9 sister_age = 7 sum_of_ages = ethan_age + sister_age result = sum_of_ages return result
A pizza has 8 slices. If a family of 4 persons eat half of the pizza, how many slices of pizza are left?
def solve() -> int: total_slices = 8 no_of_people = 4 slices_eaten = (total_slices / 2) * no_of_people slices_left = total_slices - slices_eaten result = slices_left return result
Emily has 24 marbles and she gave 12 marbles to her friend. She later found 6 more marbles on the ground. How many marbles does she have now?
def solve() -> int: emilys_marbles = 24 - 12 + 6 result = emilys_marbles return result
Amy works as a waitress and earns $10 per hour. She also gets 15% of the total bill as tips. On a busy day, she works for 8 hours and serves 20 tables with an average bill of $40. How much did she make in total?
def solve() -> int: hourly_rate = 10 tip_rate = 0.15 hours = 8 tables = 20 average_bill = 40 wage = hourly_rate * hours tips = tip_rate * tables * average_bill total = wage + tips result = total return result
John bought a pair of shoes that cost $80. He later returned them and received a full refund. He then bought another pair of shoes for $65 and socks for $8.50. If John started with $200, how much money does he have left after returning the first pair of shoes?
def solve() -> int: starting_money = 200 return_amount = 80 new_pair_shoes = 65 socks = 8.50 remaining_money = starting_money - return_amount + new_pair_shoes - socks result = remaining_money return result
arah bought 4 shirts for $15 each and 3 shorts for $20 each. She used the money to buy a backpack for $50. How much money does she have left?
def solve() -> int: shirts_cost = 4 * 15 shorts_cost = 3 * 20 total_cost = shirts_cost + shorts_cost remaining_money = total_cost - 50 result = remaining_money return result
At a shoe store, Tom brought 120 pairs of shoes. He gave 8 pairs of shoes to his 10 friends. He gave everyone else in the store 1 pair of shoes. If he has 62 pairs of shoes left over, how many customers are in the store, including Tom?
def solve() -> int: pairs_of_shoes = 120 friends = 10 left_over = 62 pairs_given_to_friends = 8 * friends pairs_given_to_customers = pairs_of_shoes - pairs_given_to_friends - left_over customers = pairs_given_to_customers + 1 result = customers return result
Emma has $25 in her wallet. She wants to buy a toy for $10 and donate $5 at a local charity. How much money will Emma have left in her wallet?
def solve() -> int: money = 25 toy_price = 10 charity_donation = 5 total_spent = toy_price + charity_donation remaining_money = money - total_spent result = remaining_money return result
Mary has to complete a 6-page essay for her literature class. If she completes 2 pages every day, how many days will it take for her to complete the essay?
def solve() -> int: total_pages = 6 pages_per_day = 2 days_to_complete = total_pages / pages_per_day result = days_to_complete return result
Emma wants to buy a new camera that costs $250. She starts a pet-sitting service to earn extra money. She normally takes care of 1 pet a day for $15/pet. Her aunt agrees to pay her $3 for every extra pet that she takes care of. If she takes care of 3 pets a day for three weeks, how much does she earn?
def solve() -> int: pets_per_day = 3 days_per_week = 7 weeks = 3 camera_cost = 250 pet_fee = 15 extra_pet_fee = 3 total_pets = pets_per_day * days_per_week * weeks extra_pets = total_pets - 1 extra_earnings = extra_pets * extra_pet_fee total_earnings = (total_pets * pet...
san needs to create 214 origami butterflies. She creates 7 of them every 10 minutes. How long will it take her to complete them all?
def solve() -> int: time = 0 butterflies_created = 0 while butterflies_created < 214: butterflies_created += 7 time += 10 result = time return result
A bird flies at an average speed of 15 miles per hour. If the bird flies for 3 hours, how many miles will it have flown in total?
def solve() -> int: speed = 15 time = 3 distance = speed * time result = distance return result
A car takes 3 hours to travel from city A to city B, a distance of 300 miles. If the car runs at an average speed of 60 miles per hour, what is the fuel consumption of the car in gallons? Assume that the fuel consumption of the car is constant throughout the journey.
def solve() -> int: fuel_consumption = 300 / 60 result = fuel_consumption return result
Student: A store is offering a $5 discount for every $50 spent. If Alex buys $150 worth of clothes, how much will he pay before tax and after the discount?
def solve() -> int: amount_spent = 150 discount = 5 discount_threshold = 50 num_discounts = amount_spent // discount_threshold total_discount = num_discounts * discount amount_paid_before_tax = amount_spent - total_discount amount_paid_after_tax = amount_paid_before_tax * 1.07 result = a...
Elena is baking cookies for a school fundraiser. She needs 3 cups of flour for every 12 cookies she makes. She has 15 cups of flour in her pantry and wants to use as much as possible. How many cookies can she make with the flour she has?
def solve() -> int: flour_per_cookie = 3 / 12 flour_in_pantry = 15 cookies = flour_in_pantry / flour_per_cookie result = cookies return result
Student: Rachel is very organized and she likes to save her money as much as possible. She bought a set of tab dividers for her school binder for $4, a set of binder clips for $2, and some loose leaf paper of for $6. She had saved up $15 and needed to buy these items. How much money will she have left over after she bu...
def solve() -> int: tab_dividers = 4 binder_clips = 2 loose_leaf_paper = 6 saved_money = 15 total_cost = tab_dividers + binder_clips + loose_leaf_paper result = saved_money - total_cost return result
At a picnic, there are 6 hot dogs, 8 hamburgers and 10 bags of chips. If each person eats 1 hot dog, 2 hamburgers and 1/2 bag of chips, how many people can be served?
def solve() -> int: hot_dogs = 6 hamburgers = 8*2 chips = 10*1/2 people_served = min(hot_dogs, hamburgers, chips/2) result = f'{people_served} people can be served' result = people_served return result
Student: There are 48 cats on a farm. How many cats would be left if 7 cats were given away?
def solve() -> int: num_cats = 48 num_given_away = 7 num_left = num_cats - num_given_away result = num_left return result
A toy store has a sale on puzzles. The original price of a puzzle is $15, but they are now selling for 20% off. Alice wants to buy 3 puzzles for herself and 2 puzzles for her brother. How much money does she save by buying the puzzles on sale?
def solve() -> int: original_price = 15 discount_rate = 0.2 alice_puzzles = 3 brother_puzzles = 2 discount_amount = original_price * discount_rate sale_price = original_price - discount_amount original_cost = original_price * (alice_puzzles + brother_puzzles) sale_cos...
John had $50 and spent three-fifths of it on books. How much money did he have left?
def solve() -> int: initial_money = 50 faction_spent = 3/5 left_money = initial_money * (1 - faction_spent) result = left_money return result
The price of a shirt is $20. If you buy three shirts, you get a 20% discount. How much do you pay for three shirts?
def solve() -> int: price_per_shirt = 20 num_shirts = 3 total_price = price_per_shirt * num_shirts discount = total_price * 0.2 total_price -= discount result = total_price return result
Emily has a bunch of colorful hair ties that she adores. Her friend offers to trade her 15 hair clips for each hair tie. On the first day, Emily brings her 8 hair ties. On the second day, she brings her double the amount she brought on the first day. On the third day, she brings her 5 less than she brought on the secon...
def solve() -> int: hair_ties_first_day = 8 hair_ties_second_day = hair_ties_first_day * 2 hair_ties_third_day = hair_ties_second_day - 5 hair_clips_per_tie = 15 total_hair_clips = (hair_ties_first_day + hair_ties_second_day + hair_ties_third_day) * hair_clips_per_tie days_last = ...
Lily has a collection of 80 books. She reads 10% of the books and donates 12 books to a library. She then buys 15 new books and borrows 8 books from a friend. How many books does Lily have in her collection now?
def solve() -> int: books_read = 80 * 0.1 books_left = 80 - books_read - 12 books_after = books_left + 15 + 8 result = books_after return result
A coin is flipped 10 times and the results are recorded. If the coin is fair, the probability of getting heads is 0.5. The actual number of heads is 6. What is the difference between the expected number of heads and the actual number of heads?
def solve() -> int: flips = 10 heads = 6 probability = 0.5 expected = flips * probability difference = abs(expected - heads) result = difference return result
Emily has 30% of her monthly salary saved in the bank. If she has $450 in her bank, what is her monthly salary?
def solve() -> int: savings_percentage = 0.3 bank_balance = 450 monthly_salary = bank_balance / savings_percentage result = monthly_salary return result
Zach has 17 bags of chips and needs to divide them among 4 people. How many bags of chips will each person get?
def solve() -> int: total_bags = 17 num_people = 4 num_bags_per_person = total_bags // num_people result = num_bags_per_person return result
Mike and Steve were painting a room. Mike could paint 10 square feet in 20 minutes and Steve could paint 12 square feet in 20 minutes. If Mike took a 30-minute break, what is the difference in the area painted by both after 1 hour?
def solve() -> int: mike_speed = 10 / 20 steve_speed = 12 / 20 mike_area = mike_speed * 60 steve_area = steve_speed * 60 mike_area -= mike_speed * 30 difference = mike_area - steve_area result = difference return result
A store sells laptops for $500 with a discount of 10%. What is the final price of a laptop with the discount included, considering a tax of 8%?
def solve() -> int: original_price = 500 discount_percent = 10 discounted_price = original_price - (original_price * discount_percent / 100) tax_percent = 8 final_price = discounted_price + (discounted_price * tax_percent / 100) result = final_price return result
Maria sold 80 tickets at $25 each in a charity event and donated half of the revenue to a hospital. How much did she donate to the hospital?
def solve() -> int: tickets_sold = 80 ticket_price = 25 revenue = tickets_sold * ticket_price donation = revenue / 2 result = donation return result
Ella baked six times as many cookies as Amy for a bake sale. She also baked five times as many brownies as Amy. If Amy baked 12 cookies and 8 brownies, how many more cookies and brownies do Ella have more than Amy altogether?
def solve() -> int: ella_cookies = 6 * 12 ella_brownies = 5 * 8 amy_cookies = 12 amy_brownies = 8 difference = (ella_cookies + ella_brownies) - (amy_cookies + amy_brownies) result = difference return result
Student: Maria has $40 and wants to buy a shirt that costs $28 and a pair of pants that cost $35. Does she have enough money?
def solve() -> int: shirt_cost = 28 pants_cost = 35 money = 40 total_cost = shirt_cost + pants_cost remaining_money = money - total_cost result = remaining_money >= 0 return result
A hotel offers a weekend package deal that includes 2 nights' stay and 3 meals a day for $300. However, the hotel incurs a cost of $25 per meal. If the hotel has 80 occupancy rate this weekend, how much profit will they make?
def solve() -> int: package_cost = 300 meal_cost = 25 occupancy_rate = 0.8 total_customers = int(occupancy_rate * 80) total_meals = total_customers * 6 total_meal_cost = total_meals * meal_cost total_profit = (package_cost * total_customers) - total_meal_cost result = total_profit re...
Maggie holds the record for the most free throws made in one minute. She was able to make 30 baskets. Andy wants to beat her record. He can currently make 20 baskets in one minute. How many more baskets does he need to make to beat Maggie's record?
def solve() -> int: maggie_record = 30 andy_record = 20 baskets_needed = maggie_record - andy_record result = baskets_needed return result
Mary and her friends are baking cupcakes to raise money for the animal rescue. On the first day, they baked 54 cupcakes and sold 73 cupcakes. On the second day, they baked three times more cupcakes than when they started and sold 84 cupcakes. How many cupcakes did they sell for the two days?
def solve() -> int: cupcakes_day1 = 54 sold_day1 = 73 increase = 3 sold_day2 = 84 result = sold_day1 + (cupcakes_day1 * increase - cupcakes_day1 + sold_day2) return result
Jack is mowing a lawn that is 150 feet wide by 200 feet long. His mower cuts a strip that is 4 feet wide and he can mow 1 foot of grass in about 3 seconds. How long will it take him to mow the entire lawn, in minutes?
def solve() -> int: width = 150 length = 200 strip_width = 4 mow_speed = 1 time_per_foot = 3 total_area = width * length strip_area = strip_width * length total_strips = total_area / strip_area time_per_strip = strip_width * time_per_foot total_time = total_strips * tim...
A spa charges $100 per hour for a massage. A customer receives a 1.5-hour massage and leaves a $20 tip. How much does the customer pay in total?
def solve() -> int: massage_time = 1.5 cost_per_hour = 100 tip = 20 total_cost = (massage_time*cost_per_hour) + tip result = total_cost return result
``` A store sells water bottles for $2 each and sunglasses for $15 each. If a customer purchases 2 water bottles and 1 pair of sunglasses, how much do they spend in total?
def solve() -> int: water_bottle_cost = 2 sunglasses_cost = 15 total_water_bottles = 2 total_sunglasses = 1 total_cost = (water_bottle_cost * total_water_bottles) + (sunglasses_cost * total_sunglasses) result = total_cost return result
The unileapers have one leg. In a pack of unileapers, there are a total of 40 legs. How many unileapers are in the pack?
def solve() -> int: total_legs = 40 legs_per_unileaper = 1 unileapers = total_legs / legs_per_unileaper result = unileapers return result
In a hospital in Florida, there were 800 patients admitted with COVID-19 on a Monday. On Tuesday, the hospital received 200 more patients, but discharged 100 who recovered. On Wednesday, the hospital received 300 more patients, but also had 50 deaths and 150 recoveries. On Thursday, the hospital had no new admissions, ...
def solve() -> int: patients = 800 patients += 200 patients -= 100 patients += 300 patients -= 50 patients -= 150 patients -= 100 patients -= 200 result = patients return result
A train travels 400km in 5 hours. At the same speed, how far will the train travel in 8 hours?
def solve() -> int: distance = 400 * (8/5) result = distance return result
A painter can complete a job in 15 hours. Her assistant takes 25 hours to complete the same job. How long will it take if they work together?
def solve() -> int: et = (1/15)+(1/25) t = 1/et result = t return result
Two cars start driving from the same point at the same time. One car takes 1.5 hours to reach a certain point, and the other car takes 2 hours to reach the same point. What is the average speed of the two cars?
def solve() -> int: car1_time = 1.5 car2_time = 2 total_distance = 2 car1_speed = total_distance / car1_time car2_speed = total_distance / car2_time avg_speed = (car1_speed + car2_speed) / 2 result = avg_speed return result
A recipe calls for 2/3 cups of flour and the baker triples the recipe. How many cups of flour does the baker need to use?
def solve() -> int: flour = 2/3 baker_input = 3 flour_needed = flour * baker_input result = flour_needed return result
There are 30 students in a class. If the teacher wants to give each student 5 pencils, how many pencils does the teacher need to bring?
def solve() -> int: num_students = 30 pencils_per_student = 5 total_pencils = num_students * pencils_per_student result = total_pencils return result
David owns 50 chickens that lay 100 eggs per week. He sells the eggs for $2.50 each. How much money does he make in a year?
def solve() -> int: chickens = 50 eggs_per_week = 100 eggs_price = 2.5 weeks_in_year = 52 total_eggs_in_year = chickens * eggs_per_week * weeks_in_year total_price_in_year = total_eggs_in_year * eggs_price result = total_price_in_year return result
Bob has 16 stickers and he gives 2 stickers to each of his 4 friends. How many stickers does he have left?
def solve() -> int: stickers_given = 2 * 4 stickers_left = 16 - stickers_given result = stickers_left return result
Melissa and her coworkers order lunch from a restaurant for their office. Sandwiches cost $8 each and salads cost $10 each. If they order 5 sandwiches and 3 salads, how much will it cost? Melissa wants to leave a 12% tip for the delivery person. How much will the total cost plus tip be?
def solve() -> int: sandwich_price = 8 salad_price = 10 num_sandwiches = 5 num_salads = 3 total_cost = (sandwich_price * num_sandwiches) + (salad_price * num_salads) tip = total_cost * 0.12 total_cost_with_tip = total_cost + tip result = total_cost_with_tip return resu...
Student: Linda can ride her bike at 14.4 km/h. She needs to go 7 km during her lunch break. How long will it take her to get there?
def solve() -> int: distance = 7 speed = 14.4 time = distance / speed result = time return result
Luke wants to organize his bookshelf, which has 80 books. His sister, Nancy, arranged 20 books. His brother, Mark, arranged one-fourth of the remaining books. How many books are left to be arranged?
def solve() -> int: books_on_shelf = 80 books_arranged_by_nancy = 20 remaining_books = books_on_shelf - books_arranged_by_nancy books_arranged_by_mark = remaining_books / 4 books_left_to_be_arranged = remaining_books - books_arranged_by_mark result = books_left_to_be_arranged return res...
Ethan has 80 feet of cable that he wants to use for wiring his home entertainment system. He cuts it into 8 equal length pieces, but then he realizes it's too short, so he ties two pieces together. The knots then make each piece 3 feet shorter. How long are his pieces of cable after all this?
def solve() -> int: cable_length = 80 num_pieces = 8 piece_length = cable_length / num_pieces tied_pieces_length = piece_length - 3 result = tied_pieces_length return result
A car traveled 200 miles in 5 hours. What was the average speed of the car in miles per hour (mph)?
def solve() -> int: distance = 200 time = 5 average_speed = distance / time result = average_speed return result
A recipe calls for 3 eggs for every 2 cups of flour. If you have 12 eggs, how many cups of flour do you need?
def solve() -> int: egg_count = 12 flour_cups = (egg_count/3)*2 result = flour_cups return result
Student: An aquarium contains 20 gallons of water. If Sam drained 30% of the water, his brother drained half as much as Sam. How many gallons of water did Sam's brother drain?
def solve() -> int: total_water = 20 sam_drain = total_water * 0.3 brother_drain = sam_drain * 0.5 result = brother_drain return result
A carpenter has 105 nails and 80 screws. 35 nails and 45 screws are rusty. How many fastenings in total does the carpenter have without rust?
def solve() -> int: nails = 105 screws = 80 nails_rusty = 35 screws_rusty = 45 nails_good = nails - nails_rusty screws_good = screws - screws_rusty result = nails_good + screws_good return result
Student: The school store is hosting a sale. All items are discounted by 25%. The school store receive $100 worth of books and $90 worth of pens before the discount. How much did they receive after the discount?
def solve() -> int: amount_before_discount = 100 + 90 amount_after_discount = amount_before_discount * 0.75 result = amount_after_discount return result
Lily wants to start a garden. She needs to buy 10 plants at the cost of $7 each. She then needs to purchase gardening tools which cost $50 but she gets a 15% discount. What is the total cost after the discount?
def solve() -> int: plants = 10 plant_cost = 7 total_plant_cost = plants * plant_cost gardening_tools_cost = 50 discount = 0.15 discounted_tools_cost = gardening_tools_cost - (gardening_tools_cost * discount) total_cost = total_plant_cost + discounted_tools_cost result = t...
A train travels 150 miles in 3 hours. If it took 2 hours to travel half that distance, how long did it take to travel the other half?
def solve() -> int: distance_1 = 75 time_1 = 2 speed_1 = distance_1 / time_1 distance_2 = 75 time_2 = distance_2 / speed_1 result = time_2 return result
A pound of ground beef costs $7 and a pound of steak costs $14. If Lisa will buy 4 pounds of ground beef and 2 pounds of steak, how much will it cost?
def solve() -> int: quantity_beef = 4 quantity_steak = 2 price_beef = 7 price_steak = 14 total_cost = quantity_beef*price_beef + quantity_steak*price_steak result = total_cost return result
Tom has 10 marbles and gives 3 to his friend. His friend then gives him 2 back. How many marbles does Tom have now?
def solve() -> int: initial_marbles = 10 marbles_given = 3 marbles_returned = 2 total_marbles = initial_marbles - marbles_given + marbles_returned result = total_marbles return result
Student: In a classroom of 40 students, 50% are boys, out of the remaining students, 25% are blondes, and the rest are brunettes. How many brunette girls are in the class?
def solve() -> int: total_students = 40 boys = total_students * 0.5 girls = total_students - boys blondes = girls * 0.25 brunettes = girls - blondes brunette_girls = brunettes result = brunette_girls return result
Amy has 36 beads in her jewelry box. She used 2/9 of them to make a necklace and 1/6 of the remaining to make a bracelet. Then she bought 12 more beads and used half of them to make another necklace. How many beads does Amy have left in her jewelry box?
def solve() -> int: necklace_beads = 36 * 2 / 9 left_beads = 36 - necklace_beads bracelet_beads = left_beads / 6 left_beads = left_beads - bracelet_beads bought_beads = 12 second_necklace_beads = bought_beads / 2 left_beads = left_beads + bought_beads - second_necklace_beads result = lef...
A class has 24 students and the teacher wants to divide them into equal groups. If the teacher wants at least 4 students in each group, how many groups can be made?
def solve() -> int: students = 24 min_group_size = 4 groups = students // min_group_size result = groups return result
A store sells TVs for either $480 or $720. If they sold 5 $480-TVs and 3 $720-TVs for a total of $3540, how many TVs did they sell altogether?
def solve() -> int: total_tvs = 5 + 3 low_tv_cost = 480 high_tv_cost = 720 total_cost = 3540 total_sales_from_low_tvs = low_tv_cost * 5 total_sales_from_high_tvs = high_tv_cost * 3 total_tvs_sold = (total_cost - (total_sales_from_low_tvs + total_sales_from_high_tvs)) / (high_tv_cost - low_tv...
Alison bought 5 boxes of pencils with 10 pencils in each box. If she gave away half of the pencils, how many pencils does she have left?
def solve() -> int: number_of_boxes = 5 pencils_per_box = 10 total_number_of_pencils = number_of_boxes * pencils_per_box pencils_given_away = total_number_of_pencils / 2 pencils_left = total_number_of_pencils - pencils_given_away result = pencils_left return result
Amy makes 4 times more money per hour than Annie does. If Annie earns $12 per hour, how much money does Amy make in a 5-hour day?
def solve() -> int: hourly_wage_annie = 12 hours = 5 multiple = 4 hourly_wage_amy = hourly_wage_annie * multiple total_wage_amy = hourly_wage_amy * hours result = total_wage_amy return result
Student: A bag of oranges had 15 oranges, each weighing 200 grams. How many kilograms of oranges were in the bag?
def solve() -> int: num_oranges = 15 weight_per_orange = 200 weight_per_orange_in_kg = weight_per_orange / 1000 total_weight_in_kg = num_oranges * weight_per_orange_in_kg result = total_weight_in_kg return result
andi the Thief has 18 coins. She gives 5 to Simon and 5 to Marcia. How many coins does she have left?
def solve() -> int: coins_given_to_Simon = 5 coins_given_to_Marcia = 5 coins_total = 18 coins_left = coins_total - coins_given_to_Simon - coins_given_to_Marcia result = coins_left return result
Student: A rectangular pool measuring 25 meters by 10 meters is being filled with water. How much water has been used so far if the pool is 10% full?
def solve() -> int: length = 25 width = 10 area = length * width percent_full = 10 water_used = area * percent_full / 100 result = water_used return result
Student: In a grocery store, a total of 180 cans of soda were sold in a day. If each pack contained 12 cans, how many packs of soda were sold in the store?
def solve() -> int: total_cans = 180 cans_per_pack = 12 packs_sold = total_cans // cans_per_pack result = packs_sold return result
Student: A new laptop costs $800. If the store is offering a 20% discount, what is the final cost of the laptop?
def solve() -> int: original_price = 800 discount_rate = 0.2 discount_amount = original_price * discount_rate final_cost = original_price - discount_amount result = final_cost return result
Student: Taylor has 8 fewer candies than her brother Zane. If Zane has 24 candies, how many candies does Taylor have?
def solve() -> int: zane = 24 taylor = zane - 8 result = taylor return result
If a soccer team plays 25 games a year and wins 60% of the time, how many games will they win in a year?
def solve() -> int: games = 25 win_rate = 60/100 wins = games * win_rate result = wins return result
Karen has 20 lbs of apples. She uses 3 lbs of apples to make a pie. How many pies can Karen make?
def solve() -> int: apples = 20 apples_per_pie = 3 pies = apples // apples_per_pie result = pies return result
James wants to buy a video game that costs $60. If he only has $45, how much discount does he need to get in order to afford it?
def solve() -> int: game_price = 60 james_money = 45 discount_needed = game_price - james_money result = discount_needed return result
6000 books were shipped to a bookstore. Three-sevenths of the shipment were English books, the rest were Spanish books. How many Spanish books were sent to the bookstore?
def solve() -> int: total_books = 6000 percent_english = 43 percent_spanish = 100 - percent_english num_spanish_books = total_books * (percent_spanish / 100) result = num_spanish_books return result
A bookstore has 345 books in total. Out of those, 87 books are mystery novels and 79 books are romance novels. How many books are neither mystery nor romance novels?
def solve() -> int: total_books = 345 mystery_books = 87 romance_books = 79 other_books = total_books - mystery_books - romance_books result = other_books return result
Sophia, Ethan, Ella, and Noah have a favorite book genre. Ethan's favorite genre has 20 more books than Sophia's. Ella's genre has thrice as many books as Sophia's genre, and Noah's favorite genre is 3/4 as large as Ella's favorite. If Ella has 600 books in her favorite genre, calculate the total number of books in the...
def solve() -> int: sophia_books = 0 ethan_books = sophia_books + 20 ella_books = sophia_books * 3 noah_books = ella_books * 3/4 total_books = sophia_books + ethan_books + ella_books + noah_books result = total_books + 600 return result
A rectangle has an area of 84 square meters and a width of 6 meters. What is the length of the rectangle?
def solve() -> int: area = 84 width = 6 length = area / width result = length return result
A teacher has 60 students in his class. If 35% of them scored an A and the rest got a B, how many students got a B?
def solve() -> int: total_students = 60 percent_a = 35 num_a = total_students * percent_a/100 num_b = total_students - num_a result = num_b return result
Sarah wants to start a book club. She needs to buy 10 copies of the book that costs $20 each. If they want to provide snacks for the meetings that cost $5 per person and she expects 15 people to join, how much will it cost to start the book club?
def solve() -> int: num_books = 10 book_cost = 20 num_people = 15 snack_cost = 5 total_book_cost = num_books * book_cost total_snack_cost = num_people * snack_cost total_cost = total_book_cost + total_snack_cost result = total_cost return result
Karen charges $30 per hour by pet-sitting. She needs to earn at least $2000 for her monthly expenses. She can pet-sit for 5 hours every weekday and 3 hours on a Sunday. How many weeks does it take for Karen to earn enough to cover her monthly expenses?
def solve() -> int: hourly_rate = 30 weekday_hours = 5 * 4 sunday_hours = 3 total_hours = weekday_hours + sunday_hours monthly_income = total_hours * hourly_rate weeks_needed = 2000 / monthly_income result = weeks_needed return result
Alex is renovating his kitchen by installing new tiles on the floor. The kitchen floor is 10 feet by 15 feet, and the tiles are 1 foot by 1 foot. Each tile weighs 3 pounds, and a pound of tiles costs $. 03. What is the total cost of the tiles?
def solve() -> int: kitchen_length = 10 kitchen_width = 15 tile_length = 1 tile_width = 1 tile_weight = 3 tile_cost_per_pound = 0.03 kitchen_area = kitchen_length * kitchen_width tile_area = tile_length * tile_width total_tiles_needed = kitchen_area / tile_area total_weight ...
Student: The local zoo holds an equal number of monkeys and zebras. 7 of the monkeys stay in their own cage, and the remaining monkeys enter an open area for the public to view. An equal number of zebras join the monkeys in the open area, but then only a third of these zebras go back to their own cage. If the zoo holds...
def solve() -> int: monkeys_in_cage = 7 total_animals = 92 monkeys_in_zoo = total_animals // 2 zebras_in_zoo = total_animals // 2 monkeys_in_open_area = monkeys_in_zoo - monkeys_in_cage zebras_in_open_area = monkeys_in_open_area // 3 result = zebras_in_open_area return result
Tom is saving for a trip and sets aside 20% of his monthly salary. He spends 30% of his remaining salary on rent and 40% on food. What percentage of his monthly salary is left for other expenses?
def solve() -> int: salary = 100 savings = salary*0.2 remaining = salary - savings rent = remaining*0.3 food = remaining*0.4 other_expenses = (remaining - rent - food)/salary*100 result = other_expenses return result
A company sells bags of rice for $10 each, with a discount of 7% for buying more than 20 bags. If Tom wants to buy 25 bags, how much will it cost him?
def solve() -> int: rice_bag_cost=10 discount=0.07 total_rice_bags=25 if total_rice_bags>20: rice_bags_cost=(rice_bag_cost*(1-discount))*total_rice_bags else: rice_bags_cost=rice_bag_cost*total_rice_bags result=rice_bags_cost return result
Lily has 4 dollar bills, and each item costs 3 dollars. How many items can she buy?
def solve() -> int: number_items = 0 amount_dollars = 4 cost_per_item = 3 while amount_dollars > 0: if amount_dollars >= cost_per_item: number_items += 1 amount_dollars -= cost_per_item else: break result = number_items return result
rgio needs to buy 120 bottles of water for an event. The price drops by 12% if you buy more than 100 bottles, and each bottle costs $2.50. How much will Sergio pay for the 120 bottles?
def solve() -> int: bottles = 120 price_per_bottle = 2.5 discount_rate = 0.12 discount = (price_per_bottle * (discount_rate * (bottles - 100))) total_cost = (price_per_bottle * bottles) - discount result = total_cost return result
Student: John deposited $20,000 in an account at 5% compounded quarterly for 5 years. What is the total amount he will have in his account after 5 years?
def solve() -> int: P = 20000 r = 0.05 n = 4 t = 5 A = P * (1 + r/n)**(n*t) A = round(A, 2) result = A return result
If a person rolls a pair of dice, what is the probability that the sum of the numbers shown will be 7?
def solve() -> int: possible_outcomes = 6 * 6 desired_outcomes = 6 probability = desired_outcomes / possible_outcomes result = probability return result
If 5 chefs can bake 50 cakes in 2 hours, how many cakes can 15 chefs bake in the same amount of time?
def solve() -> int: chefs_1 = 5 cakes_1 = 50 time_1 = 2 chefs_2 = 15 cakes_2 = (cakes_1 * chefs_2) / chefs_1 result = cakes_2 return result
A restaurant cooked 40 burgers for a party. If the host had 3 burgers but each guest got to have 4 burgers, how many guests were at the party? In a bag of marbles, two-thirds are yellow and one-third of the yellows are shiny. If there are 180 shiny marbles, how many marbles are in the bag?
def solve() -> int: total_burgers = 40 host_burgers = 3 burgers_per_guest = 4 guests = (total_burgers - host_burgers) / burgers_per_guest result = guests shiny_marbles = 180 yellow_marbles = shiny_marbles / (1/3) total_marbles = yellow_marbles / (2/3) return ...
Sarah has a garden with 6 rectangular flower beds. Each flower bed is 6 feet long and 4 feet wide. What is the total area of the garden beds?
def solve() -> int: bed_length = 6 bed_width = 4 num_beds = 6 bed_area = bed_length * bed_width total_area = bed_area * num_beds result = total_area return result
Possible new questions: A cookie recipe calls for 3 cups of flour, 2 cups of sugar, and 1 cup of butter. If Alice has 9 cups of flour, 6 cups of sugar, and 4 cups of butter, how many batches of cookies can she make?
def solve() -> int: flour_batches = 9 // 3 sugar_batches = 6 // 2 butter_batches = 4 // 1 batches = min(flour_batches, sugar_batches, butter_batches) result = batches return result
If a water tank can hold 500 gallons of water, and there are already 120 gallons of water in the tank. How much more water can the tank hold?
def solve() -> int: tank_capacity = 500 current_water = 120 remaining_capacity = tank_capacity - current_water result = remaining_capacity return result
A toy store has a sale on toy cars. They sold 50 cars, making $250, which was $150 less than they would have made if the cars were sold at regular price. How much more would each car cost if the sale wasn't on?
def solve() -> int: cars_sold = 50 sale_revenue = 250 regular_revenue = sale_revenue + 150 total_cars = cars_sold + 50 cost_per_car = regular_revenue / total_cars extra_cost_per_car = cost_per_car - 5 result = extra_cost_per_car return result
Cindy has a rectangular garden that is 8 m long and 6 m wide. She wants to put a fence around it. The fence costs $12 per meter. How much does she need to spend on the fence?
def solve() -> int: length = 8 width = 6 cost_per_meter = 12 perimeter = 2 * (length + width) total_cost = perimeter * cost_per_meter result = total_cost return result