question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
David has 55 packets of sugar for his company. He needs to divide those packets evenly among 7 shops. How many sugar packets does each shop get?
def solve() -> int: packets_each = 55 / 7 result = packets_each return result
A school cafeteria needs to order juice boxes for 200 students. Each student drinks 2 juice boxes each week. How many boxes should the cafeteria order for a 10-week semester?
def solve() -> int: students = 200 juice_boxes_per_student = 2 weeks = 10 total_juice_boxes_needed = students * juice_boxes_per_student * weeks result = total_juice_boxes_needed return result
The shoe store sells sneakers for $50 and sandals for $30. They earned $420 from sales. If they sold 8 pairs of sneakers, how many pairs of sandals did they sell?
def solve() -> int: sneaker_price = 50 sandals_price = 30 total_earnings = 420 sneaker_quantity = 8 sneaker_earnings = sneaker_price * sneaker_quantity sandals_earnings = total_earnings - sneaker_earnings sandals_quantity = sandals_earnings / sandals_price result = sandals_quan...
Kevin has been collecting stamps for the past 10 years. He started with 100 stamps and bought 50 more stamps every year. He also sold 20 stamps every year to other collectors. How many stamps does Kevin have in his collection after 10 years?
def solve() -> int: years_collecting = 10 initial_stamps = 100 stamps_bought = 50 stamps_sold = 20 net_change = stamps_bought - stamps_sold final_stamps = initial_stamps + net_change * years_collecting result = final_stamps return result
Student: A water tank has a capacity of 5000 gallons. If it is currently 60% full, how much water needs to be added to fill it up completely?
def solve() -> int: tank_capacity = 5000 current_fill = tank_capacity * 0.6 water_needed = tank_capacity - current_fill result = water_needed return result
Mark got 12 marks less in Chemistry than he got in Physics. He also got 8 marks more in English than he got in French. If he scored 70 in French and scored 1/8 less marks than Physics, what's the total number of marks he scored?
def solve() -> int: physics_marks = 80 chemistry_marks = physics_marks - 12 french_marks = 70 english_marks = french_marks + 8 total_marks = physics_marks + chemistry_marks + french_marks + english_marks result = total_marks return result
Student: Tracy is making cookies for her family's dinner. She wants to mix one part sugar with two parts flour. If she combines 72 ounces of sugar with 144 ounces of flour, how much cookie dough can she make in total?
def solve() -> int: sugar = 72 flour = 144 total_dough = sugar + flour result = total_dough return result
John is 4 years older than twice the age of his sister Sally. Sally is 6 years old. How old is John?
def solve() -> int: sally_age = 6 john_age = 2*sally_age + 4 result = john_age return result
Student: A train travels from city A to city B at a speed of 80 km/h. The distance between the two cities is 200 kilometers. How long will it take for the train to reach city B?
def solve() -> int: speed = 80 distance = 200 time = distance / speed result = time return result
John has twice as many marbles as Sarah. If they have a total of 90 marbles, how many marbles does Sarah have?
def solve() -> int: total_marbles = 90 john_marbles = total_marbles/3*2 sarah_marbles = total_marbles/3 result = sarah_marbles return result
A soccer game starts at 3:30 PM and lasts for 1 hour and 45 minutes. What time does the game end?
def solve() -> int: end_time_hour = 3 + 1 end_time_minute = 30 + 45 if end_time_minute >= 60: end_time_hour += 1 end_time_minute -= 60 result = str(end_time_hour) + ':' + str(end_time_minute) +'PM' return result
When the cafe opened up in the morning, the staff had 4 new employees. At the end of the day, 2/3rd of them had left. If the cafe started with 15 employees, how many were left at the end of the day?
def solve() -> int: new_employees = 4 total_employees_start = 15 employees_left = (2/3) * new_employees total_employees_end = total_employees_start - employees_left result = total_employees_end return result
The dance team is having a bake sale and wants to buy ingredients for individual baggies of chips. Chips come in packs of 12. How many packs do they need to buy if they have 20 people working the bake sale?
def solve() -> int: no_of_workers = 20 packs_needed = no_of_workers // 12 remainder = no_of_workers % 12 if remainder > 0 : packs_needed = packs_needed + 1 result = packs_needed return result
The local zoo has 300 animals of different species. The zoo spends 12% of its monthly budget on food for the animals, 20% on salaries for the staff, and 8% on maintenance. The zoo's monthly budget is $60,000. How much money does the zoo spend on food for each animal on average?
def solve() -> int: food = 0.12 * 60000 salaries = 0.2 * 60000 maintenance = 0.08 * 60000 left = 60000 - food - salaries - maintenance per_animal = food / 300 result = per_animal return result
Sarah weighs 50 kg. She is using a resistance band that has a tension of 1.5 times her weight and is also carrying a medicine ball that weighs 25% of her body weight. What is the total weight she is moving with?
def solve() -> int: weight = 50 tension = 1.5 * weight medicine_ball_weight = 0.25 * weight total_weight = weight + tension + medicine_ball_weight result = total_weight return result
Laura bikes from her home to the pond and then bikes the same distance to her grandparents' house. It takes her three times as long to bike to her grandparents' house as it takes her to bike to the pond. If Laura and her grandparents bike back to the pond together, how many miles did they bike in total today?
def solve() -> int: distance_to_pond = 10 time_to_pond = 1 time_to_grandparents = 3 * time_to_pond distance_to_grandparents = distance_to_pond total_distance = 2 * distance_to_pond + distance_to_grandparents result = total_distance return result
Kayla has 28 apples and Celeste has 4 times the number of apples that Kayla has. How many apples does Celeste have?
def solve() -> int: apples_kayla = 28 apples_celeste = 4 * apples_kayla result = apples_celeste return result
Possible new questions and programs are: Leon bought a shirt for $15 and a pair of jeans for $25. He also paid 10% sales tax on his purchase. How much money did Leon spend in total?
def solve() -> int: subtotal = 15 + 25 tax = subtotal * 0.1 total = subtotal + tax result = total return result
A museum attracted 30 visitors on a certain day, comprising of 20 adults and 10 seniors. The total admission fee was $190, with each senior ticket costing $6. What was the cost of one adult ticket?
def solve() -> int: seniors = 10 senior_ticket_cost = 6 total_visitors = 30 adults = total_visitors - seniors total_admission_fee = 190 adult_ticket_cost = (total_admission_fee - (seniors * senior_ticket_cost)) / adults result = adult_ticket_cost return result
A grocery store sells oranges by the pound for $0.50. If one orange weighs approximately 0.3 pounds, how much does one orange cost?
def solve() -> int: price_per_pound = 0.50 weight_of_orange = 0.3 price_per_orange = price_per_pound * weight_of_orange result = price_per_orange return result
Student: John has 45 books in his bookcase and Kate has 18. How many books must John give to Kate to make their bookcase collections equal?
def solve() -> int: john = 45 kate = 18 difference = john - kate books_to_give = difference // 2 result = books_to_give return result
Lena wanted to treat her friends to a comedy show. She bought tickets for 8 people and they cost $25 each, with a $20 online processing fee. How much did Lena pay in total for the tickets?
def solve() -> int: tickets = 8 ticket_cost = 25 processing_fee = 20 total_cost = tickets * ticket_cost + processing_fee result = total_cost return result
Ella has 850 ping pong balls. She wants to divide them evenly between 5 friends. How many ping pong balls does each friend get?
def solve() -> int: total_balls = 850 friends = 5 balls_for_each_friend = total_balls // friends result = balls_for_each_friend return result
Jacob and his 5 friends want to split a pizza evenly. The pizza has 8 slices in total. What is the whole number of slices each person will receive?
def solve() -> int: total_slices = 8 number_of_people = 6 slices_per_person = total_slices // number_of_people result = slices_per_person return result
Mariah earns a commission of 3% on every sale she makes. This month, she sold 15 items that cost an average of $450 each. How much money did Mariah earn in commission this month?
def solve() -> int: num_sales = 15 avg_price = 450 total_sales = num_sales * avg_price commission_rate = 0.03 total_commission = total_sales * commission_rate result = total_commission return result
A teacher gave 50 candies to his students. After some time, 10 candies still were with the students, and 5 more candies were given to them. How many candies there now?
def solve() -> int: candies_given = 50 candies_remaining = candies_given - 10 candies_now = candies_remaining + 5 result = candies_now return result
Ethan read 10 books in a month. Ava read 4 more books than Ethan and half as many books as Katie. They participated in a reading challenge and for each book they read they won $5. How much did they earn from the challenge?
def solve() -> int: ethan_books = 10 ava_books = ethan_books + 4 katie_books = ava_books * 2 total_books = ethan_books + ava_books + katie_books total_earnings = total_books * 5 result = total_earnings return result
Olivia is 14 years younger than Max. In 2016, Olivia is 20 years old. How old would Max be in 2021?
def solve() -> int: max_age_2016 = 20 olivia_age_2016 = max_age_2016 - 14 max_age_2021 = max_age_2016 + (2021 - 2016) result = max_age_2021 return result
David loves running. He runs twice a week and uses a pair of running shoes that cost him $100. There is a clearance sale in a store where the same shoes are sold at $70. How much would David save in six months if he buys the discounted shoes?
def solve() -> int: weeks = 26 runs = 2 * weeks original_cost = 100 discounted_cost = 70 savings_per_pair = original_cost - discounted_cost total_savings = savings_per_pair * runs / 2 result = total_savings return result
A school choir is performing at a charity concert. Each member sold 5 tickets in two days. After the third day, they found that they need to sell 50 more tickets to reach their target. How many tickets do they need to sell to reach their target?
def solve() -> int: members = 10 tickets_per_member = 5 days = 3 target = members * tickets_per_member * days + 50 result = target - (members * tickets_per_member * days) return result
A farm produces 100 eggs per day and wants to increase its annual production to 36,500 eggs. How many more eggs should they produce per day to reach their target?
def solve() -> int: eggs_per_day = 100 days_per_year = 365 current_production = eggs_per_day * days_per_year target_production = 36500 additional_eggs_per_day = (target_production - current_production) / days_per_year result = additional_eggs_per_day return result
A recipe serves 4 people. If you need to serve 20 people, how many times should you multiply the recipe?
def solve() -> int: serves = 4 num_people = 20 recipe_multiplier = num_people // serves result = recipe_multiplier return result
A woman runs 3 miles every day for 6 days in a week. How many miles does she run in total?
def solve() -> int: miles_daily = 3 days_week = 6 total_miles = miles_daily * days_week result = total_miles return result
san combined 4 bags of marbles for a total of 336 marbles. If each bag had the same amount, how many marbles were in each bag?
def solve() -> int: total_marbles = 336 num_of_bags = 4 marbles_per_bag = total_marbles // num_of_bags result = marbles_per_bag return result
A box of pencils contains 24 pencils. If each student needs 2 pencils, how many boxes of pencils are needed for a class of 30 students?
def solve() -> int: pencils_per_box = 24 pencils_per_student = 2 num_students = 30 num_boxes = num_students * pencils_per_student / pencils_per_box result = num_boxes return result
At his sports store, Mark has a collection of 70 baseball bats where he rewards three to his customers for every 12 they buy. If he had 20 customers that day, a sixth of whom bought 24 baseball bats each, calculate the number of baseball bats remaining in the rewards collection.
def solve() -> int: bats_bought_24 = 20 / 6 * 24 total_bats_bought = bats_bought_24 + (20 - (20 / 6)) * 12 bats_rewarded = total_bats_bought // 12 * 3 bats_remaining = 70 - bats_rewarded result = bats_remaining return result
Alex receives a 25% bonus on his commission of 20,000$, but he lost 15% to taxes, 5% to 401k, and 300$ to transportation. What is the net commission he takes home?
def solve() -> int: commission = 20000 bonus = commission * 0.25 commission_with_bonus = commission + bonus taxes = commission_with_bonus * 0.15 commission_after_taxes = commission_with_bonus - taxes retirement = commission_after_taxes * 0.05 commission_after_retirement = commission_after_ta...
A school has 300 students and 20 teachers. Each teacher has 6 classes with 15 students each. How many students does a teacher teach in one day?
def solve() -> int: students = 300 teachers = 20 classes_per_teacher = 6 students_per_class = 15 students_per_day = classes_per_teacher * students_per_class result = students_per_day return result
A pizza restaurant sold 3 large pizzas and 5 medium pizzas. Large pizzas have 8 slices and medium pizzas have 6 slices. How many pizza slices were sold?
def solve() -> int: large_pizzas = 3 medium_pizzas = 5 slices_per_large_pizza = 8 slices_per_medium_pizza = 6 total_slices = (large_pizzas * slices_per_large_pizza) + (medium_pizzas * slices_per_medium_pizza) result = total_slices return result
A furniture store offers a 10% discount on all furniture purchases over $500. If a customer buys a couch for $700 and a chair for $200, how much will the customer pay after the discount?
def solve() -> int: couch_cost = 700 chair_cost = 200 subtotal = couch_cost + chair_cost if subtotal > 500: discount_rate = 0.1 else: discount_rate = 0 discount = subtotal * discount_rate total = subtotal - discount result = total return result
A warehouse contains 300 boxes, of which 25% are labeled as fragile. How many boxes are not labeled as fragile?
def solve() -> int: total_boxes = 300 fragile_perc = 25 non_fragile_perc = 100 - fragile_perc non_fragile_boxes = total_boxes * non_fragile_perc/100 result = non_fragile_boxes return result
A train leaves the station and travels 60 miles per hour. Another train leaves the same station 2 hours later and travels 80 miles per hour in the same direction. How long will it take for the second train to catch up to the first train?
def solve() -> int: first_train_speed = 60 second_train_speed = 80 time_difference = 2 distance_traveled = first_train_speed * time_difference combined_speed = second_train_speed - first_train_speed time_needed = distance_traveled / combined_speed result = time_needed return result
Mark watched 6 episodes of a TV series, each lasting 45 minutes. He took 5-minute breaks between each episode. How long did it take him to watch the entire series (in hours)?
def solve() -> int: episode_length = 45 break_length = 5 total_episodes = 6 total_minutes = (episode_length * total_episodes) + (break_length * (total_episodes - 1)) result = total_minutes / 60 result return result
Possible new questions and programs are: Anna bakes 24 muffins and puts 4 muffins in each box. She sells each box for $5 and spends $12 on the ingredients. How much profit does she make?
def solve() -> int: boxes = 24 / 4 revenue = boxes * 5 profit = revenue - 12 result = profit return result
A kiosk sells 120 phones for $30 each. If the sales tax is 8%, how much is the total customer payment?
def solve() -> int: phones_sold = 120 phone_cost = 30 sales_tax_percentage = 8 total_tax = (sales_tax_percentage / 100) * (phones_sold * phone_cost) customer_payment = (phones_sold * phone_cost) + total_tax result = customer_payment return result
A bird flying at 30 meters per second flies 900 meters in a certain number of seconds. How many seconds does it take to fly 1200 meters?
def solve() -> int: distance1 = 900 speed = 30 time1 = distance1 / speed distance2 = 1200 time2 = distance2 / speed result = time2 return result
Each box of chocolates contains 24 pieces. If 20% of the pieces are dark chocolate, how many dark chocolate pieces are there in 12 boxes of chocolates?
def solve() -> int: boxes = 12 pieces_per_box = 24 dark_percent = 0.2 total_pieces = boxes * pieces_per_box dark_pieces = total_pieces * dark_percent result = dark_pieces return result
Samantha is building a rectangular sandbox. The sandbox is 6 feet long and 4 feet wide. She needs 2 bags of sand for every square foot of the sandbox. How many bags of sand does Samantha need?
def solve() -> int: length = 6 width = 4 area = length * width bags_per_square_foot = 2 total_bags = area * bags_per_square_foot result = total_bags return result
ome possible new questions are: Kevin wanted to buy a new laptop that cost $1,100. He had $600 in his bank account and could borrow $300 from his friend. He also had a coupon that gave him a 10% discount on his purchase. How much more money did Kevin need in order to buy the laptop?
def solve() -> int: discounted_price = 0.9 * 1100 available_amount = 600 + 300 difference = discounted_price - available_amount result = difference return result
Tara has 30 red balls, 20 blue balls, and 10 green balls. What is the probability of getting a red or a blue ball when drawing one at random?
def solve() -> int: total_balls = 30 + 20 + 10 red_balls = 30 blue_balls = 20 probability_of_red_or_blue_ball = (red_balls + blue_balls) / total_balls result = probability_of_red_or_blue_ball return result
Student: A store offers a 10% discount on all products. If a customer buys products worth $500, how much money will he save on his purchase?
def solve() -> int: discount_rate = 0.1 purchase_price = 500 discount_amount = purchase_price * discount_rate result = discount_amount return result
Michael is planning to take his two nephews to the zoo. His ticket costs $25, while his nephews' tickets cost $15 each. They have saved $30 altogether, and Michael has saved $10. If Michael earns $3 per hour, how many hours must he work to afford the tickets?
def solve() -> int: michael_ticket = 25 nephew_ticket = 15 total_savings = 30 michael_savings = 10 hourly_earning = 3 total_cost = michael_ticket + (2 * nephew_ticket) remaining_cost = total_cost - total_savings - michael_savings hours_needed = remaining_cost / hourly_earning ...
Student: A gym has an offer for 20% off a 3-month membership which normally costs $200. If you buy the 3-month membership, how much would you save with the offer?
def solve() -> int: normal_price = 200 discount_rate = 0.2 discounted_price = normal_price * (1 - discount_rate) amount_saved = normal_price - discounted_price result = amount_saved return result
A book has 250 pages. If a group of books has 6 more books than twice the number of pages in a single book, what is the total number of pages in this group of books?
def solve() -> int: num_pages_single_book = 250 num_books = 2 * num_pages_single_book + 6 total_num_pages = num_pages_single_book * num_books result = total_num_pages return result
Student: A store is having a sale for 20% off all items. If an item costs $50, what is the sale price?
def solve() -> int: original_price = 50 discount_rate = 0.2 discounted_price = original_price * (1 - discount_rate) sale_price = original_price - discounted_price result = sale_price return result
A runner can cover a distance of 8 kilometers in 40 minutes. If he runs at the same speed, how many meters will he cover in 10 seconds?
def solve() -> int: km_per_min = 8 / 40 m_per_sec = km_per_min * 1000 / 60 / 60 distance = 10 * m_per_sec result = distance return result
Student: The perimeter of a square is 28 cm. What is the length of one side of the square?
def solve() -> int: perimeter = 28 side_length = perimeter / 4 result = side_length return result
arah has three empty glasses with capacities of 1, 3, and 4 liters. Sarah fills the 3-liter glass and pours all the water into the 4-liter glass. She then fills the 1-liter glass and pours it into the 4-liter glass. How many more liters can Sarah pour into the 4-liter glass without it overflowing?
def solve() -> int: filled_3_liter_glass = 3 filled_1_liter_glass = 1 filled_4_liter_glass = filled_3_liter_glass + filled_1_liter_glass remaining_capacity = 4 - filled_4_liter_glass result = remaining_capacity return result
Every day, Sarah jogs an average of 2 miles, 5 days a week. From Monday to Wednesday, she jogs at a speed of 7 miles per hour, while from Thursday to Friday she jogs at a speed of 5 miles per hour. How many miles did Sarah jog during these 5 days?
def solve() -> int: average_distance = 2 days_per_week = 5 speed_mon_to_wed = 7 speed_thu_to_fri = 5 distance_mon_to_wed = (speed_mon_to_wed * 3) * (days_per_week / 5) distance_thu_to_fri = (speed_thu_to_fri * 2) * (days_per_week / 5) total_distance = (distance_mon_to_wed + distance_thu...
Jane is playing a game. In which she starts at the origin of a grid and takes five steps. The first step is up 2 units. The second step is left 3 units. The third step is down 4 units. The fourth step is right 5 units. The fifth step is up 6 units. What are the coordinates of the point Jane ends at?
def solve() -> int: x = 0 y = 0 y += 2 x -= 3 y -= 4 x += 5 y += 6 result = (x, y) return result
A bakery made 200 cupcakes and sold them for $2 each. They gave 10% of the cupcakes to a local shelter and 15% of the profit to a charity fund. How much money did they donate to the charity fund?
def solve() -> int: sold = 200 * 0.9 profit = sold * 2 donation = profit * 0.15 result = donation return result
A factory makes 200 more shoes than shirts each day. If the factory makes 400 shirts per day, how many shoes and shirts will it make in a month?
def solve() -> int: shirts_per_day = 400 shoes_per_day = shirts_per_day + 200 days_per_month = 30 shirts_per_month = shirts_per_day * days_per_month shoes_per_month = shoes_per_day * days_per_month result = f'Shirts per month: {shirts_per_month}, Shoes per month: {shoes_per_month}...
Student: Ella and Noah are sharing a pizza. The pizza has 12 slices and each slice has 4 pepperoni pieces. Ella eats 3 slices and Noah eats 4 slices. How many pepperoni pieces are left on the pizza? How many more pepperoni pieces does Noah eat than Ella?
def solve() -> int: total_pepperoni_pieces = 12 * 4 ella_pepperoni_pieces = 3 * 4 noah_pepperoni_pieces = 4 * 4 pepperoni_pieces_left = total_pepperoni_pieces - ella_pepperoni_pieces - noah_pepperoni_pieces noah_more_than_ella = noah_pepperoni_pieces - ella_pepperoni_pieces result = pepperoni_pi...
James borrowed 15 books and 10 magazines. He lost 3 books and returned 2 magazines. He then gave away a quarter of the remaining books to his cousin and borrowed 5 more magazines. How many books and magazines does James have now?
def solve() -> int: books_borrowed = 15 magazines_borrowed = 10 books_lost = 3 magazines_returned = 2 books_remaining = books_borrowed - books_lost magazines_remaining = magazines_borrowed - magazines_returned books_given_away = books_remaining // 4 books_remaining -= book...
Ben earned $60 from mowing lawns and wanted to buy some video games. He bought 3 games that cost $12 each, a controller that cost $15, and a gift card that cost $10. How much money does Ben have left?
def solve() -> int: earnings = 60 games = 3 game_cost = 12 controller = 15 gift_card = 10 total_cost = games * game_cost + controller + gift_card money_left = earnings - total_cost result = money_left return result
Nick needs to buy ingredients for his restaurant. He needs 10 sacks of flour, 5 crates of eggs, and 8 barrels of olive oil. Each sack of flour costs 30 dollars, each crate of eggs costs 10 dollars, and each barrel of olive oil costs 80 dollars. How much does Nick pay for these ingredients?
def solve() -> int: ingredient_cost = (30*10)+(10*5)+(80*8) result = ingredient_cost return result
Possible questions and programs are: The farm sells eggs for 50 cents each and milk for $2 per liter. They sold $15 in eggs and milk. If they sold 24 eggs, how many liters of milk did they sell?
def solve() -> int: eggs = 24 egg_price = 0.5 milk_price = 2 total_money = 15 money_from_eggs = eggs * egg_price money_from_milk = total_money - money_from_eggs liters_of_milk = money_from_milk / milk_price result = liters_of_milk return result
A recipe calls for 2/3 cups of sugar. If the recipe makes 16 cupcakes, how much sugar is needed per cupcake?
def solve() -> int: cups_of_sugar_for_recipe = 2/3 number_of_cupcakes = 16 cups_of_sugar_per_cupcake = cups_of_sugar_for_recipe / number_of_cupcakes result = cups_of_sugar_per_cupcake return result
A group of 12 friends went to a movie theater. The tickets cost $8.50 each, and the popcorn cost $4.00 per bag. They bought 6 bags of popcorn to share. How much did they spend in total?
def solve() -> int: ticket_cost = 8.50 * 12 popcorn_cost = 4.00 * 6 result = ticket_cost + popcorn_cost return result
A store sells 3 types of apples: organic apples for $1.50/lb, locally-grown apples for $2.00/lb, and imported apples for $3.00/lb. If a customer buys 2 lbs of organic apples, 3 lbs of locally-grown apples, and 1 lb of imported apples, how much is the total cost of the apples?
def solve() -> int: organic_apples_cost_per_lb = 1.5 locally_grown_apples_cost_per_lb = 2 imported_apples_cost_per_lb = 3 organic_apples_weight = 2 locally_grown_apples_weight = 3 imported_apples_weight = 1 total_cost = (organic_apples_cost_per_lb * organic_apples_weight) + (locally_grown_ap...
A school has a total of 800 students. Out of which 400 students play basketball, 300 students play cricket, and 200 play both sports. What percentage of students play only basketball?
def solve() -> int: total_students = 800 basketball = 400 cricket = 300 both = 200 only_basketball = basketball - both percent_only_basketball = (only_basketball / total_students) * 100 result = percent_only_basketball return result
A stationery shop offers a free pen for every purchase of 3 notebooks. If a customer buys 12 notebooks, how many pens will they get for free?
def solve() -> int: notebooks = 12 pens_per_set = 1 sets_of_3 = notebooks // 3 total_pens = sets_of_3 * pens_per_set result = total_pens return result
A printer prints 500 pages with one cartridge. The cartridge costs $40. If John prints 1000 pages, how much will he spend on cartridges?
def solve() -> int: total_pages = 1000 cartridges_needed = total_pages / 500 cost_per_cartridge = 40 total_cost = cartridges_needed * cost_per_cartridge result = total_cost return result
A bus driver drove 160 miles. She drove the first 40 miles at 40 miles per hour and the next 60 miles at 50 miles per hour. What was her average speed for the entire trip?
def solve() -> int: total_distance = 160 time = (40/40) + (60/50) average_speed = total_distance / time result = average_speed return result
Alyssa and her friends go to a restaurant. The bill comes out to be $105. They want to leave a 20% tip. What is the total amount they will have to pay for the meal, including the tip?
def solve() -> int: bill_amount = 105 tip_percent = 0.20 tip_amount = bill_amount * tip_percent total_amount = bill_amount + tip_amount result = total_amount return result
Student: A shelf contains 30 books. On Monday, 15 books were sold and on Tuesday, 10% were sold. How many books are left on the shelf?
def solve() -> int: num_books = 30 num_sold_monday = 15 percent_sold_tuesday = 0.1 num_sold_tuesday = num_books * percent_sold_tuesday total_sold = num_sold_monday + num_sold_tuesday result = num_books - total_sold return result
Sarah earns $12 per hour at her job. She worked 40 hours last week and earned $15 in tips. If she pays 20% tax on her earnings, how much money did she take home after taxes?
def solve() -> int: hours_worked = 40 hourly_rate = 12 tips = 15 income = hours_worked * hourly_rate + tips tax_rate = 0.2 taxes = income * tax_rate take_home_pay = income - taxes result = take_home_pay return result
Student: There are 30 students in a class. 20 of them are taking an online math class, 15 of them are taking English, and 5 of them are taking both. How many students are taking only English?
def solve() -> int: num_students = 30 num_math = 20 num_english = 15 num_both = 5 num_only_english = num_english - num_both result = num_only_english return result
Student: A car can travel 350 miles on 14 gallons of gas. If gas costs $2.50 per gallon, how much will it cost to travel 600 miles?
def solve() -> int: miles = 600 miles_per_gallon = 350/14 cost_per_gallon = 2.50 gallons_needed = miles/miles_per_gallon cost = gallons_needed * cost_per_gallon result = cost return result
Student: Daisy and Will went fishing together. The ratio of Daisy’s catch to Will’s catch was 5:2. Daisy caught 48 fish. How many fish did Will catch?
def solve() -> int: daisy_catch = 48 will_catch = 0 ratio = 5/2 will_catch = daisy_catch / ratio result = will_catch return result
Mary has a cake recipe that asks for 1 5/8 cups of sugar, how many milliliters of sugar does she need?
def solve() -> int: amount_of_sugar_needed = 1.625 amount_of_sugar_in_ml = amount_of_sugar_needed * 236.588 result = amount_of_sugar_in_ml return result
Student: A car travels at a constant speed of 60 km/h. If it starts from point A and reaches point B in 2 hours, how far apart are point A and point B?
def solve() -> int: speed = 60 time = 2 distance = speed * time result = distance return result
Jasmine earns $3500 a month and wants to put 20% of her earnings into savings each month. After putting money in savings, she pays $800 in rent and $400 on groceries. How much money does Jasmine have left afterward?
def solve() -> int: income = 3500 percent = 0.2 savings = income * percent rent = 800 groceries = 400 total_expenses = rent + groceries + savings remaining_money = income - total_expenses result = remaining_money return result
Student: There were 57 apples in a basket. 25 of them were given away. How many apples are still in the basket?
def solve() -> int: apples = 57 given_away = 25 remaining = apples - given_away result = remaining return result
Tina has 30 marbles. She wins 10 more marbles in a game, and then gives away 6. Later, she trades 3 marbles with her friend for a deck of cards. How many marbles does Tina have now?
def solve() -> int: marbles = 30 marbles += 10 marbles -= 6 marbles -= 3 result = marbles return result
There are 60 students in a class. If 35% of them are girls, how many boys are in the class?
def solve() -> int: num_students = 60 percent_girls = 35 num_girls = (num_students / 100) * percent_girls num_boys = num_students - num_girls result = num_boys return result
The sum of three consecutive integers is 72. What are the integers?
def solve() -> int: x = 23 y = 24 z = 25 result = x,y,z return result
Student: At the Orchard Park Farm, they grow 472 apples, 284 pears, and 196 cherries. How many times more apples are grown than cherries?
def solve() -> int: apples = 472 pears = 284 cherries = 196 difference = apples - cherries ratio = apples / cherries times_more = ratio / 1 result = times_more return result
Sarah runs 3 miles every other day for a month. If she runs the first day, then takes a rest the next day and so on, how many miles did Sarah run throughout the month?
def solve() -> int: days_in_month = 30 miles_per_day = 3 days_with_activity = days_in_month // 2 total_miles = miles_per_day * days_with_activity result = total_miles return result
Dakota goes to a restaurant and leaves a 15% tip. If the bill was $135, how much money did she leave total?
def solve() -> int: tip = 135*0.15 total = 135+tip result = total return result
At an art gallery, there are 80 paintings. 10% of them were painted in under 2 days. Three times that number of paintings were painted in under 4 days. 1/2 of the remaining paintings took over 6 days. How many paintings took over 6 days?
def solve() -> int: paintings = 80 under_2_days = paintings * 0.1 under_4_days = 3 * under_2_days remaining_paintings = paintings - under_2_days - under_4_days over_6_days = remaining_paintings / 2 result = over_6_days return result
Student: David has 280 marbles in a jar. He gives 1/3 of those marbles to his little brother. Then he takes 2/7 of the remaining marbles to school for a presentation. How many marbles are left with him in the jar?
def solve() -> int: marbles_in_jar = 280 marbles_given_to_brother = marbles_in_jar // 3 marbles_taken_to_school = (marbles_in_jar - marbles_given_to_brother) // 7 * 2 marbles_left_in_jar = marbles_in_jar - marbles_given_to_brother - marbles_taken_to_school result = marbles_left_in_jar return re...
David plans to buy 1 dozen eggs today and another 4 dozen next weekend. If the cost per dozen eggs is $1.8, how much will he spend on eggs in total?
def solve() -> int: dozen1 = 1 dozen2 = 4 cost_per_dozen = 1.8 total_dozen = dozen1 + dozen2 total_cost = total_dozen * cost_per_dozen result = total_cost return result
Mia has a garden that measures 25 feet in length and 12 feet in width. She wants to fill the garden with rectangular pavers that measure 1.5 feet in length and 1 foot in width. If she has already laid 180 pavers, how many more pavers does Mia need to finish the garden?
def solve() -> int: length_garden = 25 width_garden = 12 length_paver = 1.5 width_paver = 1 area_garden = length_garden * width_garden area_paver = length_paver * width_paver total_pavers_needed = area_garden / area_paver remaining_pavers_needed = total_pavers_needed - 180 result = r...
Student: Lily and her sister are sharing a pizza. The pizza has 8 slices and each slice has 4 pepperonis. Lily eats 3 slices and her sister eats 2 slices. How many pepperonis are left on the pizza?
def solve() -> int: slices_on_pizza = 8 pepperonis_per_slice = 4 slices_eaten_by_lily = 3 slices_eaten_by_sister = 2 total_pepperonis_eaten = (slices_eaten_by_lily * pepperonis_per_slice) + (slices_eaten_by_sister * pepperonis_per_slice) total_pepperonis_on_pizza = slices_on_pizza * pepperonis_p...
Maria has to withdraw money from her bank account, but there's a $2 transaction fee every time she does that. If she can only withdraw up to $50 at a time, how much money does she need to withdraw from her account in order to receive exactly $100 in cash?
def solve() -> int: cash_to_receive = 100 max_withdrawal_amount = 50 transaction_fee = 2 withdrawals_needed = cash_to_receive / max_withdrawal_amount total_fees = withdrawals_needed * transaction_fee amount_to_withdraw = cash_to_receive + total_fees result = amount_to_withdraw...
Maya has 3/4 as many pencils as Omar has. If Omar has 2 boxes of pencils and each box has 24 pencils, how many pencils does Maya have?
def solve() -> int: omar_pencils = 2 * 24 maya_pencils = omar_pencils * 3/4 result = maya_pencils return result
A stock trader bought 10000 shares of a company for $30 per share. She sold 5000 of the shares for $35 each and 3000 of the shares for $25 each. What was her total profit or loss?
def solve() -> int: cost_price = 10000 * 30 selling_price = (5000 * 35) + (3000 * 25) profit_or_loss = selling_price - cost_price result = profit_or_loss return result
Student: Matthew has 30 apples and 25 oranges. If he gave 2/3 of the apples away and 1/4 of the oranges away, how many fruits were left in total?
def solve() -> int: apples = 30 oranges = 25 apples_left = apples * (1/3) oranges_left = oranges * (3/4) result = apples_left + oranges_left return result
Kira is baking toffee cookies for a bake sale. Each cookie requires 0.5 cups of sugar. If Kira needs to make 18 cookies, calculate how much sugar is needed.
def solve() -> int: num_of_cookies = 18 sugar_per_cookie = 0.5 total_sugar = num_of_cookies * sugar_per_cookie result = total_sugar return result