question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Isabella made $55 babysitting her neighbor's children. She spent a quarter of it on pizza and put half of the rest in her piggy bank. She then lost a third of the money in her piggy bank after her little brother broke it. How much money was left in Isabella's piggy bank?
def solve() -> int: money_earned = 55 money_spent_on_pizza = money_earned / 4 money_left = money_earned - money_spent_on_pizza money_saved = money_left / 2 money_lost = money_saved / 3 money_remaining = money_saved - money_lost result = money_remaining return result
A certain book has 130 pages. The second book has 20 fewer pages than the first book and a third book has 40 fewer pages than the second book. How many pages are in the third book?
def solve() -> int: number_pages_book_1 = 130 number_pages_book_2 = number_pages_book_1 - 20 number_pages_book_3 = number_pages_book_2 - 40 result = number_pages_book_3 return result
If a car travels at a speed of 60 km/h, how long will it take to travel a distance of 300 km?
def solve() -> int: distance = 300 speed = 60 time = distance / speed result = time return result
In Rome, there are 3 million people living in it. If 55% of the population is aged between 25-45 and 1/8 of those are lawyers, how many lawyers are there in Rome?
def solve() -> int: population = 3000000 age_range_percentage = 0.55 lawyers_percentage = 1/8 age_range_population = population * age_range_percentage lawyers_population = age_range_population * lawyers_percentage result = lawyers_population return result
Possible new questions and programs are: A factory produces 120 toys every hour for 8 hours a day. How many toys does it produce in 6 days?
def solve() -> int: toys_per_hour = 120 hours_per_day = 8 days = 6 result = toys_per_hour * hours_per_day * days return result
Last week, Sam's age was five times the age of Alex. If Alex is now 18 years old, what is Sam's age now?
def solve() -> int: Alex_age = 18 Sam_age = Alex_age * 5 result = Sam_age return result
A farmer plants 4 different types of vegetables. He plants 50 carrots, 40% more cucumbers, twice as many tomatoes, and half as many pumpkins. How many vegetables did he plant in total?
def solve() -> int: carrots = 50 cucumbers = 1.4 * 50 tomatoes = 2 * 50 pumpkins = 0.5 * 50 total_vegetables = carrots + cucumbers + tomatoes + pumpkins result = total_vegetables return result
Mark decides to swap his old textbooks for new ones. He can sell his old books for $20 each and new books cost $50 each. If he needs to replace 15 books, how much will it cost him?
def solve() -> int: old_book_price = 20 new_book_price = 50 num_books = 15 total_cost = new_book_price * num_books result = total_cost return result
Tom is writing a book. On the first day, he writes 1000 words. Every day he writes 500 more words than the previous day. How many words will Tom have written by the end of the 9th day? The coach wants to motivate her players to run more at practice, so she offers a reward of a pizza party if they collectively run a tot...
def solve() -> int: first_day = 1000 ninth_day = first_day + 8 * 500 total_words = (first_day + ninth_day) * 9 / 2 laps_needed = 300 / 3 / 15 / 12 result = laps_needed return result
Ella found an old card game at her grandparents' house. If the game contains 120 cards and each player needs to have 12 cards in their own deck, how many players can play the game?
def solve() -> int: total_cards = 120 cards_per_player = 12 number_of_players = total_cards/cards_per_player result = number_of_players return result
Lisa had a box of 30 markers that she was using for an art project. She found 12 markers, but then she lost 6 markers. Her dad gave her three times as many markers as she lost. How many markers does Lisa have in total?
def solve() -> int: markers_in_box = 30 found_markers = 12 lost_markers = 6 markers_from_dad = 3 * lost_markers total_markers = markers_in_box + found_markers - lost_markers + markers_from_dad result = total_markers return result
Student: A car needs a total of 8 gallons of oil to fill its tank up. On the first day it used 2 gallons, the next day used 1/3 of the remaining oil, and the day after that used 0.5 gallons. How many gallons of oil did the car have left?
def solve() -> int: total_oil = 8 oil_used_1 = 2 oil_used_2 = total_oil - oil_used_1 oil_used_3 = oil_used_2 * 1/3 oil_used_4 = 0.5 remaining_oil = total_oil - oil_used_1 - oil_used_2 - oil_used_3 - oil_used_4 result = remaining_oil return result
At a bakery, there are 180 cupcakes. 25% of them have chocolate frosting, 40% have vanilla frosting, and the remaining have strawberry frosting. The chocolate cupcakes cost $1.50 each, the vanilla cupcakes cost $2.00 each, and the strawberry cupcakes cost $2.50 each. How much money does the bakery make from selling all...
def solve() -> int: chocolate = 0.25 * 180 vanilla = 0.4 * 180 strawberry = 180 - chocolate - vanilla chocolate_cost = chocolate * 1.50 vanilla_cost = vanilla * 2.00 strawberry_cost = strawberry * 2.50 revenue = chocolate_cost + vanilla_cost + strawberry_cost result = revenue return ...
Cheryl has $3000 saved for her vacation. She plans to spend $250 per day and also set aside $250 for emergencies. How many days can she stay?
def solve() -> int: savings = 3000 daily_spending = 250 emergency_money = 250 total_spending_per_day = daily_spending+ emergency_money days = savings/total_spending_per_day result = days return result
Jake bought 70 toy cars to distribute among his friends. He gave 25 toy cars to his best friend Sam, 20 toy cars to his neighbor Tom, and 10 toy cars to his cousin Matt. He also gave 3 toy cars each to his brother, sister, and aunt. How many toy cars did Jake have left over?
def solve() -> int: toy_cars_total = 70 sam = 25 tom = 20 matt = 10 brother = 3 sister = 3 aunt = 3 toy_cars_given = sam + tom + matt + brother + sister + aunt toy_cars_left = toy_cars_total - toy_cars_given result = toy_cars_left result return result
John drives 60 miles to the north to go to a business meeting and 20 miles to the south to get to the gym. If his car gets 18 miles per gallon, how many gallons of gas does he use to travel to both places and back home?
def solve() -> int: north_distance = 60 south_distance = 20 total_distance = north_distance + south_distance + north_distance miles_per_gallon = 18 total_gas_used = total_distance / miles_per_gallon result = total_gas_used return result
Harry needs to buy paint for his balcony which is 9*4 feet. One gallon of paint covers 400 square foot. How many gallons of paint does Harry need for his balcony?
def solve() -> int: area = 9 * 4 need_gallon = area / 400 result = need_gallon return result
Student: Tom had $40 in his pocket. He spent a fifth of it on a burger and a tenth of it on a drink. He then found a $20 bill on the ground. How much does Tom have now?
def solve() -> int: pocket = 40 burger = pocket * 0.2 drink = pocket * 0.1 found = 20 result = pocket - burger - drink + found return result
A fruit stand sells apple bags and if there are any apples left at the end of the day, the fruit stand gives them away. Each apple bag holds 12 apples and all of the apples that the fruit stand has are put into these bags. The fruit stand has 564 apples for the day and sells 31 apple bags throughout the day. How many a...
def solve() -> int: total_apples = 564 apple_per_bag = 12 num_bags_sold = 31 remaining_apples = total_apples - (num_bags_sold * apple_per_bag) result = remaining_apples return result
Talia has returned 16 books for a total of $45. If the store returns the books for the same price, how much does each book cost if they are of equal prices?
def solve() -> int: total_price = 45 books_returned = 16 price_per_book = total_price//books_returned result = price_per_book return result
Angie is going to fix the flower bed in her backyard. She bought 4 bags of topsoil, each costs $20, 3 bags of peat moss with a discount of 10% and 6 small stones. Each bag of peat moss costs $10. How much did Angie pay in total?
def solve() -> int: a = 20 * 4 b = 10 * 3 * 0.9 c = 10 * 6 result = a + b + c return result
A toolbox has enough space to hold 25 tools. Each tool takes up 10 cubic inches. How many 100-cubic-inch items can it hold if there are already 12 tools in the toolbox?
def solve() -> int: total_toolbox_capacity = 25 * 10 current_tool_count = 12 item_size = 100 remaining_capacity = total_toolbox_capacity - (current_tool_count * 10) num_items = remaining_capacity // item_size result = num_items return result
A bakery was selling cupcakes with decorations. 6 cupcakes without decorations cost $15 and each decoration adds an additional $3. If a customer buys 4 cupcakes with 3 decorations, how much will it cost in total?
def solve() -> int: cupcakes = 4 basePrice = 15 decorationPrice = 3 decorations = 3 totalPrice = basePrice + cupcakes * decorationPrice result = totalPrice return result
Maria works in a factory and can package 15 products every hour. If she works for the next 8 hours and takes a short break for 20 minutes, how many products will she have packaged if she accidentally damages 10 products?
def solve() -> int: products_per_hour = 15 hours_worked = 8 break_minutes = 20 products_before_break = products_per_hour * (hours_worked - (break_minutes/60)) products_after_break = products_per_hour * (break_minutes/60) total_products = products_before_break + products_...
Kazim needs to order a new bike every 10 hours of use, with each bike costing $15. He has 7 bikes currently and needs them for 175 hours. How much money should he spend to purchase more bikes to make sure he has enough for 175 hours?
def solve() -> int: cost = 0 hour_count = 0 while hour_count < 175: if hour_count % 10 == 0: cost += 15 hour_count += 1 result = cost return result
The mansion, Sagittarius-1, is a luxurious property made of two identical circular structures that serve as living and dining areas. The two circular structures are linked by a series of tunnels that keep them together and allow the occupants to travel between the indoor areas. Each living area has 5 suites, 4 parlours...
def solve() -> int: living_suites = 5 living_parlours = 4 total_bedrooms = 50 living_rooms = living_suites + living_parlours boardrooms_per_living = (total_bedrooms - living_rooms * 2) / 2 total_boardrooms = boardrooms_per_living * 2 result = total_boardrooms return r...
Bella bakes cookies for her friends and family. She uses 3 cups of flour, 2 cups of sugar, and 1 cup of chocolate chips for every 24 cookies. She has 18 cups of flour, 12 cups of sugar, and 9 cups of chocolate chips in her pantry. How many cookies can she bake with the ingredients she has?
def solve() -> int: flour_cookies = 18 / 3 * 24 sugar_cookies = 12 / 2 * 24 chips_cookies = 9 / 1 * 24 limiting_cookies = min(flour_cookies, sugar_cookies, chips_cookies) result = limiting_cookies return result
A jug can hold 2 liters of water. If 1.5 liters of water are poured into the jug, how many liters of space are left in the jug?
def solve() -> int: jug_capacity = 2 water_poured = 1.5 space_left = jug_capacity - water_poured result = space_left return result
If a recipe calls for 2 1/2 cups of flour, how many cups of flour are needed for four batches of the recipe?
def solve() -> int: cups_per_batch = 2.5 num_batches = 4 total_cups = cups_per_batch * num_batches result = total_cups return result
A bookstore has 34,500 books in stock. If the bookstore sells 150 books every day, how many days will it take to sell all the books?
def solve() -> int: books_in_stock = 34500 books_sold_per_day = 150 days_to_sell_all_books = books_in_stock / books_sold_per_day result = days_to_sell_all_books return result
If Susan earns $5000 a month and she spends 20% of it on utilities, 25% on groceries, and puts 30% into her savings account, how much money does she have left for other expenses?
def solve() -> int: utilities = 5000 * 0.2 groceries = 5000 * 0.25 savings = 5000 * 0.3 remaining_money = 5000 - utilities - groceries - savings result = remaining_money return result
Olivia jogged 3 miles from her house to the beach. She ran along the coastline for 8 miles to the harbor. Afterward, she jogged the same way back home What was the total distance jogged by Olivia?
def solve() -> int: distance_to_beach = 3 distance_to_harbor = 8 total_distance = distance_to_beach + distance_to_harbor + distance_to_beach result = total_distance return result
A rectangle has a length of 15 cm and a width of 8 cm. A square has a side length of 10 cm. What is the difference in area between the rectangle and the square?
def solve() -> int: rect_area = 15 * 8 square_area = 10 ** 2 diff_area = rect_area - square_area result = diff_area return result
A construction worker needs 40 bricks to build one wall. If he needs to build 3 walls, how many bricks does he need in total?
def solve() -> int: bricks_per_wall = 40 walls = 3 total_bricks = bricks_per_wall * walls result = total_bricks return result
Ben wants to make a fruit salad with apples and oranges. He has 15 apples and 12 oranges. He needs to cut each apple into 8 pieces and each orange into 6 pieces. How many pieces of fruit does he have in total?
def solve() -> int: apple_pieces = 15 * 8 orange_pieces = 12 * 6 total_pieces = apple_pieces + orange_pieces result = total_pieces return result
Sam has a budget of $55 to buy his friend's birthday gift. The gift costs $40. How much money will Sam have left after buying the gift?
def solve() -> int: budget = 55 item_cost = 40 money_left = budget - item_cost result = money_left return result
Student: Samantha is buying tickets to a concert. The tickets are $35 each, and Samantha buys 4 tickets. She spends half of her money on the tickets and the rest on dinner. If Samantha had $200 before buying the tickets, how much money did she spend on dinner?
def solve() -> int: ticket_price = 35 num_tickets = 4 initial_money = 200 total_ticket_cost = ticket_price * num_tickets money_spent_on_tickets = initial_money / 2 money_spent_on_dinner = initial_money - money_spent_on_tickets result = money_spent_on_dinner - total_ticket_cost return re...
Ethan goes to school by public bus and his weekly bus fare is $45, if he needs to spend a total of $150 on bus fares for a month, how many weeks does he need to take the bus?
def solve() -> int: weekly_busfare = 45 total_busfare = 150 number_of_weeks = total_busfare / weekly_busfare result = number_of_weeks return result
- In a grocery store, a bag of apples costs $6. When David bought 7 bags of apples, he was given a 20% discount on the total price. How much did David pay in all?
def solve() -> int: original_price = 7 * 6 discount = original_price * 0.2 final_price = original_price - discount result = final_price return result
Glen has some red plates and blue plates. He has 2 times as many red plates as blue plates. If the total amount of plates is 15, how many red plates does he have?
def solve() -> int: red_plates = 0 blue_plates = 0 total_plates = 15 red_plates = total_plates * 2 // 3 blue_plates = total_plates - red_plates result = red_plates return result
Jana has a monthly income of $5000. She spends 30% of it on rent and 40% of the remaining on groceries. How much money does she have left after paying for rent and groceries?
def solve() -> int: monthly_income = 5000 rent = monthly_income * 0.3 remaining_income = monthly_income - rent groceries = remaining_income * 0.4 remaining_money = remaining_income - groceries result = remaining_money return result
A gardener wants to fence a rectangular garden. The length is 8 meters less than twice the width. If the perimeter is 80 meters, what are the dimensions of the garden?
def solve() -> int: width = (80 - 8) / 2 / 2 length = width * 2 - 8 result = (length, width) return result
Student: Ethan bought a watch for $149, a pen for $9.99, and paid 7.5% sales tax. How much money did Ethan spend?
def solve() -> int: watch_price = 149 pen_price = 9.99 tax_rate = 0.075 total_price = watch_price + pen_price total_tax = total_price * tax_rate result = total_price + total_tax return result
A cake recipe calls for 2 cups of flour, 1 cup of sugar, and 3 eggs. How many eggs are needed to make 4 cakes?
def solve() -> int: eggs_per_cake = 3 / 1 eggs_needed = eggs_per_cake * 4 result = eggs_needed return result
Asaf and Alexander's sum of age is 180. Alexander's age is three times as much as Asaf's and Alexander has 4 times as many pencils as Asaf. How many pencils do they have together?
def solve() -> int: total = 0 asaf_pencil = 0 alexander_pencil = 0 difference = 180-32 asaf_age = int(difference/4) alexander_age = difference-asaf_age asaf_pencil = asaf_age/50 alexander_pencil = asaf_pencil*4 total_pencil = asaf_pencil + alexander_pencil result =...
Justin purchased a new laptop for $450. His tax rate is 8.25%. What is the total cost of the laptop with tax?
def solve() -> int: laptop_cost = 450 tax_rate = 0.0825 total_cost = laptop_cost * (1 + tax_rate) result = total_cost return result
Student: A car travels 240 miles in 4 hours. If it continues at the same speed, how long will it take to travel 360 miles?
def solve() -> int: distance = 360 time_taken = 4 speed = distance / time_taken time_required = distance / speed result = time_required return result
John has 5 apples. If he gives 3 apples to his friend, how many apples does he have left?
def solve() -> int: apples = 5 given_apples = 3 remaining_apples = apples - given_apples result = remaining_apples return result
Student: It takes Alicia 15 minutes to get from one destination to another. She walks twice as fast as Shawn. How long does it take Shawn to get from one destination to another?
def solve() -> int: alicia_time = 15 alicia_speed = 2 shawn_speed = alicia_speed / 2 shawn_time = alicia_time / shawn_speed result = shawn_time return result
Aileen has twice the number of books that her younger brother has. If Aileen has 56 books and gave 10 books to her brother, how many books does younger brother have now?
def solve() -> int: brother_books = (56-10)/2 result = brother_books return result
At a zoo, the ratio of the number of zebras to the number of lions to the number of tigers is 3:5:4 respectively. If there are a total of 360 animals, how many lions are there?
def solve() -> int: zebras = 3 lions = 5 tigers = 4 total_animals = 360 total_ratio = zebras + lions + tigers lion_ratio = lions / total_ratio lions_total = lion_ratio * total_animals result = lions_total return result
Student: A cafe sells muffins. On Monday, they sold 30 muffins. On Tuesday, they sold twice as many muffins as the previous day. On Wednesday, they sold half as many muffins as they did the previous two days. On Thursday, they sold 15 muffins less than what they sold on Wednesday. On Friday, they sold twice as many muf...
def solve() -> int: monday = 30 tuesday = 0 wednesday = 0 thursday = 0 friday = 0 tuesday = monday * 2 wednesday = tuesday / 2 thursday = wednesday - 15 friday = thursday * 2 result = monday + tuesday + wednesday + thursday + friday return result
A bakery sold 42 pies on Wednesday and 68 pies on Thursday. On Friday, they sold 2/3 as many pies as they did on Thursday. How many pies did the bakery sell in total?
def solve() -> int: friday_pies = 2/3 * 68 total_pies = 42 + 68 + friday_pies result = total_pies return result
Amy is organizing a party and wants to have enough food for her guests. Each guest will eat 2 burgers and 1 hot dog. If she invited 20 people, how many burgers and hot dogs does Amy need to prepare?
def solve() -> int: burgers = 2 * 20 hot_dogs = 1 * 20 result = burgers + hot_dogs return result
A rectangular prism has a height of 5 cm, length of 10 cm and width of 3 cm. If it is filled with water, what is the volume of water in liters?
def solve() -> int: height = 5 length = 10 width = 3 water_volume = height * length * width * 0.001 result = water_volume return result
Student: A class has 20 students. Each student is assigned a locker number from 1 to 20. If every 4th locker is broken, how many lockers are broken?
def solve() -> int: students = 20 lockers = students broken_lockers = lockers // 4 result = broken_lockers return result
John earns $20 per hour for the first 30 hours he works in a week, and $30 per hour for each additional hour. If he works for 40 hours in a week, how much total money does John earn?
def solve() -> int: pay1 = 20 * 30 pay2 = (40-30) * 30 total_pay = pay1 + pay2 result = total_pay return result
Sarah has 22 stickers. Her friend gave her 8 more stickers and then she gave away 7 stickers. How many stickers does she have now?
def solve() -> int: initial = 22 received = 8 gave_away = 7 total = initial + received - gave_away result = total return result
A rectangular box has a height of 8cm, a width of 3cm, and a length of 5cm. What is its volume?
def solve() -> int: height = 8 width = 3 length = 5 volume = height * width * length result = volume return result
Student: Tony had 112 pencils. He gave 35 pencils to his friends. How many pencils does Tony have left?
def solve() -> int: pencils = 112 pencils = pencils - 35 result = pencils return result
If Jessica works for 5.5 hours every weekday and 7 hours on Saturday and Sunday, how many hours does she work in a week?
def solve() -> int: hours_weekday = 5.5 * 5 hours_weekend = 7 * 2 total_hours_worked = hours_weekday + hours_weekend result = total_hours_worked return result
Some possible questions and programs are: Tara sells cakes at a bakery. She charges $12 for each cake and $6 for frosting. She also pays $40 for rent every week. If Tara sells 15 cakes in a week, how much profit, in dollars, does she make?
def solve() -> int: price = 12 quantity = 15 rent = 40 frosting = 6 revenue = price * quantity cost = rent + frosting * quantity profit = revenue - cost result = profit return result
A library has 150 books for sale. If a fifth of the books are fiction and 30% of the fiction books are bestsellers, how many bestseller fiction books are for sale?
def solve() -> int: books_for_sale = 150 fiction_books = books_for_sale / 5 bestseller_fiction_books = fiction_books * 0.3 result = bestseller_fiction_books return result
arah wants to order some T-shirts as gifts for her friends. Each T-shirt costs $15. The online store offers discounts for bulk orders: 10% off if she buys 5-10 T-shirts, and 20% off if she buys more than 10 T-shirts. If Sarah wants to buy 8 T-shirts, how much money will she save with the discount?
def solve() -> int: tshirts_ordered = 8 tshirt_cost = 15 discount = None if tshirts_ordered >= 5 and tshirts_ordered <= 10: discount = 0.1 elif tshirts_ordered > 10: discount = 0.2 if discount!= None: total_cost = tshirts_ordered*tshirt_cost discount_amount = tot...
Student: In a class of 30 students, 40% are boys and 60% are girls. If 70% of the boys and 80% of the girls scored above 80 in their test, how many students scored above 80 in their test?
def solve() -> int: total_students = 30 boys_percentage = 0.4 girls_percentage = 0.6 boys_count = total_students * boys_percentage girls_count = total_students * girls_percentage boys_above_80 = boys_count * 0.7 girls_above_80 = girls_count * 0.8 total_above_80 = boys_above_80 + girls_ab...
Charles has been saving for a camera. He has $400 and found one priced at $600. After some searching, he found a discount coupon for $100. How much money will he need to pay for the camera?
def solve() -> int: camera_price = 600 saved_amount = 400 discount_coupon = 100 result = camera_price - (saved_amount + discount_coupon) return result
Amanda wants to buy new sneakers which cost $120. She has two $20 bills and six $5 bills. She decides to sell her old bike for $50. Amanda also has 40 cans that can be sold at a recycling center for 20 cents each. How many cans does Amanda need to sell to buy the sneakers?
def solve() -> int: sneaker_cost = 120 bill_20 = 2 bill_5 = 6 bike_sale = 50 can_price = 0.20 total_money = (bill_20 * 20) + (bill_5 * 5) + bike_sale remaining_money = sneaker_cost - total_money cans_needed = remaining_money / can_price result = cans_needed return resul...
If the first year of a fish's life is equal to 2 human years, the second year equals 3 human years, and every year after that equals 1 human year, how many human years has my 4-year-old fish lived?
def solve() -> int: fish_age = 4 human_age = 0 if fish_age == 1: human_age = 2 elif fish_age == 2: human_age = 5 else: human_age = 5 + (fish_age - 2) result = human_age return result
Ajay had saved $150 and wants to use it to buy supplies for his new project. He needs to buy 10 paints at $4 each, 15 brushes at $2 each, and 5 apron bags for $10 each. How much money will it cost him to buy all of this item combination?
def solve() -> int: num_paints = 10 num_brushes = 15 num_apron_bags = 5 price_paint = 4 price_brush = 2 price_apron_bag = 10 total_paints_cost = num_paints * price_paint total_brushes_cost = num_brushes * price_brush total_apron_bag_cost = num_apron_bags * price_apron_bag ...
Sarah starts with $100 in her bank account. She spends $15 each day on lunch. On the weekends she doesn't buy lunch. After how many days will Sarah have no money left in her bank account?
def solve() -> int: days = 0 balance = 100 while balance >= 0: if days % 7 == 5 or days % 7 == 6: pass else: balance -= 15 days += 1 result = days return result
John is planning to open a restaurant which should serve 200 people for 10 days. How much food should he prepare in advance?
def solve() -> int: people = 200 given_days = 10 needed_food = people * given_days result = needed_food return result
Arjun can paint 2 walls per hour while Sana can paint 3 walls per hour. If Arjun and Sana have been painting walls for 4 hours now, how many walls have they painted?
def solve() -> int: arjun_rate = 2 sana_rate = 3 time = 4 arjun_walls = arjun_rate * time sana_walls = sana_rate * time total_walls = arjun_walls + sana_walls result = total_walls return result
A clock's second hand completes 60 rotations in 1 hour. How many rotations does it make in 8 hours?
def solve() -> int: rotations_per_hour = 60 hours = 8 rotations_per_8_hours = rotations_per_hour * hours result = rotations_per_8_hours return result
Jane can complete a 50-piece puzzle in 20 minutes. She can complete a 30-piece puzzle in 3 minutes slower than her 50-piece pace, a 70-piece puzzle in 5 minutes slower than her 30-piece pace, and an 80-piece puzzle in 2 minutes slower than her 70-piece pace. How long would it take her to complete all four puzzles combi...
def solve() -> int: puzzle_50 = 50 time_50 = 20 time_30 = time_50 + 3 puzzle_30 = (time_30/time_50) * puzzle_50 time_70 = time_30 + 5 puzzle_70 = (time_70/time_30) * puzzle_30 time_80 = time_70 + 2 puzzle_80 = (time_80/time_70) * puzzle_70 total_time = time_50 + t...
An art piece was originally priced at $600 and went on sale for $100 off. If Elsie bought the art piece and paid 8% sales tax, how much did she pay in total?
def solve() -> int: original_price = 600 discount = 100 tax_rate = 8/100 discount_price = original_price - discount final_price = round(discount_price * (1 + tax_rate), 2) result = final_price return result
Lily has 2000 beads. She wants to share them equally between her friends, Emily, Ava, and Max. Emily gets 1/5 of Lily's beads, while Ava gets 3/10 of the beads remaining after giving Emily her share. Finally, Max receives the rest of the beads. How many beads did Max receive? This morning, Chef Mike's kitchen prepared ...
def solve() -> int: total_beads = 2000 emily_share = total_beads * 1/5 remaining_beads = total_beads - emily_share ava_share = remaining_beads * 3/10 max_share = remaining_beads - ava_share result = max_share total_potatoes = 5000 served_potatoes =...
Erin has 4 boxes of papers with 18 papers in each box. She gave Lia 6 more papers than she gave Amanda. If she gave 8 papers to Amanda, how many papers does she have left?
def solve() -> int: total_papers = (18 * 4) - 8 lia_papers = 8 + 6 erin_papers = total_papers - lia_papers result = erin_papers return result
Leo is trying to catch up to his friends who left him behind on a hiking trail, but they can ignore him if he gets more than 100 feet away from them. Leo has a 300 foot head start. If Leo walks 4 feet per second and his friends walk 6 feet per second, how many seconds does Leo have to catch up to his friends?
def solve() -> int: leo_start = 300 leo_speed = 4 friends_speed = 6 distance_threshold = 100 distance_to_cover = leo_start - distance_threshold relative_speed = friends_speed - leo_speed time_to_catch_up = distance_to_cover / relative_speed result = time_to_catch_up ...
A kindergarten class is going on a field trip and wants to bring juice boxes for each student. For every 3 students, they need 1 box of juice. The class has 24 students. Each juice box has 6 ounces of juice. How many juice boxes do they need for the field trip?
def solve() -> int: students = 24 juice_boxes = students // 3 + (students % 3 > 0) ounces_per_box = 6 total_ounces = juice_boxes * ounces_per_box result = total_ounces / ounces_per_box return result
If it takes 2 days for 10 persons to finish a project, how many days would it take for 30 persons to complete the same project?
def solve() -> int: x = 10 y = 2 z = 30 result = (z/x)*y return result
The school band has 15 violin players, 10 clarinet players, and 12 drummers. How many musicians are a part of the school band?
def solve() -> int: violin_players = 15 clarinet_players = 10 drummers = 12 total_musicians = violin_players + clarinet_players + drummers result = total_musicians return result
There are 10 students in a class. Each student has to complete 5 pages of a workbook each day for 4 days. How many pages will be completed in total?
def solve() -> int: students_in_class = 10 pages_per_student_per_day = 5 days_of_work = 4 total_pages = students_in_class * pages_per_student_per_day * days_of_work result = total_pages return result
An ice cream shop has 15 flavors. Each flavor comes in a cone or a cup that costs $4 or $3 respectively. The shop sold 60 cones and 40 cups in a day. How much money did the shop make from ice cream sales?
def solve() -> int: flavors = 15 cone_cost = 4 cup_cost = 3 cones_sold = 60 cups_sold = 40 cone_sales = cones_sold * cone_cost cup_sales = cups_sold * cup_cost total_sales = cone_sales + cup_sales result = total_sales return result
Noah's mom gave him 2 $100 bills to spend at the electronics store. He wants to buy 1 phone, 1 tablet, and 2 phone cases. The phone costs $500, the tablet costs $300, and each phone case costs $20. How much money will Noah have left after the purchase? The Eagles played 78 games this season. They won 45 games and had a...
def solve() -> int: money_given = 2 * 100 phone_cost = 500 tablet_cost = 300 phone_case_cost = 20 num_phone_cases = 2 total_cost = phone_cost + tablet_cost + (phone_case_cost * num_phone_cases) money_left = money_given - total_cost result = money_left num_draws = 78 / ...
A gym charges a monthly fee of $50. A customer wants to sign up for a 6-month package and gets a discount of $20 on their total purchase. How much do they pay in total?
def solve() -> int: monthly_fee = 50 package_length_in_months = 6 package_discount = 20 subtotal = monthly_fee * package_length_in_months total = subtotal - package_discount result = total return result
A charity organization is running a fundraiser where they donate $2 for every $10 donated by donors. The average donor donates $15 and there are 50 donors that day. How much does the charity organization donate?
def solve() -> int: donation_per_donor = 15 number_of_donors = 50 donation_ratio = 2 / 10 total_donation = donation_per_donor * number_of_donors * donation_ratio result = total_donation return result
David is managing a music festival. Each of the nine bands gets paid $500 for performing, plus $100 each for nine microphones and $50 each for nine instrument cables. How much money does David need to pay out in total?
def solve() -> int: bands = 9 band_payment = 500 microphones = 9 microphone_payment = 100 cables = 9 cable_payment = 50 total_payment = (bands * band_payment) + (microphones * microphone_payment) + (cables * cable_payment) result = total_payment return result
Leo has $600 to buy gadgets for his birthday. He spends two fifths of that on his laptop, and he spends a third of what is left on his headphones. What is the amount of money Leo has left?
def solve() -> int: money = 600 laptop_cost = money * (2/5) money = money - laptop_cost headphone_cost = money * (1/3) money = money - headphone_cost result = money return result
Student: A recipe calls for 3 cups of flour to make 24 cookies. How many cups of flour do you need to make 48 cookies?
def solve() -> int: cookies = 48 cups_per_24_cookies = 3 cups_needed = (cookies / 24) * cups_per_24_cookies result = cups_needed return result
A car traveled a distance of 135 kilometers in 3 hours and 45 minutes. If it was traveling at a pace which was 4 minutes per kilometer faster than the average pace, how long would it have taken the car to travel a distance of 45 kilometers at the same pace?
def solve() -> int: distance = 135 time = 3 + 45/60 pace = time / distance new_pace = pace - 4/60 new_distance = 45 new_time = new_distance * new_pace result = new_time * 60 return result
At a jewelry store, necklaces are sold individually with a base price of $25 each, plus a 2% order surcharge for any purchase of 4 items or more. Calculate the total amount of money the customer paid for 4 necklaces.
def solve() -> int: price_necklace = 25 surcharge = 0.02 * price_necklace * 4 total_price = price_necklace * 4 + surcharge result = total_price return result
John walked 1/3 mile to the store to buy some bread. Then he jogged 2/5 miles to the park, before walking a further 1/4 mile to his friend's house. How many miles did John travel in all?
def solve() -> int: distance1 = 1/3 distance2 = 2/5 distance3 = 1/4 total_distance = distance1 + distance2 + distance3 + distance1 result = total_distance return result
Tom bought a dozen eggs and 2/3 of them are white, what is the total number of white eggs Tom bought?
def solve() -> int: total_eggs = 12 percentage_white_eggs = 2/3 result = total_eggs * percentage_white_eggs return result
Rob and Bob take 3 hours to write 6 pages of an essay. How long will they take to write 42 pages?
def solve() -> int: pages_per_hour = 6/3 total_hours = 42/pages_per_hour result = total_hours return result
3. Alex has 5 packs of marbles. Each pack contains 40 marbles. How many marbles does Alex have in total?
def solve() -> int: a=5 b=40 answer = a*b result = 200 return result
A zoo has 30 monkeys in a cage. Every week, they add 4 more monkeys. How many monkeys will there be in 10 weeks?
def solve() -> int: monkeys = 30 + (4 * 10) result = monkeys return result
Ann has twice as many apples as Ben. Ben has 10 apples. How many apples does Ann have?
def solve() -> int: ben_apples = 10 ann_apples = ben_apples * 2 result = ann_apples return result
``` Sara has twice as much money as Julie, and Julie has 3 times as much money as Sam. If Sam has $10, how much money should they give away so that each of them will have $20?
def solve() -> int: sam_money = 10 julie_money = sam_money * 3 sara_money = julie_money * 2 total_money_needed = 20 * 3 money_to_give = (total_money_needed - (sam_money + julie_money + sara_money)) / 3 result = money_to_give return result
Student: A factory produces 650 boxes of crackers each day. If a box contains 24 crackers, how many crackers does the factory produce per week (7 days)?
def solve() -> int: boxes_per_day = 650 crackers_per_box = 24 days_in_week = 7 total_crackers_per_week = boxes_per_day * crackers_per_box * days_in_week result = total_crackers_per_week return result
Q10: Ted had 3 sandwiches and 2 slices of cake. He ate 1 sandwich and 1 slice of cake. How many pieces of food did Ted have left?
def solve() -> int: sandwiches = 3 slices_of_cake = 2 food_eaten = 1 + 1 food_left = sandwiches + slices_of_cake - food_eaten result = food_left return result