question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: Mia traveled at 20 mph for an hour and then at 30 mph for 1.5 hours. What was her total distance traveled?
def solve() -> int: speed1 = 20 time1 = 1 speed2 = 30 time2 = 1.5 distance1 = speed1 * time1 distance2 = speed2 * time2 total_distance = distance1 + distance2 result = total_distance return result
At Avocado Avenue, avocados cost $2.50 each with a 12-avocado minimum. If Emma spent $40 on avocados, how many avocados over the minimum did she purchase?
def solve() -> int: avocado_cost = 2.50 minimum_avocados = 12 total_spent = 40 purchased_avocados = total_spent / avocado_cost avocados_over_minimum = purchased_avocados - minimum_avocados result = avocados_over_minimum return result
Ben has 4 hours of free time each day. He wants to spend 65% of his time playing chess and the rest of his time watching TV. He can watch 2 episodes per hour and each episode is 40 minutes long. How many episodes can he watch in total?
def solve() -> int: free_time = 4 chess_percentage = 0.65 tv_percentage = 1 - chess_percentage tv_time = free_time * tv_percentage episode_length = 40 episodes_per_hour = 2 total_episodes = (tv_time * 60) / episode_length * episodes_per_hour result = to...
David is building a fence around his yard. The yard is 40 feet by 50 feet and the fence costs $2 per foot. How much will David spend on the fence?
def solve() -> int: length = 40 width = 50 perimeter = 2 * (length + width) cost_per_foot = 2 total_cost = perimeter * cost_per_foot result = total_cost return result
Emma has 5 more cards than Abby. Together they have 29 cards. How many cards does Abby have?
def solve() -> int: abby_cards = (29-5)/2 result = abby_cards return result
A school bus needs 2 hours to cover a distance of 120 kilometers. How long will it take to travel the same distance going 80km/h?
def solve() -> int: distance = 120 speed = 80 time = distance / speed result = time return result
Mike wants to distribute 21 apples among a group of six people. If he wants to give each person the same amount of apples, how many apples will each person get?
def solve() -> int: apples = 21 people = 6 apples_per_person = apples // people result = apples_per_person return result
Student: A grocery store charges $0.75 for each apple. If Melissa spends $6.00 buying apples, how many apples did she buy?
def solve() -> int: apple_price = 0.75 total_spent = 6.00 num_apples = total_spent / apple_price result = int(num_apples) return result
Alex has a box with 63 pencils. He loses 12 pencils at school. How many pencils does he now have in his box?
def solve() -> int: pencils_in_box = 63 pencils_lost = 12 remaining_pencils = pencils_in_box - pencils_lost result = remaining_pencils return result
Julie is a motorcycle rider deciding how much fuel to put in her motorcycle. The empty motorcycle needs 3 gallons of fuel per mile. Each passenger on the motorcycle increases this amount by 0.5 gallons per mile. If there are 2 passengers on the motorcycle, how many gallons of fuel does the motorcycle need for a 75-mile...
def solve() -> int: empty_motorcycle_fuel_per_mile = 3 passenger_fuel_increase_per_mile = 0.5 passenger_count = 2 trip_distance = 75 total_fuel_needed = (empty_motorcycle_fuel_per_mile + passenger_fuel_increase_per_mile * passenger_count) * trip_distance result = total_fuel_needed ...
Claire goes to the bookstore to buy some books. She buys 2 $20 novels, 3 $10 cookbooks, and a $15 magazine. When she goes to pay, she only has $100 bills in her wallet. How many $100 bills does she need to use to pay?
def solve() -> int: novel_price = 20 cookbook_price = 10 magazine_price = 15 num_novels = 2 num_cookbooks = 3 num_magazines = 1 total_cost = (novel_price * num_novels) + (cookbook_price * num_cookbooks) + (magazine_price * num_magazines) num_bills = total_cost // 100 + 1 ...
Mr. Johnson is a plumber and charges his clients $120 per hour. This week, he worked for 8 hours, but had to give a discount of $10 to clients who referred him to their friends. If he gave a discount to two clients, how much did Mr. Johnson get paid?
def solve() -> int: hourly_rate = 120 hours_worked = 8 discount_per_referral = 10 number_of_referrals = 2 total_payment = hourly_rate * hours_worked - (discount_per_referral * number_of_referrals) result = total_payment return result
ome possible new questions are: In Laura's bookshelf, she has 2 more fantasy books than mystery books but three times as many mystery books as non-fiction books. If she has 20 fantasy books, how many non-fiction books does she have?
def solve() -> int: fantasy = 20 mystery = fantasy - 2 non_fiction = mystery / 3 result = non_fiction return result
Student: A restaurant bill came to $67.50. If the bill included tax at a rate of 8%, what was the cost of the meal alone (excluding tax)?
def solve() -> int: bill = 67.50 tax_rate = 0.08 tax = bill * tax_rate meal_cost = bill - tax result = meal_cost return result
The sum of two numbers is 50. If one number is increased by 5 and the other is decreased by 10, the sum becomes 45. What are the two numbers?
def solve() -> int: from sympy import symbols, solve x, y = symbols('x y') equations = [x + y - 50, x + 5 + y - 10 - 45] solutions = solve(equations) result = solutions return result
Alex is a songwriter who writes a new song every week. He has been composing for 7 years and earns $500 per song. How much money has Alex made from writing songs?
def solve() -> int: years = 7 songs_per_week = 1 weeks_per_year = 52 price_per_song = 500 total_songs = years * weeks_per_year * songs_per_week total_earnings = total_songs * price_per_song result = total_earnings return result
Student: A pizzeria opens for business with 5 large pizzas, each with 8 slices. They end up selling 3 slices from each pizza, how many slices of pizza are remaining?
def solve() -> int: num_pizzas = 5 slices_per_pizza = 8 slices_sold = 3 slices_remaining = (num_pizzas * slices_per_pizza) - (num_pizzas * slices_sold) result = slices_remaining return result
Benny has 12 toy soldiers and his friend has 3 less than half his toys. Their teacher gave them each 1 toy soldier. How many toy soldiers do they have in total?
def solve() -> int: benny_toy_soldiers = 12 friend_toy_soldiers = (benny_toy_soldiers / 2) - 3 total_toy_soldiers = benny_toy_soldiers + friend_toy_soldiers + 2 result = total_toy_soldiers return result
If Rachel had 100 dollars and she spent 1/3 on clothes and 1/4 on food, how much money does she have left?
def solve() -> int: dollars = 100 clothes = dollars * (1/3) food = dollars * (1/4) left = dollars - clothes - food result = left return result
A store bought 18 boxes of chocolates. Each box has 10 pieces of chocolates. If the store keeper gave away 3 pieces of chocolates, how many pieces of chocolates are still left?
def solve() -> int: box_num = 18 piece_num_per_box = 10 give_away = 3 result = box_num * piece_num_per_box - give_away return result
Student: Alex had 456 pieces of candy. He divided the candy into 3 parts and gave 2 parts to his family. How many pieces did they get each?
def solve() -> int: candy = 456 parts = 3 family = 2 pieces_each = candy // (parts * family) remaining_pieces = candy % (parts * family) total_pieces = pieces_each * family result = total_pieces return result
5. Adrienne needs to buy enough juice boxes to supply a party with 42 children in attendance. If every child will receive 2 juice boxes, how many juice boxes will Adrienne need to buy?
def solve() -> int: number_of_children = 42 juice_boxes_per_child = 2 total_juice_boxes = number_of_children * juice_boxes_per_child result = total_juice_boxes return result
Mary has $2500 in her bank account. She needs $1000 to pay for her rent and $750 to buy a new laptop. How much money will she have left in her account if she spends this money?
def solve() -> int: amount_in_bank_account = 2500 amount_for_rent = 1000 amount_for_laptop = 750 amount_spent = amount_for_rent + amount_for_laptop amount_left = amount_in_bank_account - amount_spent result = amount_left return result
A group of friends went to a restaurant and split the bill equally. If the total bill was $56 and there were 6 people in the group, how much money does each person need to pay?
def solve() -> int: cost_per_person = 56 / 6 result = cost_per_person return result
Mark pays $25 for 2GB of data and unlimited texting on his phone each month. An alternative phone plan would charge $0.07 per MB of data and $0.08 per text. Mark uses 3GB of data and sends 500 texts each month. How many dollars less would he pay on the alternative plan?
def solve() -> int: data_cost = 0.07 * 3000 text_cost = 0.08 * 500 total_cost = data_cost + text_cost result = 25 - total_cost return result
A store offers a 15% discount on all items. If the full price for a jacket is $80, what is the sale price?
def solve() -> int: full_price = 80 discount_perc = 0.15 discount_price = full_price * discount_perc sale_price = full_price - discount_price result = int(sale_price) return result
If Lucy weighs one-sixth times less than what Ethan weighs and Ethan weighs 190 lbs, but Megan weighs 15 lbs more than the weight of Lucy, what is the combined weight of the three?
def solve() -> int: ethan_weight = 190 lucy_weight = ethan_weight * (5/6) megan_weight = lucy_weight + 15 combined_weight = ethan_weight + lucy_weight + megan_weight result = combined_weight return result
A can of soda costs $1.50 more than a bag of chips. If a bag of chips costs $2.25, how much does a can of soda cost?
def solve() -> int: soda_cost = 2.25 + 1.50 result = soda_cost return result
A company pays its employees $2000 per month. If the company gives a 5% raise, how much do the employees earn per month after the raise?
def solve() -> int: current_salary = 2000 raise_amount = 0.05 * current_salary new_salary = current_salary + raise_amount result = new_salary return result
An office has 80 employees and they need to be divided into 4 groups. How many employees will be in each group?
def solve() -> int: num_employees = 80 num_groups = 4 employees_per_group = num_employees // num_groups result = employees_per_group return result
Noah drank 4 fewer glasses of water than of juice. He drank 12 glasses of juice and each glass has 200 ml. For the water, each glass has 150 ml. How many ml of liquid did Noah drink in total?
def solve() -> int: juice_glasses = 12 water_glasses = juice_glasses - 4 juice_ml_per_glass = 200 water_ml_per_glass = 150 juice_ml_total = juice_glasses * juice_ml_per_glass water_ml_total = water_glasses * water_ml_per_glass total_ml = juice_ml_total + water_ml_total res...
A box of crayons contains 24 crayons. If there are 5 boxes, how many crayons are there in total? Each crayon is 5 inches long. If the boxes are stacked on top of each other, what is the total height of the stack of boxes?
def solve() -> int: num_crayons = 24 * 5 total_crayons = num_crayons * 5 height_of_box = 2.5 total_height = height_of_box * 5 result = (total_crayons, total_height) return result
Ben has 40 stickers. He trades 10 stickers with his friend for 5 cards. He also buys 15 more stickers with his pocket money. How many stickers and cards does he have in total?
def solve() -> int: stickers = 40 cards = 0 stickers = stickers - 10 + 5 cards = cards + 5 stickers = stickers + 15 result = (stickers, cards) return result
Jasmine collected a total of 280 stamps. She has already given away 64 stamps. How many stamps does Jasmine have left?
def solve() -> int: total = 280 given = 64 left = total - given result = left return result
James wants to make his own candles. He has $30 for supplies and wax costs $2 per pound. If he also needs wicks for $5 and jars for $3 each, how many pounds of wax can he buy?
def solve() -> int: wax_cost = 2 wicks_cost = 5 jars_cost = 3 total_budget = 30 total_cost_wicks_jars = wicks_cost + jars_cost remaining_budget = total_budget - total_cost_wicks_jars max_wax_pounds = remaining_budget // wax_cost result = max_wax_pounds return resu...
Student: 1. Victor wants to have a square carpet with an area of 132 square feet in his bedroom. How many feet long is each side of the carpet?
def solve() -> int: area = 132 side_length = area ** 0.5 result = side_length return result
-Don't repeat questions or solutions Possible questions and programs: Betty loves to bake and decorate cakes. She needs 3 boxes of cake mix, 2 cans of frosting, 4 packs of sprinkles, and 1 pack of candles for each cake she makes. The cake mix costs $3 per box, the frosting costs $4 per can, the sprinkles cost $2 per pa...
def solve() -> int: cake_mix_cost = 3 * 3 frosting_cost = 2 * 4 sprinkles_cost = 4 * 2 candles_cost = 1 one_cake_cost = cake_mix_cost + frosting_cost + sprinkles_cost + candles_cost five_cakes_cost = one_cake_cost * 5 result = five_cakes_cost return result
11 years ago, a business owner was five times as old as her employee. If the business owner is 65 years old now, how old will the employee be in 8 years?
def solve() -> int: business_owner_age_now = 65 years_ago = 11 employee_age_years_ago = (business_owner_age_now - years_ago) / 5 employee_age_in_8_years = employee_age_years_ago + 8 result = employee_age_in_8_years return result
A cell phone plan costs $30 per month for unlimited texting and $0.05 per minute for calls. If Sarah's bill for the month was $45.60 and she didn't send any texts, how many minutes did she spend on calls?
def solve() -> int: texting_cost_per_month = 30 call_cost_per_minute = 0.05 total_cost_for_month = 45.60 minutes_on_calls = (total_cost_for_month - texting_cost_per_month) / call_cost_per_minute result = minutes_on_calls return result
``` A gym bought 30 treadmills and 20 exercise bikes for $7100. If a treadmill costs $200, how much does an exercise bike cost?
def solve() -> int: num_treadmills = 30 num_bikes = 20 total_cost = 7100 cost_per_treadmill = 200 cost_of_treadmills = num_treadmills * cost_per_treadmill cost_of_bikes = total_cost - cost_of_treadmills cost_per_bike = cost_of_bikes / num_bikes result = cost_per_bike return result
Jane drove 100 miles on the highway, getting 20 miles per gallon. Then, she drove 25 miles on city roads, getting 15 miles per gallon. How much gas did Jane have to buy, if the price of gas is $2.50 per gallon?
def solve() -> int: miles_on_highway = 100 miles_on_city_roads = 25 mileage_on_highway = 20 mileage_on_city_roads = 15 price_per_gallon = 2.50 total_gallons = (miles_on_highway / mileage_on_highway) + (miles_on_city_roads / mileage_on_city_roads) total_cost_of_gas = total_gallons * price_per...
A flower shop usually sells 80 roses and 60 lilies per day. Today, they sold 70 roses and 70 lilies. If roses are sold for $2.50 and lilies are sold for $3, what is the difference between the flower shop's daily average and their sales for today?
def solve() -> int: roses_per_day = 80 lilies_per_day = 60 roses_sold_today = 70 lilies_sold_today = 70 rose_price = 2.50 lily_price = 3 daily_average_sales = (roses_per_day * rose_price) + (lilies_per_day * lily_price) sales_today = (roses_sold_today * rose_price) + (lilies_so...
A recipe calls for 3 cups of flour to make 12 cookies. If you want to make 36 cookies, how many cups of flour do you need?
def solve() -> int: cookies = 36 ratio = cookies/12 flour = 3*ratio result = flour return result
An outlet offers a 30% discount on all its items. If the original price of a dress is $250, what is the discounted price?
def solve() -> int: original_price = 250 discount_percent = 0.3 discounted_price = original_price - (original_price * discount_percent) result = discounted_price return result
andy scored 8 3-point goals and 15 2-point goals. If her team scored 120 points overall, what percentage of the team's total points did Sandy score?
def solve() -> int: total_points = 120 sandy_3_points = 8 * 3 sandy_2_points = 15 * 2 sandy_total_points = sandy_3_points + sandy_2_points percentage = sandy_total_points/total_points * 100 result = percentage return result
The area of a rectangle is 30 square meters. If the length is 5 meters, what is the width?
def solve() -> int: area = 30 length = 5 width = area/length result = width return result
Emily needs to buy 5 notebooks for school. Each notebook costs $2.75. How much money will she need to buy all 5 notebooks?
def solve() -> int: Notebook_cost = 2.75 Number_of_Notebooks = 5 Total_cost = Notebook_cost * Number_of_Notebooks result = Total_cost return result
Tom buys a pizza for $15. If he wants to leave a 15% tip, how much will he end up paying?
def solve() -> int: cost_of_pizza = 15 tip_percentage = 15 tip_amount = cost_of_pizza * (tip_percentage/100) total_cost = cost_of_pizza + tip_amount result = total_cost return result
A recipe calls for 3/4 cup of flour per cake. If you want to make 8 cakes, how many cups of flour do you need?
def solve() -> int: flour_per_cake = 3/4 num_cakes = 8 total_flour = flour_per_cake * num_cakes result = total_flour return result
Eve walks 5 miles and then jogs 8 miles. If she runs for 3 times the number of miles she walked, how many miles has she traveled?
def solve() -> int: distance_walked = 5 distance_jogged = 8 distance_ran = 3 * distance_walked result = distance_walked + distance_jogged + distance_ran return result
John has $80. He spends one third of the money. How much money does John have left?
def solve() -> int: total_money = 80 spent_money = total_money / 3 money_left = total_money - spent_money result = money_left return result
A cyclist drives 50 km/h from city A to city B, and then returns at 60 km/h. What is his average speed over the entire trip?
def solve() -> int: distance = 2 * 50 time = distance/((1/50) + (1/60)) average_speed = distance/time result = average_speed return result
A university has 2000 students. If 50% of the students are undergraduate or graduate students, and 1/8 of undergraduate and graduate students study computer science, how many undergraduate and graduate students do not study computer science?
def solve() -> int: students = 2000 undergraduate_and_graduate_students = students * 0.5 computer_science_students = undergraduate_and_graduate_students * (1/8) non_computer_science_students = undergraduate_and_graduate_students - computer_science_students result = non_computer_science_students...
A car rental company has a fleet of 200 vehicles. 50% of them are sedans, 30% are SUVs, and the rest are trucks. If there are 20 trucks in the fleet, how many sedans are there?
def solve() -> int: sedans = 200 * 0.5 trucks = 20 suv_trucks = 200 - sedans suv = suv_trucks * 0.3 sedans_remaining = 200 - suv - trucks result = sedans_remaining return result
Amanda needs to drive 9 miles to her yoga class, 12 miles to her son's school to pick him up, and 7 miles to drop off her dry cleaning. She then needs to drive twice the distance she traveled to her yoga class to get back home. If Amanda's car gets 32 miles per gallon and gas costs $2.35, how much will she spend on gas...
def solve() -> int: yoga_distance = 9 school_distance = 12 cleaning_distance = 7 total_distance = yoga_distance + school_distance + cleaning_distance + (2 * yoga_distance) miles_per_gallon = 32 gas_cost = 2.35 gallons_needed = total_distance / miles_per_gallon total_cost = gallons_needed...
Student: Emma folded a rectangular paper that is 10 inches wide. She folded it in half along the width, and then folded it again in half along the length. What is the area of the folded paper?
def solve() -> int: width = 10 length = width * 2 folded_length = length / 2 folded_width = width / 2 area = folded_length * folded_width result = area return result
At a shop, each chicken costs $2 and each steak costs $3. Jordan bought 15 chicken and steaks and paid $45. How many steaks did he buy?
def solve() -> int: total_in_units = 15 total_cost = 45 cost_per_chicken = 2 cost_per_steak = 3 total_cost_for_chicken = total_in_units * cost_per_chicken remaining_cost = total_cost - total_cost_for_chicken number_of_steaks = remaining_cost // cost_per_steak result = numb...
Student: A triangular pyramid has a base with sides of length 6, 8, and 10 feet. The height of the pyramid is 12 feet. What is the volume of the pyramid in cubic feet?
def solve() -> int: base_side1 = 6 base_side2 = 8 base_side3 = 10 height = 12 s = (base_side1 + base_side2 + base_side3) / 2 base_area = (s * (s - base_side1) * (s - base_side2) * (s - base_side3)) ** 0.5 volume = (base_area * height) / 3 result = volume return result
Sam is folding origami cranes for a project. He has 25 sheets of paper, each of which can be cut into four equal squares. He needs three squares of paper for each crane, and he wants to make as many cranes as possible. How many cranes can he make, and how many squares of paper will he have left over?
def solve() -> int: sheets = 25 squares = 4 * sheets cranes = squares // 3 leftover = squares % 3 result = (cranes, leftover) return result
Jake collected 5 more than four times as many stamps as Lucy. Mia collected one fourth as many as Jake. Lucy collected 12 stamps. How many did Mia collect?
def solve() -> int: lucy = 12 jake = 5 + 4 * lucy mia = jake / 4 result = mia return result
Lisa picked half of the apples from the orchard which had 200 trees. If she picked from only 150 trees, how many apples would she get?
def solve() -> int: total_trees = 200 picked_trees = 150 total_apples = total_trees * 0.5 apples_per_tree = total_apples / total_trees apples_from_150_trees = apples_per_tree * picked_trees result = apples_from_150_trees return result
If a boat can sail 6 miles in an hour with a wind current and 4 miles in an hour against it. What is the speed of the boat in still water?
def solve() -> int: distance_with_current = 6 distance_against_current = 4 time_with_current = 1 time_against_current = 1 boat_speed_in_still_water = (distance_with_current+distance_against_current)/(time_with_current+time_against_current) result = boat_speed_in_still_water return result
Alex buys 5 packs of gummy bears, and each pack contains 150 gummy bears. If the total number of gummy bears Alex bought is equal to the number of minutes he spends exercising every day, how many minutes does Alex exercise?
def solve() -> int: num_packs = 5 gummy_per_pack = 150 total_gummy = num_packs * gummy_per_pack minutes_exercising = total_gummy result = minutes_exercising return result
John is taking iron supplements to improve his blood health. He takes 200 mg of the supplement every 24 hours for a month. If each capsule contains 50 mg, how many capsules will John take in total?
def solve() -> int: daily_dose = 200 days_in_month = 30 monthly_dose = daily_dose * days_in_month capsule_dose = 50 total_capsules = monthly_dose / capsule_dose result = total_capsules return result
A rectangular pool is twice as long as it is wide. It has a width of 6 meters. How long is the pool?
def solve() -> int: width = 6 length = 2*width result = length return result
A stadium can hold 50,000 people. If there are 20,000 seats and the rest are standing room only, how many people can stand in the stadium?
def solve() -> int: total = 50000 seats = 20000 standing_room = total - seats result = standing_room return result
Lisa wants to buy a jacket that costs $80. She has $35 in cash and the rest she will pay with her credit card. If her credit card has a 10% interest rate, how much will she end up paying for the jacket including the interest?
def solve() -> int: cash = 35 price = 80 credit_card = price - cash interest_rate = 0.1 total_interest = credit_card * interest_rate total_price = price + total_interest result = total_price return result
A rectangle has a length of 12 feet and a width of 8 feet. What is the perimeter of the rectangle?
def solve() -> int: length = 12 width = 8 perimeter = 2 * (length + width) result = perimeter return result
Lily has 16 cookies. She ate a quarter of them, then she baked 12 more cookies. How many cookies does Lily have now?
def solve() -> int: cookies_eaten = 16 / 4 cookies_left = 16 - cookies_eaten cookies_total = cookies_left + 12 result = cookies_total return result
arah is making cupcakes. She has 18 egg whites and a cupcake recipe that calls for 1 egg white for each cupcake. How many cupcakes can Sarah make?
def solve() -> int: totaleggwhites = 18 eggwhites_per_cupcake = 1 numberofcupcakes = totaleggwhites / eggwhites_per_cupcake result = numberofcupcakes return result
In a certain neighborhood, 5/8 of the houses have pets, and 3/4 of the houses are rented. If there are 200 houses, what percent of the houses that are owned do not have pets?
def solve() -> int: num_house = 200 num_pet = num_house * 5/8 num_rented = num_house * 3/4 num_owned = num_house - num_rented num_owned_no_pet = num_owned - num_pet * (num_owned / num_house) percent_owned_no_pet = (num_owned_no_pet / num_owned) * 100 result = percent_owned_no_pet return...
During his morning jog, Robert noticed that the distance he travels in a square is the same as the distance he runs when he follows the circumference of a circle. If the area of the square is 25 and the radius of the circle is 5, how far did Robert run around the circle?
def solve() -> int: area_square = 25 radius_circle = 5 side_square = area_square ** 0.5 circumference_circle = 2 * 3.14 * radius_circle distance_run = circumference_circle result = distance_run return result
A container can hold 400 liters of water. There are two taps and the first tap can fill the container in 10 minutes, while the second tap can empty the container in 5 minutes. If both taps are open at the same time, how long will it take to fill the container?
def solve() -> int: tank_capacity = 400 fill_rate = 1/(10*60) empty_rate = 1/(5*60) total_fill_rate = fill_rate - empty_rate time = tank_capacity / total_fill_rate result = time return result
A school has 240 students in grade 6. The students are divided into four groups: A, B, C, and D. Group A has 1/6 of the students, group B has 1/4 of the students, group C has 5/12 of the students, and group D has the rest of the students. How many students are in group D?
def solve() -> int: total = 240 group_a = total // 6 group_b = total // 4 group_c = total * 5 // 12 group_d = total - group_a - group_b - group_c result = group_d return result
A board game costs $35. If a toy store offers a 20% discount, how much will the game cost after the discount?
def solve() -> int: discount = 0.20 cost_after_discount = 35 - (35 * discount) result = cost_after_discount return result
A clothing store has 540 shirts. After a major sale, they now only have 3 fifths of the original amount. How many shirts did they sell?
def solve() -> int: shirts = 540 sold_shirts = shirts - (shirts * 3 / 5) result = sold_shirts return result
A water tank is filled with 70 liters less than half the amount of water in a larger tank. If the smaller tank has 120 liters of water, how many liters of water are in the larger tank?
def solve() -> int: smaller_tank = 120 larger_tank = (smaller_tank + 70) * 2 result = larger_tank return result
During a sale, a store is offering a discount of 20% on all items. Mia bought a t-shirt for $10, a pair of shorts for $20 and a pair of shoes for $40. How much did she pay for everything after the discount?
def solve() -> int: cost_tshirt = 10 cost_shorts = 20 cost_shoes = 40 discount = 0.2 total_cost = cost_tshirt + cost_shorts + cost_shoes discount_amount = total_cost * discount total_cost_discounted = total_cost - discount_amount result = total_cost_discounted return result
The capacity of a water tank is 865 liters. If 184 liters of water has already been filled, and another 376 liters of water is added, how much more water is needed to fill it completely?
def solve() -> int: tank_capacity = 865 water_filled = 184 water_added = 376 water_needed = tank_capacity - (water_filled + water_added) result = water_needed return result
On world music day, two fifths of the students in the auditorium played musical instruments. Of those students who played musical instruments, one third played the piano. There were five times as many students who played the guitar as those who played the piano. If 200 students were in the auditorium that day, how many...
def solve() -> int: instrument_students = (2 / 5) * 200 piano_students = (1 / 3) * instrument_students guitar_students = 5 * piano_students guitar_students = round(guitar_students) result = guitar_students return result
At a restaurant, 8 people each purchased a sandwich for $8 and a drink for $2. How much did it cost in total?
def solve() -> int: sandwichCost = 8 numPeople = 8 drinkCost = 2 totalCost = (sandwichCost+drinkCost)*numPeople result = totalCost return result
am has 3 bottles of lime soda and 8 bottles of orange soda in his fridge. His friend Jenn has 5 bottles of lime soda and 6 bottles of orange soda in her fridge. If the amount of beverage in each bottle is 4 liters, how many more liters of soda does Sam have?
def solve() -> int: samLiters = 3*4 + 8*4 jennLiters = 5*4 + 6*4 result = samLiters - jennLiters return result
A restaurant serves 247 customers during a day. If every customer orders 3 drinks and a drink costs $4.99, calculate the total revenue the restaurant makes in a day.
def solve() -> int: no_of_customers = 247 no_of_drinks_per_customer = 3 drink_cost = 4.99 total_revenue = no_of_customers * no_of_drinks_per_customer * drink_cost result = round(total_revenue, 2) return result
Student: Susan has 15 cupcakes and wants to decorate them. She can buy frosting for $3 per container and sprinkles for $2 per container. If each cupcake needs 1 container of frosting and 1 container of sprinkles, how much will it cost to decorate Susan's cupcakes?
def solve() -> int: num_cupcakes = 15 price_frosting = 3 price_sprinkles = 2 num_frosting = num_cupcakes num_sprinkles = num_cupcakes cost_frosting = num_frosting * price_frosting cost_sprinkles = num_sprinkles * price_sprinkles result = cost_frosting + cost_sprinkles return result
Jennifer wants to buy a new camera for $900 and a tripod for $150. To get the money, she sold her old camera for $600 after giving a 20% discount on its original worth. How much more money does Jennifer need to cover the full cost?
def solve() -> int: old_camera_original_worth = 750 discount = 0.2 old_camera_selling_price = old_camera_original_worth * (1 - discount) total_cost = 900 + 150 money_needed = total_cost - old_camera_selling_price result = money_needed return result
Jamie can run 1 mile in 8 minutes. How many miles can he run in 36 minutes?
def solve() -> int: time_to_run_1_mile = 8 total_time = 36 distance = int(total_time / time_to_run_1_mile) result = distance return result
A gas station offers 2 types of gasoline: regular and premium. One day, they sold 600 gallons of gas for a total of $2000. The price of regular gas is $3 per gallon and the price of premium gas is $4 per gallon. How much regular gas was sold that day?
def solve() -> int: result = None num_regular = None num_premium = None total_volume = 600 total_sales = 2000 num_premium = None num_regular = None return result
Sara goes to the shop and buys a packet of candy for $5.50. She gives the cashier $10.00. How much change should Sara get?
def solve() -> int: payment = 10.00 cost = 5.50 change = payment - cost result = change return result
Ava and Liam's grandfather is named Thomas. If Ava has double the number of children that Liam has and Thomas has 14 grandkids, how many children does Liam have?
def solve() -> int: x = 14 / 3 liam_children = x result = liam_children return result
9. There are 24 students in a PE class. The teacher gives each student a football. She then divides them into 3 groups, and notices that the groups are not of equal size. How many students will be in the biggest group?
def solve() -> int: students = 24 groups = 3 largest_group = students // groups + (students % groups) result = largest_group return result
Zoey owns a boutique and sells dresses for $50 each. It costs her $25 to make each dress. Zoey pays $3000 for monthly rent, 10% of her total profit in taxes, and $500 each to five workers. If Zoey sells 50 dresses in one month, what is her total profit or loss?
def solve() -> int: dresses_sold = 50 cost_per_dress = 25 price_per_dress = 50 monthly_rent = 3000 tax_percentage = 0.1 workers_salary = 500 number_of_workers = 5 total_cost = dresses_sold * cost_per_dress total_revenue = dresses_sold * price_per_dress total_salary = workers...
Alex spends $13 on lunch every day for 5 days. On the last day, he decides to buy a dessert for $4. How much money did he spend on lunch and dessert combined for the week?
def solve() -> int: cost_lunch = 13 * 5 cost_dessert = 4 total_cost = cost_lunch + cost_dessert result = total_cost return result
``` A restaurant has a total of 98 seats and they will have 7 seating arrangements. If each seating arrangement will have the same number of seats, how many seats should each arrangement have?
def solve() -> int: n_seats = 98 n_arrangements = 7 seats_per_arrangement = n_seats // n_arrangements result = seats_per_arrangement return result
Adam starts his journey with 10 push-ups and he plans to increase the number of push-ups every three days. If he needs to reach 80 push-ups, how long will it take?
def solve() -> int: days = 0 reps = 10 while reps < 80: reps += 10 days += 3 result = days return result
``` A recipe calls for 2/3 cup of sugar to make 8 muffins. How much sugar is needed for 14 muffins?
def solve() -> int: cups_sugar = (2/3)/8 sugar_needed = cups_sugar*14 result = sugar_needed return result
Chloe baked 85 cupcakes for the school fundraiser. Her classmate, Max, baked 26 fewer cupcakes. How many cupcakes did they bake altogether?
def solve() -> int: cupcakes_baked_by_chloe = 85 cupcakes_baked_by_max = cupcakes_baked_by_chloe - 26 total_cupcakes = cupcakes_baked_by_chloe + cupcakes_baked_by_max result = total_cupcakes return result
John has a garden in the shape of a square with an area of 196 square meters. What is the length of one side of the garden?
def solve() -> int: area = 196 side = pow(area, 0.5) result = side return result
Leo has eight $5 bills and half as many $10 bills as $5 bills. He also has two $50 bills. How much money does Leo have in all?
def solve() -> int: bills_5 = 8 bills_10 = bills_5 / 2 bills_50 = 2 money_5 = bills_5 * 5 money_10 = bills_10 * 10 money_50 = bills_50 * 50 money = money_5 + money_10 + money_50 result = money return result
Answer: There were 120 boxes of candy and 8% of the candy needed to be removed. How many boxes of candy still remain?
def solve() -> int: candy = 120 remove_percent = 8 removed_candy = candy * remove_percent/100 remaining_candy = candy - removed_candy result = remaining_candy return result
A bus driver drove for 4 hours at a speed of 60 miles per hour and then took a rest for 1 hour. He drove again at a speed of 50 miles per hour for another 3 hours. How far did he travel in total?
def solve() -> int: dist_1 = 4 * 60 dist_2 = 3 * 50 total_dist = dist_1 + dist_2 result = total_dist return result