question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Joe has a bag that can hold 20 items. Joe has put 3 items inside the bag. How many more items can Joe add to the bag?
def solve() -> int: total = 0 total = 20 - 3 result = total return result
If David has 40 crayons and puts 4 crayons in each box, how many more boxes does he need to have 100 boxes of crayons?
def solve() -> int: crayons = 40 crayons_per_box = 4 total_boxes = 100 crayons_needed = total_boxes * crayons_per_box - crayons boxes_needed = crayons_needed / crayons_per_box result = boxes_needed return result
``` If a rectangle has a length of 8 cm and a width of 4 cm, what is the area of the rectangle?
def solve() -> int: length = 8 width = 4 area = length * width result = area return result
8. Irina is making a cake for a party and has 2 quarts of blueberries to put on top. If 1 quart is equal to 1.1 liters, how much blueberry topping, in liters, will she need?
def solve() -> int: total_blueberry_quarts = 2 quart_to_liter = 1.1 total_liters = total_blueberry_quarts * quart_to_liter result = total_liters return result
Jake is 10 years old. His brother is 3 years older and his sister is 2 years younger than his brother. How old was Jake when his sister was born?
def solve() -> int: jake = 10 brother = jake + 3 sister = brother - 2 jake_when_sister_born = jake - sister result = jake_when_sister_born return result
A grocery store had varying numbers of customers every hour for a day. There were 40 customers on the first hour, 55 on the second hour, 30 on the third hour, 75 on the fourth hour, 20 on the fifth hour, 100 on the sixth hour, and 50 on the last hour. What was the average number of customers per hour for that day?
def solve() -> int: first_hour = 40 second_hour = 55 third_hour = 30 fourth_hour = 75 fifth_hour = 20 sixth_hour = 100 last_hour = 50 total_customers = first_hour + second_hour + third_hour + fourth_hour + fifth_hour + sixth_hour + last_hour average_customers = total_customers /...
James has bought 3 items costing $10, $15, and $20 respectively. What is the average cost of these 3 items?
def solve() -> int: cost1 = 10 cost2 = 15 cost3 = 20 total_cost = cost1 + cost2 + cost3 average_cost = total_cost / 3 result = average_cost return result
Possible math questions and programs are: Mary sells handmade bracelets for $8 each. The cost of materials and labor for each bracelet is $4.5. She sells 25 bracelets in a week. What is her profit for the week?
def solve() -> int: profit_per_bracelet = 8 - 4.5 total_profit = profit_per_bracelet * 25 result = total_profit return result
If Sheri has 4 more awards than Shana, and Shana has 12 awards, how many total awards do they have?
def solve() -> int: num_awards_shana = 12 num_awards_sheri = num_awards_shana + 4 total_awards = num_awards_shana + num_awards_sheri result = total_awards return result
Liam and Olivia are walking in a park that is 500 meters long. If the park's length decreases from this end uniformly by 5 meters every 50 meters along, and they walk at a speed of 2 m/s, how long (in seconds) will it take them to get to the point where the park is 300 meters long?
def solve() -> int: park_length = 500 decrease_rate = 5 distance_left = park_length - 300 distance_per_decrease = 50 total_decreases = distance_left // distance_per_decrease total_distance_decreased = total_decreases * decrease_rate total_distance_left = distance_left % distance_per_decrease...
A rental car company charges $24.99 per day for each rental car. It also charges $. 20 for each mile driven. How much does the customer need to pay if they rented 4 cars for 5 days each, and drove an average of 150 miles per day per car (round to two decimal places)?
def solve() -> int: num_cars = 4 rental_days = 5 mileage = 150 rental_rate_per_day = 24.99 mileage_rate_per_mile = 0.20 total_rental_cost = num_cars * rental_days * rental_rate_per_day total_mileage_cost = num_cars * rental_days * mileage * mileage_rate_per_mile total_cost = total_rental...
A baker made 4/7 of a cake. He sold 1/3 of his cake for $12 and 1/5 of his cake for $8. What is the price of the entire cake?
def solve() -> int: z = 20 * 15 / 8 result = z return result
Here are some possible questions and programs: Ruben is making a collage with magazine cutouts of his favorite celebrities. He has a rectangular poster board that is 60 cm by 40 cm. He wants to cover the entire board with square pictures that are 4 cm by 4 cm. How many pictures does he need?
def solve() -> int: poster_area = 60 * 40 picture_area = 4 * 4 number_of_pictures = poster_area // picture_area result = number_of_pictures return result
Alice has 24 stickers. She gives 8 stickers to Bob and 4 stickers to Charlie. How many stickers does she have left?
def solve() -> int: stickers = 24 bob = 8 charlie = 4 giveaway = bob + charlie left = stickers - giveaway result = left return result
Carla works at a bakery and buys a dozen cupcakes for $12. She sells them for $20 a dozen and has to pay a sales tax of 8%. How much profit did Carla make if she sold one dozen cupcakes to a customer?
def solve() -> int: cost_price = 12 selling_price = 20 sales_tax = 8/100 profit = (selling_price - cost_price) * (1 - sales_tax) result = profit return result
A local electronics store is selling a laptop for $899 and a monitor for $129. Sally has a coupon for 10% off her entire purchase, and she has $500 in cash. How much more money does Sally need to buy both items?
def solve() -> int: laptop_price = 899 monitor_price = 129 discount = 0.1 cash = 500 total_price = laptop_price + monitor_price discount_amount = total_price * discount subtotal = total_price - discount_amount remaining = subtotal - cash result = remaining return result
Student: Jesse can design a logo in 3 minutes. How many minutes will it take him to design 15 logos?
def solve() -> int: time_per_logo = 3 total_time = time_per_logo * 15 result = total_time return result
Alex is organizing a party. He has 15 friends coming over and he wants to serve them pizza. Each pizza has 8 slices. If each person eats 2 slices, how many pizzas should Alex order?
def solve() -> int: pizza_slices = 15 * 2 number_of_pizzas = pizza_slices / 8 result = number_of_pizzas return result
Terry has $500 to invest. He earns 5% interest on the money for the first year and 7% for the second year. How much money did Terry earn after 2 years?
def solve() -> int: amount = 500 interest_1 = 0.05 interest_2 = 0.07 interest_earned_1 = amount*interest_1 amount_2 = amount + interest_earned_1 interest_earned_2 = amount_2*interest_2 result = interest_earned_1 + interest_earned_2 return result
A company manufactures a product for $5 and sells it for $10. They pay $2 for shipping and $1 in taxes for each product they sell. If they want to make a profit of $500, how many products do they need to sell?
def solve() -> int: product_cost = 5 shipping_per_product = 2 tax_per_product = 1 profit_goal = 500 product_price = 10 profit_per_product = product_price - product_cost - shipping_per_product - tax_per_product products_needed = profit_goal / profit_per_product result = pro...
Bill is running a marathon. He has run 15 km and has 7 km left. If he runs at a pace of 5 minutes per km. How long does he have left to finish the race in terms of hours and minutes?
def solve() -> int: distance_left = 7 pace = 5 time_left = distance_left * pace hours = time_left // 60 minutes = time_left % 60 result = (hours, minutes) return result
A basketball team won 12 out of their 20 games this season. What percentage of the games did they win?
def solve() -> int: total_games = 20 games_won = 12 win_percentage = games_won * 100 / total_games result = win_percentage return result
Casey and his family drove 1,248 miles on their last family trip. If their car can go 310 miles with a full tank of gas, how many full tanks of gas did they use?
def solve() -> int: total_miles = 1248 miles_per_tank = 310 number_of_tanks = total_miles / miles_per_tank result = number_of_tanks return result
Omar is distributing pencils to the students in his classroom. He has 72 pencils in a box. In the morning, each of the 18 students gets 2 pencils. At the end of the day, each student gets one more pencil. How many pencils are left in Omar's box?
def solve() -> int: box_pencils = 72 num_students = 18 morning_pencils = 2 evening_pencils = 1 morning_distribution = num_students * morning_pencils evening_distribution = num_students * evening_pencils total_distribution = morning_distribution + evening_distribution ...
Student: Sarah has $500 and wants to buy a laptop that costs $800. Every week she earns $50. How long will it take her to save enough money to buy the laptop?
def solve() -> int: initial_amount = 500 cost_of_laptop = 800 weekly_earnings = 50 amount_to_save = cost_of_laptop - initial_amount number_of_weeks = amount_to_save / weekly_earnings result = number_of_weeks return result
At a party, order was placed for 7 pizzas for $12 each, 4 soft drinks for $2 each and 3 salads for $5 each. How much was the total cost, in dollars?
def solve() -> int: pizzas = 7 soft_drinks = 4 salads = 3 cost_pizzas = 12 cost_soft_drinks = 2 cost_salads = 5 pizzas_cost = pizzas * cost_pizzas soft_drinks_cost = soft_drinks * cost_soft_drinks salads_cost = salads * cost_salads total_cost = pizzas_cost + soft_...
There were 25 balloons left in a box after Kelly took out 15 of them. Her friend brings over half the number of balloons she originally had. Kelly adds them all to the box and they decide to divide them equally. How many balloons did Kelly's friend bring over and how many did Kelly have left after taking 7 of them?
def solve() -> int: balloons_left = 25 balloons_taken = 15 balloons_original = balloons_left + balloons_taken friend_balloons = balloons_original / 2 total_balloons = balloons_left + friend_balloons balloons_left = total_balloons % 2 result = (friend_balloons, balloons_left) ...
Alice has 25 oranges and she gave away 5 oranges to her brother. How many oranges does she have left?
def solve() -> int: oranges = 25 oranges_giveaway = 5 oranges_left = oranges - oranges_giveaway result = oranges_left return result
Jill is baking cookies and has 4 trays. Each tray can hold 24 cookies. If she can only bake 66 cookies, how many trays does she need?
def solve() -> int: trays = 4 cookies_per_tray = 24 total_cookies = 66 trays_needed = total_cookies / cookies_per_tray result = trays_needed return result
Tyler studies Spanish for 20 minutes every morning and 30 minutes every evening. How many hours does he spend studying Spanish in a week?
def solve() -> int: morning_minutes = 20 evening_minutes = 30 minutes_per_day = morning_minutes + evening_minutes minutes_per_week = minutes_per_day * 7 hours_per_week = minutes_per_week / 60 result = hours_per_week return result
There are 3 times as many cats as dogs in a pet store. If there are 12 cats, how many dogs are there?
def solve() -> int: c = 12 d = c/3 result = d return result
Chris is going on a field trip that requires a fee of $75 for each student. There are 15 students in his class, how much money is needed for the whole trip?
def solve() -> int: trip_fee_per_student = 75 number_of_students = 15 total_trip_fee = trip_fee_per_student * number_of_students result = total_trip_fee return result
Rachel has 3 times as many candies as Emily. Emily has 8 fewer candies than Jack. If Jack has 15 candies, how many candies does Rachel have?
def solve() -> int: jack_candies = 15 emily_candies = jack_candies - 8 rachel_candies = 3*emily_candies result = rachel_candies return result
A park ranger drives an average of 30 miles per hour to patrol a forest. If he has to travel a total of 120 miles, how long does it take him to complete his patrol?
def solve() -> int: time = 120 / 30 result = time return result
am is 15 years old. His best friend, Reese, is 7 years older. Emily is 5 years younger than Reese. How many years younger is Sam than Emily?
def solve() -> int: samAge = 15 reeseAge = samAge + 7 emilyAge = reeseAge - 5 result = emilyAge - samAge return result
A company decides to give a 15% bonus to each employee's salary. After receiving the bonus, the employees decide to donate 10% of their new salary to charity. If an employee's original salary was $50,000, what is their new salary?
def solve() -> int: old_salary = 50000 bonus = old_salary * 0.15 new_salary = old_salary + bonus charity_donation = new_salary * 0.1 final_salary = new_salary - charity_donation result = final_salary return result
Evan has 7 more pairs of jeans than he has t-shirts, 4x as many sweatshirts as shorts, and a number of hats equal to twice the number of sweatshirts. If Evan has 12 shorts, how many pieces of clothing does he have in total?
def solve() -> int: shorts = 12 jeans = shorts + 7 sweatshirts = shorts * 4 hats = sweatshirts * 2 result = shorts + jeans + sweatshirts + hats return result
Student: Kevin studies for 1 hour on weekdays and 2 hours on weekends. How many hours does Kevin study in 9 weeks?
def solve() -> int: weekday_hours = 1 weekend_hours = 2 weeks = 9 total_hours = (weeks * 5 * weekday_hours) + (weeks * 2 * weekend_hours) result = total_hours return result
George had 36 marbles in a jar. He gave away 5 marbles and gave another 4 marbles to his sister. How many marbles are left in the jar?
def solve() -> int: marbles_total = 36 marbles_given_away = 5 marbles_given_away_sister = 4 marbles_left = marbles_total - marbles_given_away - marbles_given_away_sister result = marbles_left return result
Student: Adeline has been saving $2 every day for 30 days. On the 31st day, she decides to withdraw $10 from her savings. How much money does Adeline have in total now?
def solve() -> int: days = 30 daily_saving = 2 withdrawal = 10 total_savings = days * daily_saving total_money = total_savings - withdrawal result = total_money return result
David is planning a road trip that is 900 miles long. He drives 300 miles per day for the first three days. After that, he drives 150 miles per day. How many days before he needs to be back home does he need to start the trip to finish on time if he has a total of 7 days for the trip?
def solve() -> int: total_distance = 900 first_three_days_distance = 300 * 3 remaining_distance = total_distance - first_three_days_distance remaining_days = 7 - 3 distance_per_day = 150 required_days = remaining_distance / distance_per_day total_days = required_days + remaining_days res...
A car can travel 400km with 30 litres of petrol. How much petrol will it require to travel 250km?
def solve() -> int: distance_1 = 400 petrol_1 = 30 distance_2 = 250 petrol_2 = (petrol_1 * distance_2) / distance_1 result = petrol_2 return result
Possible questions and programs: Benjamin ran 3.2 km every morning in June. He increased his distance by 10% in July and ran the same amount every morning. How much farther did Benjamin run in July than in June?
def solve() -> int: distance_june = 3.2 * 30 distance_july = 3.2 * 1.1 * 31 difference = distance_july - distance_june result = difference return result
A coffee shop sells small coffees for $2 each and large coffees for $4 each. In one day they sell 50 small coffees and 30 large coffees. What is the total amount of money they make in one day?
def solve() -> int: coffee_shop_income = (50 * 2) + (30 * 4) result = coffee_shop_income return result
A group of friends went out for dinner. They ordered two appetizers that cost $8 each. Each of their entrees was $15.00 and they shared two desserts that were $7 each. If they left a 20% tip, what was the entire price of the meal?
def solve() -> int: appetizers = 2 * 8 entrees = 15 * 4 desserts = 2 * 7 subtotal = appetizers + entrees + desserts tip = 0.2 * subtotal total = subtotal + tip result = total return result
Student: Chris has 3 buckets, 2 buckets weigh 2kg, 1 weighs 4kg. The average weight of the buckets is 2.6kg. How much does the one bucket weigh, in kg?
def solve() -> int: bucket1 = 2 bucket2 = 2 bucket3 = 0 total_weight = bucket1 + bucket2 + bucket3 average_weight = total_weight / 3 bucket3 = average_weight * 3 - total_weight result = bucket3 return result
Olivia goes to the clothing store and buys 3 shirts for $15 each. She then buys 2 pairs of jeans that cost $30 each. She spent 2/5 of the money she earned from tutoring. If she charges $20 per hour of tutoring, how many hours did she tutor?
def solve() -> int: num_shirts = 3 shirt_price = 15 num_jeans = 2 jeans_price = 30 fraction_spent = 2/5 total_spent = num_shirts * shirt_price + num_jeans * jeans_price total_earned = total_spent / fraction_spent hourly_rate = 20 num_hours = total_earned / hourly_rate ...
James walked 2/5 of a mile each day for 8 days. Sophie walked 1/4 of a mile each day for 12 days. How far did they walk altogether?
def solve() -> int: james_distance_per_day = 2/5 sophie_distance_per_day = 1/4 james_days = 8 sophie_days = 12 james_total_distance = james_distance_per_day * james_days sophie_total_distance = sophie_distance_per_day * sophie_days total_distance = james_total_distance + sophi...
Student: There are 18 boxes of apples. Each box contains 14 apples. How many apples are there total?
def solve() -> int: box_num = 18 apples_per_box = 14 total_apples = box_num * apples_per_box result = total_apples return result
arah has stored away $2000. She puts $500 per month in the account. After 6 months, how much money is in her account?
def solve() -> int: amount_saved = 2000 monthly_deposit = 500 time_period = 6 result = amount_saved + (monthly_deposit * time_period) return result
The ratio of apples to oranges in a basket is 4:6. If there are 80 fruits in the basket, how many oranges are there?
def solve() -> int: a_ratio = 4/10 o_ratio = 6/10 total_ratio = a_ratio + o_ratio o_count = int(o_ratio / total_ratio * 80) result = o_count return result
A car travels at a speed of 60 km/h for 2.5 hours and then at 70 km/h for 1.5 hours. What is the total distance travelled by the car?
def solve() -> int: distance1 = 150 distance2 = 105 total_distance = 255 result = total_distance return result
Dan has a pet shop. He sells fish, birds, and hamsters. He buys fish for 2 dollars each and sells them for 3 dollars each. He buys birds for 5 dollars each and sells them for 8 dollars each. He buys hamsters for 10 dollars each and sells them for 15 dollars each. He sells 15 fish, 10 birds, and 5 hamsters per day. He p...
def solve() -> int: fish_buy = 2 fish_sell = 3 bird_buy = 5 bird_sell = 8 hamster_buy = 10 hamster_sell = 15 fish_sold = 15 bird_sold = 10 hamster_sold = 5 cost = 20 revenue = fish_sold * fish_sell + bird_sold * bird_sell + hamster_sold * hamster_sell cos...
A store is having a sale where all items are 20% off. If the original price of a shirt is $25, what is the discounted price?
def solve() -> int: original_price = 25 discount = 0.2 discounted_price = original_price * (1 - discount) result = discounted_price return result
The sum of two consecutive odd integers is 56. What are the integers?
def solve() -> int: total_sum = 56 first_integer = (total_sum - 1) / 2 second_integer = (total_sum + 1) / 2 result = (first_integer, second_integer) return result
For every 8 pages that a student reads, the teacher gives them a sticker. If Sam reads 56 pages, how many stickers will he receive?
def solve() -> int: pages_read = 56 pages_per_sticker = 8 stickers = pages_read // pages_per_sticker result = stickers return result
Question9: Alex wants to buy a new video game console for $249, a controller for $35 and a game for $50. If he has saved up $330, how much money will he have leftover in his savings after he makes his purchases?
def solve() -> int: console_cost = 249 controller_cost = 35 game_cost = 50 total_cost = console_cost + controller_cost + game_cost leftover_in_savings = 330 - total_cost result = leftover_in_savings return result
The sum of two consecutive odd numbers is 80. What are the two numbers?
def solve() -> int: x = 39 y = x + 2 result = (x, y) return result
A store has a sale with 30% off all items. If an item costs $45, what is the sale price?
def solve() -> int: original_price = 45 discount_percentage = 0.3 discount_amount = original_price * discount_percentage sale_price = original_price - discount_amount result = f'<<<{sale_price}>>>' result = sale_price return result
2. Five friends decided to share a $50 bill evenly between them. How much money did each friend get?
def solve() -> int: total = 50 numfriends = 5 portion = total / numfriends result = portion return result
Emily deposits $450 into her bank account every week. She had $100,000 in her account at the start of the year, and at the end of the year, she receives a surprise bonus worth half of what is in her account. How much money does she have? A woman plans to go on a road trip and knows that she needs to pack 1.2 pounds of ...
def solve() -> int: weekly_deposit = 450 starting_balance = 100000 ending_balance = starting_balance + (weekly_deposit * 52) + (starting_balance / 2) hours_per_day = 10 days_on_road = 4 snacks_per_hour = 1.2 first_pack = snacks_per_hour * hours_per_day * days_on_road resupply_pack =...
In a construction company, the profits are shared between two partners, James and Paul, in the ratio 4:9. If Paul received $2700, what was the total profit? If James spent $400 on equipment, how much did he receive?
def solve() -> int: paul_share = 9 james_share = 4 paul_received = 2700 total_profit = paul_received * (paul_share / (paul_share + james_share)) james_received = total_profit - 400 result = james_received return result
Student: A snail travels 0.2 meters per minute, how many minutes does it take for the snail to travel 10 meters?
def solve() -> int: distance = 10 speed = 0.2 time = distance / speed result = time return result
Amanda has a part-time job that pays her $12 per hour. She worked for 10 hours this week and spent $30 on transportation. If she spends 20% of her earnings on transportation, how much did she earn this week?
def solve() -> int: hours_worked = 10 hourly_wage = 12 transportation_percentage = 0.2 transportation_cost = 30 earnings = (hours_worked * hourly_wage) + transportation_cost total_income = earnings / (1 - transportation_percentage) result = total_income return result
Martha has a total of $231. She bought 15 notebooks at $4 each and 7 pencils at 34 cents each. How much money did she spend on the notebooks and pencils?
def solve() -> int: totalCost = 231 numNotebooks = 15 unitNotebookCost = 4 numPencils = 7 unitPencilCost = 0.34 notebookCost = numNotebooks * unitNotebookCost pencilCost = numPencils * unitPencilCost totalPurchases = notebookCost + pencilCost result = totalPurchases return res...
A restaurant sells 40% more burgers than fries. If they sold 1200 burgers, how many fries did they sell?
def solve() -> int: burger_percentage = 40 burger_amount = 1200 fries_amount = (burger_amount * 100) / (100 + burger_percentage) result = fries_amount return result
A paper roll was 250 meters long. It was cut into 500 sheets of equal length. What is the length of each sheet?
def solve() -> int: total_length = 250 number_of_sheets = 500 length_of_each_sheet = total_length / number_of_sheets result = length_of_each_sheet return result
Mason has been collecting stamps from all around the world for 30 days. If he adds 9 stamps in the first week, 10 stamps in the second week, and 12 stamps in the third week, how many stamps does Mason have in total?
def solve() -> int: stamps_total = 0 stamps_total += 9 stamps_total += 10 stamps_total += 12 result = stamps_total return result
A rectangular garden measures 12 meters by 15 meters. How much fencing material is needed to enclose the entire garden if fencing costs $3 per meter?
def solve() -> int: length = 12 width = 15 fence_cost = 3 perimeter = 2 * (length + width) total_cost = perimeter * fence_cost result = total_cost return result
A group of 36 students goes on a field trip. They need to take either a big bus that can hold 20 students or a small bus that can hold 12 students. How many big buses and small buses are needed if the number of buses is minimized?
def solve() -> int: big_buses = 36//20 small_buses = (36%20)//12 if (36%20)%12 > 0: small_buses += 1 result = big_buses + small_buses return result
A small bookstore needs to order news books from the distributor. Each box contains 25 books and costs $54, and the bookstore needs to buy 24 boxes of books. How much will the bookstore need to spend for all the books?
def solve() -> int: numbooks = 24 boxprice = 54 numboxes = 25 result = numbooks * boxprice * numboxes return result
Wendy walks to the store which is 3 miles away and back. How many total miles did Wendy walk?
def solve() -> int: distance = 0 distance += 3 distance += 3 result = distance return result
Student: The Muffin Shop produces 200 muffins daily at a cost of $2 per muffin. The shop sells each muffin for $4. If they could increase their production to 250 muffins daily, how much money would they make in a week after costs?
def solve() -> int: daily_production = 250 cost_per_muffin = 2 price_per_muffin = 4 daily_cost = daily_production * cost_per_muffin daily_revenue = daily_production * price_per_muffin weekly_cost = daily_cost * 7 weekly_revenue = daily_revenue * 7 weekly_profit = weekly_revenue - weekly_...
In 10 years, Scott will be twice as old as Max. If Scott is 20 years old today, how old is Max today?
def solve() -> int: max_age = (20-10)/2 result = max_age return result
Student: Bart wants to buy a sofa that costs 400 dollars. If he pays with a 20% discount, how much money will he actually have to spend?
def solve() -> int: price = 400 discount = 0.2 discounted_price = price * (1 - discount) result = price - discounted_price return result
Student: A family of 5 order 6 dozen doughnuts at $7 per dozen plus 5 pounds of gummies for $6 per pound. If they wanted to split the cost of the total bill evenly, how much would each person owe?
def solve() -> int: doughnuts = 6 doughnuts_price = 7 gummies = 5 gummies_price = 6 family_size = 5 total_cost = doughnuts * doughnuts_price + gummies * gummies_price cost_per_person = total_cost / family_size result = cost_per_person return result
A group of 5 friends went out for dinner. The total bill was $145, including 8% tax and a 20% tip. What was the original price of the meal before tax and tip were added?
def solve() -> int: meal_price = 145/(1+0.08+0.2) result = round(meal_price, 2) return result
Student: Mark's monthly phone bill is $100. If he uses extra 50 minutes, he'll have to pay $2 for every minute beyond 200 minutes. How many extra minutes did he use if he has to pay $130 in total?
def solve() -> int: monthly_bill = 100 extra_minutes = 50 extra_charge = 2 total_bill = 130 total_minutes = monthly_bill + extra_minutes extra_minutes_used = total_bill - monthly_bill total_extra_minutes_used = extra_minutes_used / extra_charge result = total_extra_minutes_used - extra_m...
Mike used to be able to do 20 pushups. After training, he increased that by 15 pushups. He then gets a new workout bench that increases his strength by an additional 150%. How many pushups can he do now?
def solve() -> int: initial_pushups = 20 increase_pushups = 15 new_bench_increase = 150/100 total_pushups = initial_pushups + increase_pushups pushups_with_new_bench = total_pushups * (1 + new_bench_increase) result = pushups_with_new_bench return result
Student: A basket contains 3 apples, 4 oranges and 2 bananas. If 2 fruits are selected at random, what is the probability that both are oranges?
def solve() -> int: apples = 3 oranges = 4 bananas = 2 total_fruits = apples + oranges + bananas outcomes = total_fruits * (total_fruits - 1) both_oranges = oranges * (oranges - 1) probability = both_oranges / outcomes result = probability return result
Alice has a jar of candies. She starts with 100 candies and eats 5 candies every day. However, on Saturdays, she gets 20 more candies from her grandma. How many candies does she have in the jar after 14 days?
def solve() -> int: candies = 100 for day in range(1, 15): candies = candies - 5 if day % 7 == 0: candies = candies + 20 result = candies return result
The length of 2 sides of a rectangle are 5 meters and 3 meters. What is the length of the diagonal?
def solve() -> int: side1 = 5 side2 = 3 diagonal_length = (side1**2 + side2**2)**0.5 result = round(diagonal_length, 2) return result
In a class of 50 students, 75% of them passed the math exam. How many students passed?
def solve() -> int: total_students = 50 passing_percentage = 75 students_passed = (passing_percentage/100)*total_students result = students_passed return result
A gym charges a monthly membership fee of $50. They also charge an initiation fee of $100. How much will a member have to pay in their first month?
def solve() -> int: cost = 50 + 100 result = int(cost) return result
Mia wants to reduce her weight. She plans on cycling for 1 hour every day. For every 20 minutes of cycling, Mia loses 0.5 pounds. If her current weight is 145 pounds, how much will she weigh in 2 weeks if she continues cycling for 1 hour every day?
def solve() -> int: minutes_per_hour = 60 minutes_per_cycling = 20 weight_loss_per_cycling = 0.5 cycling_per_day = minutes_per_hour / minutes_per_cycling weight_loss_per_day = cycling_per_day * weight_loss_per_cycling days_in_two_weeks = 14 total_weight_loss = weight_loss_per_day *...
At a basketball game, the home team scored 78 points and the away team scored 62 points. What percentage of the total points did the home team score?
def solve() -> int: total_points = 78 + 62 home_team_percentage = (78 / total_points) * 100 result = home_team_percentage return result
John owns a pet store. He sells 25 bags of dog food every week. Each bag of dog food is 20lbs and costs $15. How much money does he make in a month (4 weeks)?
def solve() -> int: dog_food_sales_per_week = 25 * 15 dog_food_sales_per_month = dog_food_sales_per_week * 4 result = dog_food_sales_per_month return result
If the perimeter of a square is 32 meters, what is the area of the square?
def solve() -> int: perimeter = 32 side = perimeter / 4 area = side ** 2 result = area return result
Jennifer has $250 in her wallet. She spends three-sevenths of that and then spends one-fifth of the new amount. How much does she have left?
def solve() -> int: wallet = 250 amount_spent_1 = wallet * 0.43 amount_spent_2 = wallet - amount_spent_1 value_spent_2 = amount_spent_2 * 0.2 result = wallet - amount_spent_1 - value_spent_2 return result
Kevin wants to score an average of 80 points per game over the next six games. On the first game he scored 70 points. On the second game he scored 90 points. On the third game he scored 85 points. How many points does he need to score on average on the remaining three games to meet his goal?
def solve() -> int: total_points = 80 * 6 scored_points = 70 + 90 + 85 remain_points = total_points - scored_points average_points = remain_points / 3 result = average_points return result
A pack of gum has 10 pieces. If Amanda buys 3 packs of gum and shares them equally among her 4 friends, how many pieces of gum will each person get?
def solve() -> int: gum = 10 packs = 3 friends = 4 pieces = gum * packs // friends result = pieces return result
Monica makes an annual salary of $75,000. She contributes 7% of her salary to a retirement savings account. Her monthly bills include $1,500 for rent, $300 for groceries, $250 for utilities, $200 for car insurance, and $100 for miscellaneous expenses. After these expenses and her retirement contributions, how much mone...
def solve() -> int: monica_annual_salary = 75000 monica_monthly_salary = monica_annual_salary / 12 monica_retirement_contribution = monica_monthly_salary *.07 monthly_bills = 1500 + 300 + 250 + 200 + 100 total_expenses = monthly_bills + monica_retirement_contribution money_left = monica_monthly_...
A class has 36 students. 15 students scored an A, 6 students scored a B, and the rest scored a C. If the number of students who scored a C is twice the number of students who scored a B, how many students scored a C?
def solve() -> int: total_students = 36 students_a = 15 students_b = 6 students_c = total_students - students_a - students_b students_b_c_ratio = 2 students_c = students_b_c_ratio * students_b result = students_c return result
Grace is making a salad and she needs to cut off 150 grams of lettuce from a head of lettuce that weighs 625 grams. What is the weight of the lettuce after she has cut off 150 grams?
def solve() -> int: initial_weight = 625 cut_weight = 150 final_weight = initial_weight - cut_weight result = final_weight return result
A pack of colored pencils costs $3.50. John has $21. How many packs of colored pencils can John buy?
def solve() -> int: packs = 0 total_money = 21 while total_money >= 3.50: packs += 1 total_money -= 3.50 result = packs return result
----------------------------------------------- In a classroom, the ratio of males to females is 7:9. There are 24 more males than females in the classroom. How many students are in the classroom?
def solve() -> int: males_more = 24 ratio_males = 7 ratio_females = 9 total_ratio = ratio_males + ratio_females males_ratio = ratio_males / total_ratio females = males_more / males_ratio males = females + males_more total_students = males + females result = total_students ...
Jasmine wants to buy a new pair of shoes that costs $75. She has a coupon that gives her 20% off of the original price. She also must pay 6% sales tax. How much will Jasmine pay in total?
def solve() -> int: discounted_price = 75*0.2 price_after_discount = 75-discounted_price sales_tax = price_after_discount*0.06 total_price = price_after_discount+sales_tax result = total_price return result
A recipe calls for 3 cups of flour to make 24 cookies. How many cups of flour are needed to make 72 cookies?
def solve() -> int: cookies_needed = 72 flour_for_24_cookies = 3 flour_needed = (flour_for_24_cookies/24) * cookies_needed result = flour_needed return result
There are 6 years between two birthdays. If Rio's birthday is 6 years older than Lola's, how many years apart are they?
def solve() -> int: lola_year = 2020 rio_year = lola_year + 6 difference_in_years = rio_year - lola_year result = difference_in_years * 2 return result
There were 500 stickers in a box to be given away as rewards in a classroom activity. Out of the 100 students in the classroom, 50% were allowed to pick stickers from the box. Each student picked four stickers from the box. How many stickers remained in the box after the activity?
def solve() -> int: total_stickers = 500 num_students = 100 allowed_students = num_students * 0.5 picked_stickers = allowed_students * 4 remaining_stickers = total_stickers - picked_stickers result = remaining_stickers return result