question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Brad wants to distribute 274 candies equally among 7 children. How many candies will each child get?
def solve() -> int: candies_per_child = 274 // 7 result = candies_per_child return result
David invests $10,000 in stocks and earns a 12% return. How much money did David make from his investment?
def solve() -> int: investment = 10000 return_rate = 0.12 profit = investment * return_rate result = investment + profit return result
Carla bought some apples and oranges from a fruit stand. She paid $9 for 15 fruits in total. She knew that each apple cost $0.6, while each orange cost $0.4 less than an apple. How many oranges did she buy?
def solve() -> int: total_cost = 9 total_fruits = 15 apple_price = 0.6 orange_price = apple_price - 0.4 orange_price = 0.2 oranges = 0 result = oranges return result
Question10: Daniel is running a marathon. He is already 4 miles into the race and he still has 12 miles left. If each mile is 1,609 meters, how many meters do Daniel have left to run?
def solve() -> int: milesRun = 4 milesLeft = 12 metersPerMile = 1609 metersLeft = (milesLeft * metersPerMile) result = metersLeft return result
The cost of a pizza is 55 dollars. If the customer is paying with 15 dollar bills, how many bills does the customer need to pay for the pizza?
def solve() -> int: cost = 55 num_dollars = cost / 15 num_dollars = int(round(num_dollars)) result = num_dollars return result
Student: The total cost of Glen’s groceries was $38. The cheese cost him $13, the pasta cost him $11, and the tomatoes cost him $3. The only other groceries he bought were peppers. In dollars, how much money did the peppers cost him?
def solve() -> int: total_cost = 38 cheese_cost = 13 pasta_cost = 11 tomato_cost = 3 pepper_cost = total_cost - cheese_cost - pasta_cost - tomato_cost result = pepper_cost return result
Student: Lucy bought a pack of 20 pencils for $5.00. She used 8 pencils for her school work and gave 4 pencils to her friends. She decided to sell the remaining pencils for $0.40 each. How much net profit or loss did Lucy have?
def solve() -> int: pencils_bought = 20 price_per_pencil = 5.00 pencils_used = 8 pencils_given = 4 pencils_remaining = pencils_bought - pencils_used - pencils_given price_per_pencil_sold = 0.40 total_cost = pencils_bought * price_per_pencil total_revenue = pencils_remaining * price_per_p...
Ben bikes 20 miles round trip to the gym five days a week. His battery holds 4 gallons of energy and his bike gets 10 miles to the gallon of energy. He has to pay $2 for each added gallon of energy. How much money does Ben spend on energy for his bike in 3 weeks?
def solve() -> int: distance_per_day = 20 / 5 distance_in_3_weeks = distance_per_day * 5 * 3 energy_needed = distance_in_3_weeks / 10 energy_in_battery = 4 energy_to_purchase = energy_needed - energy_in_battery cost_of_energy = energy_to_purchase * 2 result = co...
Student: Lin purchased a car for $12,500. She invested 10% of the cost into mechanical modifications, 20% of the cost into a car alarm, and the rest into car insurance. How much did she pay for car insurance?
def solve() -> int: car_cost = 12500 mechanical_modifications = 0.1 * car_cost car_alarm = 0.2 * car_cost car_insurance = car_cost - mechanical_modifications - car_alarm result = car_insurance return result
Lily and Ryan have a flower collection. Lily collects roses and Ryan collects tulips. Lily has 30 roses and Ryan has 85 tulips. If the roses are sold for $2 each and the tulips are sold for $1 each, what is the difference in the amount of money they make in dollars?
def solve() -> int: roses = 30 tulips = 85 rose_price = 2 tulip_price = 1 lily_money = roses * rose_price ryan_money = tulips * tulip_price difference = lily_money - ryan_money result = difference return result
Student: Malik had 24 pencils and 15 erasers before he gave 6 pencils and 3 erasers to his sister. How many times more pencils than erasers does Malik have now?
def solve() -> int: pencils_before = 24 erasers_before = 15 pencils_given = 6 erasers_given = 3 pencils_now = pencils_before - pencils_given erasers_now = erasers_before - erasers_given ratio = pencils_now / erasers_now result = ratio - 1 return result
Ava is walking her dog, Max, every day to prepare him for a race. She walks for 1 hour every day for three weeks (21 days). If she continues to walk for the next 4 days, how many hours will she spend on walking in total?
def solve() -> int: days = 21 + 4 hours_per_day = 1 total_hours = days * hours_per_day result = total_hours return result
A store sells bottles of shampoo for $6.50 each. If a customer bought 5 bottles, what was the customer's total bill?
def solve() -> int: total_bill = 6.50 * 5 result = total_bill return result
Alex has 15 quarters and 9 dimes. He buys 2 burgers for 3 quarters each and 5 fries for 2 dimes each. How much money, in cents, does he have left?
def solve() -> int: quarters = 15 dimes = 9 burgers = 2 fries = 5 burger_cost = 3 fries_cost = 2 total_cost = (burgers * burger_cost) + (fries * fries_cost) total_paid = (quarters * 25) + (dimes * 10) change = total_paid - total_cost result = change return...
Student: Tom has 7 apples and Maria has 5 more than twice as many apples as Tom. How many apples do they have altogether?
def solve() -> int: tom = 7 maria = 5 + 2 * tom total = tom + maria result = total return result
A truck can go 20 miles with a gallon of gasoline. If it has to travel 180 miles, how many gallons of gasoline will it require?
def solve() -> int: miles_per_gallon = 20 distance_to_travel = 180 gallons_required = distance_to_travel / miles_per_gallon result = gallons_required return result
A book has 250 pages. If a student reads 30 pages per day, how many days will it take to finish the book?
def solve() -> int: pages = 250 pages_read_per_day = 30 days_to_finish = pages / pages_read_per_day result = days_to_finish return result
Sarah, Jeff, and Ryan share 700 pens in the ratio 2:4:7. If Sarah gives Jeff all her pens, how many pens will Jeff have in total?
def solve() -> int: pens_total = 700 ratio_sarah = 2 ratio_jeff = 4 ratio_ryan = 7 total_ratio = ratio_sarah + ratio_jeff + ratio_ryan sarah_pens = (ratio_sarah / total_ratio) * pens_total jeff_pens = (ratio_jeff / total_ratio) * pens_total ryan_pens = (ratio_ryan / total_ratio...
A grocery store has 350 apples, 275 oranges, and 150 bananas. If they want to make fruit baskets, and each basket should have 3 apples, 2 oranges, and 1 banana, how many fruit baskets can they make?
def solve() -> int: apples = 350 oranges = 275 bananas = 150 apples_per_basket = 3 oranges_per_basket = 2 bananas_per_basket = 1 max_baskets = min(apples // apples_per_basket, oranges // oranges_per_basket, bananas // bananas_per_basket) result = max_baskets retur...
Nathan is traveling 100 km each day for the next 7 days. If he takes a day off and travels extra 50 km on one day, how much distance will he have covered by the end of 7 days?
def solve() -> int: distance_per_day = 100 total_days = 7 extra_distance = 50 total_distance = distance_per_day * total_days + extra_distance result = total_distance return result
Student: Ted purchased 6 items at the store. Each item has a price tag of $39, but he is offered a 15% discount on the entire purchase if he buys all six items at once. How much did Ted save on his purchase?
def solve() -> int: items = 6 price = 39 discount = 0.15 original_cost = items * price discounted_cost = original_cost * (1 - discount) saved = original_cost - discounted_cost result = saved return result
A necklace that costs $200 originally is now on sale for $150. How much do you save if you buy two of them?
def solve() -> int: orig_price = 200 sale_price = 150 num_items = 2 savings = (orig_price - sale_price) * num_items result = savings return result
Noah decides to jog around his block every morning. He runs around the square block 3 times and runs around the circular park twice. If the block has a perimeter of 1.2 miles and the park has a diameter of 0.3 miles, how many miles does Noah jog every morning?
def solve() -> int: block_perimeter = 1.2 park_diameter = 0.3 block_distance = block_perimeter * 3 park_radius = park_diameter / 2 park_circumference = 2 * 3.14 * park_radius park_distance = park_circumference * 2 total_distance = block_distance + park_distance result = total_distance ...
Two construction workers are building a wall. The first worker can lay an average of 30 bricks per hour, while the second worker can lay an average of 25 bricks per hour. After laying 100 bricks, the second worker takes a break for lunch. How much time can they take before the first worker catches up with them?
def solve() -> int: first_worker_bricks_per_hour = 30 second_worker_bricks_per_hour = 25 bricks_laid_by_second_worker = 100 time_for_first_worker = 100 / first_worker_bricks_per_hour time_for_second_worker = 100 / second_worker_bricks_per_hour time_difference = time_for_second_wor...
Tom is a student studying for a test. He needs to read 15 pages per day to finish his book in time for his exam, but he has already read 80 pages. How many more pages does he need to read?
def solve() -> int: pages_per_day = 15 pages_already_read = 80 pages_to_read = 15 - pages_already_read result = pages_to_read return result
In a theater, 300 people gathered to watch a play. For 3 hours straight, they enjoyed the performance at a rate of 25 people per hour. Over the next 5 hours, a new group of theatergoers arrived at a rate of 14 people per hour. Once the play was over, what is the difference in the total number of people who watched the ...
def solve() -> int: people_per_hour1 = 25 people_per_hour2 = 14 hours1 = 3 hours2 = 5 total_people1 = people_per_hour1 * hours1 total_people2 = people_per_hour2 * hours2 total_people_difference = total_people2 - total_people1 result = total_people_difference retur...
The music store has 200 CDs, 150 vinyl records, and 100 cassette tapes. If each vinyl record is worth 2 CDs, and each cassette tape is worth 3 vinyl records, what is the total value of the music store's inventory expressed as a number of CDs?
def solve() -> int: cds = 200 vinyl_records = 150 cassette_tapes = 100 vinyl_to_cds = 2 cassette_to_vinyl = 3 total_cds = cds + (vinyl_records * vinyl_to_cds) + (cassette_tapes * cassette_to_vinyl) result = total_cds return result
Student: A store is having a sale where all items are 20% off. If the original price of a shirt was $25, what is the sale price?
def solve() -> int: original_price = 25 discount = 0.2 * original_price sale_price = original_price - discount result = sale_price return result
In a music festival, there are 60 people. If there are three times as many singers as dancers, and there are 15 dancers, and each person needs a pass to enter, how many passes are needed in total?
def solve() -> int: total_people = 60 dancers = 15 singers = 3 * dancers passes_needed = total_people passes_needed *= 1 result = passes_needed return result
A water tank has a capacity of 500 gallons. The tank is currently 60% full. If 100 gallons of water are added to the tank, what percent full is the tank?
def solve() -> int: capacity = 500 current_level = 0.6 * capacity added_water = 100 new_level = current_level + added_water percent_full = new_level / capacity * 100 result = percent_full return result
Samantha's cookbook has 150 pages and her food magazine has 20 more pages. Her DIY book has one-sixth of the sum of the first two books' pages, and her interior designing book has thrice the number of pages of her cookbook. If Samantha stacks all her books on her shelf, how many pages would there be in total?
def solve() -> int: cookbook_pages = 150 magazine_pages = cookbook_pages + 20 diy_pages = (cookbook_pages + magazine_pages) / 6 interior_pages = 3 * cookbook_pages total_pages = cookbook_pages + magazine_pages + diy_pages + interior_pages result = total_pages return result
If a car travels 200 miles in 4 hours, and then travels 100 miles in 2 hours, what is the average speed of the car for the entire trip?
def solve() -> int: distance1 = 200 time1 = 4 distance2 = 100 time2 = 2 total_distance = distance1 + distance2 total_time = time1 + time2 average_speed = total_distance/total_time result = average_speed return result
What is the average age of the 1st and 6th fastest dogs if the 1st fastest dog is 15 years old, the 2nd fastest dog is a quarter the age of the 1st, the 3rd fastest dog is 3 times older than the 2nd fastest, the 4th fastest dog is 3 years older than the 3rd fastest dog, the 5th fastest dog is 10 years older than the 4t...
def solve() -> int: fastest_1 = 15 fastest_2 = 0 fastest_3 = 0 fastest_4 = 0 fastest_5 = 0 fastest_2 = fastest_1/4 fastest_3 = fastest_2*3 fastest_4 = fastest_3 + 3 fastest_5 = fastest_4 + 10 average_age = (fastest_1 + fastest_5)/2 result = ave...
The Nelson family owns a carwash business and usually make $24 for each car wash. If they served 10 customers today, how much did they make?
def solve() -> int: price_carwash = 24 customers = 10 earnings = customers * price_carwash result = earnings return result
Ben earned $19 less than Emma. If they have $95 together, how much did Emma earn? Use E to represent how much Emma earned.
def solve() -> int: E = (95 + 19) / 2 result = E return result
After eating lunch consisting of 450 calories, Lily went for a swim for 40 minutes, burning 6 calories per minute. What was Lily's total calorie intake after swimming? Maria is dividing up apples for a fundraiser. She bought 800 apples, and each gift bag has 4 apples. If 1000 gift bags are going to be given away and 25...
def solve() -> int: calories_before_swim = 450 calories_burned = 40 * 6 calories_after_swim = calories_before_swim - calories_burned num_gift_bags = 1000 * 0.25 total_apples_needed = num_gift_bags * 4 apples_left_over = 800 - total_apples_needed result = apples_...
If the sum of two consecutive numbers is 15, what are the numbers?
def solve() -> int: sum_nums = 15 first_num = (sum_nums - 1) // 2 second_num = (sum_nums + 1) // 2 result = first_num, second_num return result
Student: A grocery store offers a discount of 25% off for all fruits on Saturdays. On a Saturday, there were 20 apples sold at the regular price of $1 and 30 bananas sold at the regular price of $0.5. How much money did the store make?
def solve() -> int: discount = 0.25 num_apples = 20 price_apple = 1 num_bananas = 30 price_banana = 0.5 total_price_apples_before_discount = num_apples * price_apple total_price_bananas_before_discount = num_bananas * price_banana total_price_before_discount = total_price_apples_before_d...
Lila wants to improve her baking skills. She used to bake for 1 hour a day but increased that by 200%. Before she used to bake 12 cookies a day. How many cookies does she bake in a week now?
def solve() -> int: hours_per_day = 1 increase_percentage = 200 cookies_per_day = 12 increased_hours_per_day = hours_per_day + (hours_per_day * increase_percentage / 100) cookies_per_day_now = cookies_per_day * increased_hours_per_day cookies_per_week_now = cookies_per_day_now * 7...
Student: A pizza was divided into 10 equal slices. John ate 3 pieces of pizza. What fraction of the pizza did John eat?
def solve() -> int: total_slices = 10 slices_eaten = 3 fraction_eaten = slices_eaten / total_slices result = fraction_eaten return result
A toy store bought 100 stuffed animals for $100. They sold 20 of them for $3 each, 30 for $2 each, and the remaining for $1 each. What was the profit earned?
def solve() -> int: cost_price = 100 selling_price_one = 3 selling_price_two = 2 selling_price_three = 1 qty_one = 20 qty_two = 30 qty_three = 50 total_selling_price = qty_one * selling_price_one + qty_two * selling_price_two + qty_three * selling_price_three profit = total_selling_p...
Mia's backpack weighs three times as much as Jacob's backpack. Jacob's backpack weighs 10 pounds less than Emily's backpack. If Emily's backpack weighs 50 pounds, how much does Mia's backpack weigh?
def solve() -> int: emilys_backpack_weight = 50 jacob_backpack_weight = emilys_backpack_weight - 10 mia_backpack_weight = 3 * jacob_backpack_weight result = mia_backpack_weight return result
If Sarah drinks 400 milliliters of water every hour, how many hours will it take her to drink a total of 2.8 liters of water in a day?
def solve() -> int: water_per_hour = 400 total_water = 2.8 * 1000 hours_per_day = 24 hours_to_drink = total_water / water_per_hour result = hours_to_drink return result
A cake recipe calls for 1/3 cup of sugar. If you want to make 6/9 of the recipe, how much sugar will you need?
def solve() -> int: original_recipe = 1/3 fraction_of_recipe = 6/9 recipe_amount = original_recipe * fraction_of_recipe result = recipe_amount return result
A party planner purchased 120 balloons and 3000cm³ of helium. Each balloon requires 30cm³ of helium to float. If they filled all balloons using all the helium, how many more balloons are floating than not?
def solve() -> int: balloons = 120 helium = 3000 helium_per_balloon = 30 helium_needed = balloons * helium_per_balloon floating_balloons = helium // helium_per_balloon not_floating_balloons = balloons - floating_balloons more_floating_balloons = floating_balloons - not_floatin...
A bookstore had 50 books on Monday. On Tuesday, they sold 20% of their books and received new stock that increased their inventory by 30%. How many books are in the bookstore now?
def solve() -> int: starting_books = 50 sold_percent = 0.2 new_stock_percent = 0.3 num_sold = starting_books * sold_percent num_new_books = starting_books * new_stock_percent final_books = starting_books - num_sold + num_new_books result = final_books return result
A mail carrier delivers 345 letters on Monday, 413 letters on Tuesday, and 224 letters on Wednesday. What is the average number of letters delivered each day?
def solve() -> int: total_letters = 345 + 413 + 224 num_days = 3 average = total_letters / num_days result = average return result
A train travels at a speed of 100 miles per hour. How far can it travel in 3 hours and 45 minutes?
def solve() -> int: speed = 100 time_in_hours = 3.75 distance = speed * time_in_hours result = distance return result
Ken went grocery shopping. He spent $15.75 on vegetables, $25 on fruits, and $10.50 on crackers. If he gave the cashier $70, how much change did he receive?
def solve() -> int: total_spend = 15.75 + 25 + 10.50 amount_given = 70 change = amount_given - total_spend result = change return result
A barber cuts 30 haircuts in a day. If each haircut costs $20, how much money can the barber earn in a day? Each haircut requires the barber to use $2 worth of materials. A chef weighs 75 kg at 6 months from a cooking competition. She is on a diet that allows her to lose 2.5 kg per month until the day of the competitio...
def solve() -> int: haircuts_per_day = 30 cost_per_haircut = 20 material_cost_per_haircut = 2 total_earnings = haircuts_per_day * cost_per_haircut total_material_cost = haircuts_per_day * material_cost_per_haircut net_earnings = total_earnings - total_material_cost chef_weight...
Student: 1. Jennifer can make 12 jars of jam using 4 kilograms of strawberries. If she uses 20 kilograms of strawberries per week, how many jars of jam can she make in a month?
def solve() -> int: strawberries_per_jar = 4 strawberries_per_week = 20 jars_per_week = strawberries_per_week / strawberries_per_jar jars_per_month = jars_per_week * 4 result = jars_per_month return result
Lucas is working as a delivery driver and earns a flat rate of $12 per hour plus a 15% tip on each order. If he delivers 18 orders in one hour and the average order value is $25, how much does he earn in total?
def solve() -> int: tip = 0.15 * 25 * 18 earnings = 12 + tip result = earnings return result
Rachel has twice as many bookcases as Josh, but Tom has three times as many bookcases as Rachel. If there are 45 bookcases altogether, how many bookcases does Josh have?
def solve() -> int: total_bookcases = 45 x = total_bookcases / 9 result = x return result
A bakery sells pies for $10 each and cakes for $25 each. Yesterday, the bakery sold a total of 32 pies and cakes for a total of $360. How many pies and how many cakes did the bakery sell yesterday?
def solve() -> int: num_pies = 0 num_cakes = 0 num_pies = (360 - 25 * num_cakes) / 10 num_cakes = (360 - 10 * num_pies) / 25 result = (num_pies, num_cakes) return result
If a number is increased by 25% and then decreased by 25%, what is the final value compared to the original value?
def solve() -> int: original_value = 100 increase_percent = 25 decrease_percent = 25 increase_amount = original_value * (increase_percent / 100) new_value = original_value + increase_amount decrease_amount = new_value * (decrease_percent / 100) final_value = new_value - decrease_amount r...
There are 18 windows on a certain building. Each window needs 5 pieces of glass. How many pieces of glass does the building need in total?
def solve() -> int: windows = 18 pieces_of_glass = 5 result = windows * pieces_of_glass return result
Student: A rectangular room has a length of 12 feet and a width of 8 feet. If you want to cover the entire floor with tiles that are each 1 square foot, how many tiles do you need?
def solve() -> int: length = 12 width = 8 tile_size = 1 area = length * width num_tiles = area / tile_size result = num_tiles return result
Sarah picked fourteen roses from her garden. Out of the roses, for every three that she kept, she gave one to her neighbor. How many roses did Sarah keep?
def solve() -> int: total_roses = 14 roses_given_away = total_roses // 3 roses_kept = total_roses - roses_given_away result = roses_kept return result
Amelia is 8 years old, and her mother is 4 times older than her. Amelia's aunt is twice as old as her mother. How much younger is Amelia than her aunt?
def solve() -> int: mother_age = 8 * 4 aunt_age = mother_age * 2 age_difference = aunt_age - 8 result = age_difference return result
A rectangular box has a length of 8 feet, a width of 6 feet and a height of 4 feet. What is the volume of the box?
def solve() -> int: volume = 8 * 6 * 4 result = volume return result
If a triangle has a base of 10 inches and a height of 6 inches, what is the area of the triangle in square inches?
def solve() -> int: height = 6 base = 10 area = 0.5 * height * base result = area return result
Possible questions and programs: Alice has 3 more coins than Bob. Bob has twice as many coins as Carol. If Carol has 8 coins, how many coins does Alice have?
def solve() -> int: Bob_coins = 8 * 2 Alice_coins = Bob_coins + 3 result = Alice_coins return result
2. A bakery opened a new store last week. On the first day, they sold 3/5 of the cupcakes they had. On the second day, they sold 2/4 of the remaining cupcakes. There were 76 cupcakes left at the end of the week. How many cupcakes did they have at the beginning?
def solve() -> int: total = 76 cupcake1 = total * 5/3 cupcake2 = cupcake1 * 4/2 result = (127.5, 255.0) return result
The local coffee shop offers a special promotion of a free pastry with the purchase of a coffee for $3.50. They are running a Christmas special and offering a 10% discount on all purchases. Steve is buying coffee and pastries for 12 people. How much will he spend on all purchases after the discount?
def solve() -> int: coffee_price = 3.50 discount = 0.10 num_people = 12 total_cost = (coffee_price + 0) * num_people discounted_cost = total_cost * (1 - discount) result = discounted_cost return result
John fills a bottle with 20 ounces of milk. On the 1st of February, 2022, the bottle shows 10 ounces remaining. After filling up the bottle, it contains 40 ounces of milk by the 1st of April, 2022. On June 30th, 2022, the bottle shows 7 ounces remaining. How much milk did John use between February 1st and June 30th, 20...
def solve() -> int: bottle_capacity = 20 initial_amount = 10 final_amount = 40 remaining_amount = 7 amount_used = initial_amount - final_amount + remaining_amount result = amount_used return result
During a clearance sale, a TV priced at $960 had its price marked down by 35%. What was the price during the clearance sale?
def solve() -> int: discounted_price = 960*0.65 result = round(discounted_price,2) return result
A tank is filled with 600 liters of water. If each person needs 5 liters of water per day, and there are 20 people in a camp, for how many days will the water last without being refilled?
def solve() -> int: num_people = 20 water_per_person_per_day = 5 water_capacity = 600 days = water_capacity / (water_per_person_per_day * num_people) result = days return result
A school is distributing free books to students of different grades. There are 4 grades in the school and each grade has different number of students. Each book costs $10. If there are 50, 70, 90, and 60 students respectively for the four grades, how much does the school need to spend in total?
def solve() -> int: grade1_students = 50 grade2_students = 70 grade3_students = 90 grade4_students = 60 total_students = grade1_students + grade2_students + grade3_students + grade4_students total_cost = total_students * 10 result = total_cost return result
ome possible new questions are: A bakery sells cakes for $20 each. They decide to have a clearance sale and offer a 60% discount on all cakes. They have 500 cakes in stock and manage to sell 80% of them. They have to pay $2000 for rent and $500 for utilities. How much money do they make from the sale?
def solve() -> int: discounted_price = 20 * (1 - 0.6) cakes_sold = 500 * 0.8 revenue = discounted_price * cakes_sold cost = 2000 + 500 profit = revenue - cost result = profit return result
Student: Jill has 14 boxes of chocolate. She gives away 7 of them. How many boxes does she have left?
def solve() -> int: num_boxes_original = 14 num_boxes_given_away = 7 num_boxes_left = num_boxes_original - num_boxes_given_away result = num_boxes_left return result
Ms. Lee is buying some books for her class. She wants to buy 5 copies of each book. The prices of the books are: $7.95 for Harry Potter, $6.50 for The Lion, the Witch and the Wardrobe, $8.99 for The Hunger Games, and $9.75 for The Giver. She also gets a 10% discount on the total price. How much does she pay for the boo...
def solve() -> int: harry_potter_price = 7.95 lion_witch_wardrobe_price = 6.50 hunger_games_price = 8.99 giver_price = 9.75 harry_potter_cost = 5 * harry_potter_price lion_witch_wardrobe_cost = 5 * lion_witch_wardrobe_price hunger_games_cost = 5 * hunger_games_price giver_cost = 5 * give...
If Janessa gives Dexter half of her baseball cards after she gives him his first collection, and she currently has 32 cards, how many cards did Dexter receive for his first collection?
def solve() -> int: num_cards = 32 cards_given_to_dexter = num_cards / 2 result = cards_given_to_dexter return result
A bicycle costs $100 and a helmet costs $25. If a customer bought 3 bicycles and 4 helmets, how much money did the customer spend in total?
def solve() -> int: cost_bicycle = 100 cost_helmet = 25 number_bicycles = 3 number_helmets = 4 total_cost = (cost_bicycle * number_bicycles) + (cost_helmet * number_helmets) result = total_cost return result
A shopkeeper sold a pen at a profit of 20% and another pen at a loss of 20%. If both pens were sold at the same price, what was the net profit/loss percentage?
def solve() -> int: cp = sp = 100 profit_percentage = 20 loss_percentage = 20 profit = cp * profit_percentage / 100 loss = sp * loss_percentage / 100 total_profit_loss = profit - loss net_profit_loss_percentage = total_profit_loss * 100 / cp result = net_profit_loss_percentage return...
Student: A group of 5 business partners decided to share their profits equally. If each partner received $3600, what was group's total profit?
def solve() -> int: num_partners = 5 profit_per_partner = 3600 total_profit = num_partners * profit_per_partner result = total_profit return result
If Nick has a coupon of $10 off on a jacket that has a regular price of $90, what should he pay?
def solve() -> int: Regular_price = 90 Discount_value = 10 Total_price = Regular_price - Discount_value result = Total_price return result
Karen can run 6 laps around the track in 16 minutes. How many laps can she run in 30 minutes?
def solve() -> int: laps_per_min = 6/16 laps_in_30_mins = laps_per_min * 30 result = laps_in_30_mins return result
Michael wants to buy his sister a doll that costs $20. He also wants to buy her a set of markers that costs twice the amount of the doll. The store is offering a 15% off sale on all toys. How much will Michael spend in total?
def solve() -> int: doll_cost = 20 markers_cost = 2 * doll_cost total_cost = doll_cost + markers_cost discount = total_cost * 0.15 final_cost = total_cost - discount result = final_cost return result
Student: In a school of 500 students, 60% are boys. If 70% of the boys play sports, and half of the girls play sports, how many students play sports in total?
def solve() -> int: total_students = 500 boys_percentage = 0.6 boys_play_sports_percentage = 0.7 girls_play_sports_percentage = 0.5 boys = total_students * boys_percentage girls = total_students * (1 - boys_percentage) boys_play_sports = boys * boys_play_sports_percentage girls_play_spor...
Mary works 8 hours a day. If she earns $20 per hour, what is her weekly earnings?
def solve() -> int: hourly_salary = 20 num_hours_per_day = 8 num_days_per_week = 5 weekly_earnings = hourly_salary * num_hours_per_day * num_days_per_week result = weekly_earnings return result
Sarah is organizing a cooking class with 14 participants. She wants to provide everyone, herself included, with 1/4 pound of butter. Each stick of butter weighs 1/2 pound. How many sticks of butter should Sarah purchase for the cooking class?
def solve() -> int: num_participants = 14 butter_per_person = 1/4 total_butter = num_participants * butter_per_person butter_weight = 1/2 num_sticks = total_butter / butter_weight result = num_sticks return result
Karen is packing snacks for a camping trip. She bought 300 granola bars and wants to pack 5 bars in each bag. If she packs 50 bags, how many granola bars will be left over?
def solve() -> int: granola_bars = 300 bars_per_bag = 5 num_bags = 50 total_bars = bars_per_bag * num_bags leftover_bars = granola_bars - total_bars result = leftover_bars return result
Lily bought 2 snacks and 3 drinks from a convenience store. The snacks cost $2.50 each and the drinks cost $3.50 each. How much did Lily spend in total?
def solve() -> int: snacks = 2.50 drinks = 3.50 total_snacks = snacks * 2 total_drinks = drinks * 3 total_cost = total_snacks + total_drinks result = total_cost return result
A pharmacy wants to add new products to its inventory. There are 36 products to order. The pharmacy wants every sixth product to be a natural remedy, and they agreed to order equal numbers of vitamins, supplements, and over-the-counter medicines. How many of each kind of product will they order?
def solve() -> int: total_products = 36 natural_remedy = total_products // 6 vitamins = supplements = over_the_counter = (total_products - natural_remedy) // 3 result = f'<<<{natural_remedy}, {vitamins}, {supplements}, {over_the_counter}>>>' return result
Peter has 6 stamps and each stamp has a value of 25 cents. He wants to buy a postcard that costs $1.5 and send it to his friend. How much money, in cents, will Peter have left after he buys and sends the postcard?
def solve() -> int: total_value = 6 * 25 cost = 150 money_left = total_value - cost result = money_left return result
Jason decides to surprise his girlfriend by taking her out to dinner and a movie. However, he accidentally spends $70 on the movie tickets and $100 on dinner when his budget was $150 for the both of them. What is the maximum amount of money he can get back?
def solve() -> int: budget = 150 movie_tickets = 70 dinner = 100 total_spent = movie_tickets + dinner max_money_back = budget - total_spent result = max_money_back return result
At a pool party, while sunbathing by the pool, Matt heard cannonballs splashing into the water. When he looked, he saw 8 people jumping in. If there were also 5 people playing cards under an umbrella, how many people were at the pool party?
def solve() -> int: people_jumping = 8 people_playing_cards = 5 total_people = people_jumping + people_playing_cards result = total_people return result
Peter has 350 pages of a book left to read. He reads 15 pages per day for the first week, 20 pages per day for the second week, and 25 pages per day for the third week. How many pages are left in the book?
def solve() -> int: pages_read_first_week = 15 * 7 pages_read_second_week = 20 * 7 pages_read_third_week = 25 * 7 pages_left = 350 - pages_read_first_week - pages_read_second_week - pages_read_third_week result = pages_left return result
If Tom's age is one-third of his grandfather's age, and his grandfather is 72 years old, what is the age difference between Tom and his father, who is half of his grandfather's age?
def solve() -> int: grandfather_age = 72 father_age = grandfather_age / 2 tom_age = grandfather_age / 3 age_difference = father_age - tom_age result = age_difference return result
A shop keeper found a rare artifact. He offered 10 coins for it. An arts collector offered to buy it, paying the shop keeper twice as much as it was worth. How much money did the arts collector pay for the artifact?
def solve() -> int: shop_keeper_payment = 10 collectors_payment = shop_keeper_payment * 2 result = collectors_payment return result
Student: In a school, there were 45 books and 9 students. How many books did each student get?
def solve() -> int: num_books = 45 num_students = 9 books_per_student = num_books / num_students result = books_per_student return result
On Sunday morning, a coffee shop had 350 cups of coffee left after a busy Saturday. During the day, they served 890 cups of coffee, and then 250 were spilled by the clumsy waiter. Overnight, the coffee shop restocked 600 cups of coffee. If every hour, 40 cups of coffee were sold, and every 20 minutes, 10 cups of coffee...
def solve() -> int: coffee = 350 coffee += 600 coffee -= 250 coffee -= 890 flow_in = 24 * 40 flow_out = (60/20) * 10 * 24 coffee += flow_in - flow_out result = coffee return result
A company needs to print 5000 copies of a brochure. The printing company charges $0.20 per copy for the first 1000 copies and $0.15 per copy for each copy after that. What is the total cost to print 5000 copies?
def solve() -> int: num_copies = 5000 first_1000_copies_cost = 0.2 additional_copies_cost = 0.15 if num_copies <= 1000: total_cost = num_copies * first_1000_copies_cost else: total_cost = (1000 * first_1000_copies_cost) + ((num_copies - 1000) * additional_copies_cost) result = to...
Katherine bought 3 shirts and 2 pairs of shoes. A shirt costs $15 and a pair of shoes costs $35. How much will Katherine pay in all?
def solve() -> int: shirts_cost = 15 * 3 shoes_cost = 35 * 2 total_cost = shirts_cost + shoes_cost result = total_cost return result
A bus company pays $800 for a full trip from town A to town B. Chris made 2 trips in a day while Jana made 3/4 as many. Determine their difference in earnings that day.
def solve() -> int: chris_trips = 2 jana_trips = 3/4 * chris_trips chris_earnings = chris_trips * 800 jana_earnings = jana_trips * 800 earnings_difference = chris_earnings - jana_earnings result = earnings_difference return result
A bakery sells cupcakes for $2 each. The bakery has a monthly rent of $500 and it costs $0.50 to make each cupcake. If the bakery sells 100 cupcakes in a month, how much profit did they make?
def solve() -> int: cupcake_cost = 0.50 cupcake_price = 2.00 rent = 500.00 cupcake_count = 100 expense = cupcake_cost * cupcake_count + rent income = cupcake_price * cupcake_count profit = income - expense result = round(profit, 2) return result
6. An elevator travels a total distance of 10 meters in 3 minutes. It travels the first 5 meters in 2 minutes. What is the velocity of the elevator for the last 5 meters?
def solve() -> int: distance = 10 total_time = 3 time_section1 = 2 time_remaining = total_time - time_section1 distance_remaining = distance - 5 velocity_elevator = distance_remaining/time_remaining result = velocity_elevator * 60 return result
A construction worker is preparing to build a house. He knows that he needs 3 pounds of cement for every 1 square foot of floor space. He can get a second batch of cement that will only be 30% of the size of the first batch. If he plans to build a house with 2000 square feet of floor space, how much cement does he need...
def solve() -> int: cement_per_sqft = 3 total_sqft = 2000 initial_batch = cement_per_sqft * total_sqft second_batch_size = 0.3 * initial_batch total_cement = initial_batch + second_batch_size result = total_cement return result
Sarah wants to save money for a new phone. If she saves $15 every week for 8 weeks, how much money will she save in total?
def solve() -> int: savings_per_week = 15 num_of_weeks = 8 total_savings = savings_per_week * num_of_weeks result = total_savings return result
In a plane, there are 7 rows of seats with an aisle in the middle of the plane. Each row has 5 seats. How many passengers can the plane transport?
def solve() -> int: rows = 7 seats_per_row = 5 total_seats = rows * seats_per_row passengers = total_seats result = passengers return result