question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Olivia purchases 10 books for $20 each and 2 reading tablets for $150 each. She has to pay a registration fee of $15 for each item. What will be the total cost?
def solve() -> int: books = 10 book_price = 20 tablets = 2 tablet_price = 150 registration_fee = 15 total_cost = (books * book_price) + (tablets * tablet_price) + (books * registration_fee) + (tablets * registration_fee) result = total_cost return result
A bicycle shop sells 15 bikes for $200 each and 10 bikes for $150 each. What was the total revenue earned by the shop?
def solve() -> int: high_price_bikes = 15 low_price_bikes = 10 high_price = 200 low_price = 150 total_revenue = (high_price_bikes * high_price) + (low_price_bikes * low_price) result = total_revenue return result
A company produces 120 widgets per hour. How many widgets will it produce in 12 hours, assuming no downtime?
def solve() -> int: widgets_per_hour = 120 hours = 12 total_widgets = widgets_per_hour * hours result = total_widgets return result
Liam wants to find the cost of 4 adult tickets and 2 child tickets to a theme park if adult tickets cost $35 and child tickets cost $15. How much will Liam pay in total?
def solve() -> int: cost_of_adults = 35 * 4 cost_of_children = 15 * 2 total_cost = cost_of_adults + cost_of_children result = total_cost return result
A class of 36 students took a math test. The average score of the class was 75. The teacher noticed that 6 students forgot to write their names on their papers and decided to give them a penalty of 10 points each. How much did the average score of the class change after the penalty?
def solve() -> int: total_score_before = 36 * 75 total_score_after = total_score_before - 6 * 10 average_score_after = total_score_after / 36 difference = average_score_after - 75 result = difference return result
Jacob and Olivia planted some flowers in their garden. Jacob planted 18 flowers and Olivia planted 12 flowers. Each flower needs 2 cups of water every day. How many cups of water do they need to water their flowers every day?
def solve() -> int: total_flowers = 18 + 12 total_water = total_flowers * 2 result = total_water return result
A store reduces its prices by 25% for a special promotion. If a customer bought an item for $60 before the promotion, how much did the price of the item get reduced by during the promotion?
def solve() -> int: original_price = 60 discount = 0.25 discounted_price = original_price*(1-discount) price_reduction = original_price - discounted_price result = price_reduction return result
A group of students took a test. Their average score was 78. If 5 students with an average score of 85 joined the group, what would be the new average score of the whole group?
def solve() -> int: current_avg = 78 new_students = 5 new_avg = 85 current_total_score = current_avg * (current_avg + new_students) new_total_score = current_total_score + (new_students * new_avg) new_avg_score = new_total_score / (current_avg + new_students) result = new...
A packet of candies has 100 candies in total. If 30% of them are chocolate candies and the rest are gummy candies, how many gummy candies are there?
def solve() -> int: total_candies = 100 chocolate_candies = total_candies*0.3 gummy_candies = total_candies - chocolate_candies result = gummy_candies return result
John caught some fish during the weekend. He placed 4 fish in each bag but had 3 fish left. If he had 11 bags of fish, how many fish did he catch in total?
def solve() -> int: num_fish = (11*4) + 3 result = num_fish return result
In an art competition, Mariah won 7/12 of the prize money. She spent 1/8 of her winnings and is now left with $380. How much was the total prize money for the art competition?
def solve() -> int: mariah_winnings = 7/12 spent_fraction = 1/8 left_fraction = 1 - spent_fraction left_money = 380 total_prize_money = left_money / (mariah_winnings * left_fraction) result = total_prize_money return result
A store carries 50 boxes of cereal with 10 packets of cereal in each box. If each packet costs $2.00 and the store sells all of the cereal packets, how much money does the store make from selling the cereal?
def solve() -> int: num_boxes = 50 packets_per_box = 10 cost_per_packet = 2.00 total_packets = num_boxes * packets_per_box total_cost = total_packets * cost_per_packet result = total_cost return result
Liam needs 10 apples to make 2 pies. If he has 50 apples, how many pies can he make?
def solve() -> int: apples_needed_for_2_pies = 10 total_apples = 50 pies_can_be_made = total_apples // apples_needed_for_2_pies result = pies_can_be_made return result
A bakery uses 2.5 cups of flour to make 12 cupcakes. How many cups of flour are needed to make 30 cupcakes?
def solve() -> int: cups_per_cupcake = 2.5/12 total_cups = cups_per_cupcake * 30 result = total_cups return result
An ice cream shop sells vanilla ice cream for $3.50 per scoop and chocolate ice cream for $4.25 per scoop. Last week, the shop sold 40 scoops of vanilla ice cream and 30 scoops of chocolate ice cream. What was the total amount of money the shop made from selling ice cream last week?
def solve() -> int: scoops_vanilla = 40 scoops_chocolate = 30 price_vanilla = 3.5 price_chocolate = 4.25 total_vanilla = scoops_vanilla * price_vanilla total_chocolate = scoops_chocolate * price_chocolate total_sales = total_vanilla + total_chocolate result = total_sales return resul...
Tim has 10 pencils. He gives 3/5 of his pencils to his friend. Then, his friend gives him 4 pencils. Finally, Tim gives half of his pencils to his little sister. How many pencils does Tim have remaining?
def solve() -> int: pencils = 10 pencils_given = pencils * 3 / 5 pencils_received = pencils_given + 4 pencils_remaining = (pencils_received / 2) result = pencils_remaining return result
Jack wants to find out what the average percentage profit earned on sales was. In January, he sold goods worth $3000 and made a profit of $500. In February, he sold goods worth $2500 and made a profit of $450. In the month of March, he sold goods worth $4000 and made a profit of $900. What is the average percentage pro...
def solve() -> int: jan_sales = 3000 jan_profit = 500 feb_sales = 2500 feb_profit = 450 mar_sales = 4000 mar_profit = 900 total_sales = jan_sales + feb_sales + mar_sales total_profit = jan_profit + feb_profit + mar_profit average_profit = (total_profit / total_sales) * 100 ...
A store is having a sale where all items are 20% off their original price. If an item originally costs $80, what is the sale price of the item?
def solve() -> int: sale_price = 80 * 0.8 result = sale_price return result
Jack has a pizza restaurant. Last night, he sold 8 pepperoni pizzas and 5 cheese pizzas. Each pepperoni pizza has 10 slices and each cheese pizza has 8 slices. How many total pizza slices did Jack sell last night?
def solve() -> int: pepperoni_pizzas = 8 cheese_pizzas = 5 pepperoni_slices = 10 cheese_slices = 8 total_slices = pepperoni_pizzas * pepperoni_slices + cheese_pizzas * cheese_slices result = total_slices return result
4. Michael and Elizabeth bought some furniture. Michael bought 7 furniture less than Elizabeth did. Unfortunately, Michael lost 2 furniture. If Elizabeth bought 18 furniture, how many furniture do they have altogether?
def solve() -> int: Elizabeth_total = 18 Michael_total = Elizabeth_total - 7 - 2 Total = Elizabeth_total + Michael_total result = Total return result
In a toy store, the number of red toys was half of the blue toys, and the number of yellow toys was a quarter of the blue toys. If there were 32 yellow toys, how many red toys were there?
def solve() -> int: Yellow = 32 Blue = Yellow * 4 Red = Blue / 2 result = Red return result
Student: You have a coupon for 20% off of a $48 item. How much will you save?
def solve() -> int: price = 48 discount = 0.2 amount_saved = price * discount total_price = price - amount_saved result = total_price return result
Michael had 50 pencils. Rachel gave him three-fifths of her 20 pencils. How many pencils does Michael have now?
def solve() -> int: michaels_pencils = 50 rachels_pencils = 20 pencils_given = (3/5) * rachels_pencils michaels_pencils += pencils_given result = michaels_pencils return result
Student: A math quiz has 10 questions, each worth 5 points. If a student gets 7 out of the 10 questions correct, what is their final score as a percentage?
def solve() -> int: num_questions = 10 points_per_question = 5 num_correct = 7 total_points = num_correct * points_per_question max_points = num_questions * points_per_question percentage = (total_points / max_points) * 100 result = percentage return result
Logan has twice as many shirts as Henry, but Isabella has five times as many shirts as Logan. If there are 99 shirts altogether, how many shirts does Isabella have? Emma collected 25 red marbles and 35 blue marbles. Out of the blue marbles, 1/4 of them were cracked. In the red marbles, 3/5 of them were not shiny. How m...
def solve() -> int: logan_shirts = 0 henry_shirts = 0 isabella_shirts = 0 logan_shirts = henry_shirts * 2 isabella_shirts = logan_shirts * 5 total_shirts = logan_shirts + henry_shirts + isabella_shirts isabella_shirts = total_shirts - (logan_shirts + henry_shirts) result =...
Lizzy has a garden and she wants to buy new soil. She needs 8 bags of soil, which are each 25 pounds. However, she can only carry bags up to 25 pounds. How many trips will she need to make to take all the soil home?
def solve() -> int: pounds_needed = 8 * 25 max_pounds_per_trip = 25 num_of_trips_needed = pounds_needed // max_pounds_per_trip if pounds_needed % max_pounds_per_trip!= 0: num_of_trips_needed += 1 result = num_of_trips_needed return result
Amanda is deciding which route to take to run errands. One route is 10 miles and she can bike it in 30 minutes. The other route is 8 miles, but she has to walk it and it takes one hour. How many more miles per hour can Amanda travel along the shorter route?
def solve() -> int: bike_distance = 10 bike_time = 30 walk_distance = 8 walk_time = 60 bike_speed = bike_distance / (bike_time / 60) walk_speed = walk_distance / (walk_time / 60) speed_difference = bike_speed - walk_speed result = speed_difference return res...
Eva has a rock collection. She began with 70 rocks her grandmother gifted her. Over the next year, she added 150% more to her collection. The following year, she found 3 rocks each day. The year after that, she earned 1 rock every week by helping her neighbour collect stones. The year after that, she lost 10% of her co...
def solve() -> int: rocks = 70 rocks += rocks * 1.5 rocks += 3 * 365 rocks += 52 rocks -= rocks * 0.1 result = rocks return result
The surface area of a cube is 54 sq meters. Find the volume of the cube.
def solve() -> int: sa = 54 s = sa/6 V = s**3 result = int(V) return result
Tom has 500 dollars. He spends 200 dollars on a phone, then received a check of 300 dollars. How much money does he have now?
def solve() -> int: money = 500 money -= 200 money += 300 result = money return result
A house is being renovated from its current size of 1000 square feet up to 5000 square feet. 200 square feet are renovated on the first day, and four times this amount are renovated on the second day. How many square feet still need to be renovated to finish the renovation of the house?
def solve() -> int: current_size = 1000 target_size = 5000 renovated_first_day = 200 renovated_second_day = 4 * renovated_first_day total_renovated = renovated_first_day + renovated_second_day remaining_size = target_size - current_size - total_renovated result = remaining_size ...
If a person can walk 5 km in 1 hour, how much time would they need to walk 20 km if their speed increased by a factor of 1.5?
def solve() -> int: distance_initial = 5 time_initial = 1 distance_new = 20 speed_factor = 1.5 time_new = (distance_new / distance_initial) * (time_initial / speed_factor) result = time_new return result
A family of 4 is planning a vacation to Disney World. They need to save at least $1000 each and they need $8000 for accommodation and travel expenses. On the first day of their savings plan, they collectively save $1200. On the second day, they save $1500 and on the third day, they save $800. For the next 4 days, they ...
def solve() -> int: goal = 1000 * 4 expenses = 8000 savings = 1200 + 1500 + 800 + (3 * (1200 + 1500 + 800) / 2) total = savings - expenses each_person = (goal - total) / 4 result = each_person return result
A garden is in the shape of a rectangle with a length of 12 meters and a width of 8 meters. What is the perimeter of the garden?
def solve() -> int: length = 12 width = 8 perimeter = 2*length + 2*width result = perimeter return result
Student: There are 48 students in a classroom. If each student receives 3 pieces of candy, how many pieces of candy in total will be given to all students?
def solve() -> int: num_students = 48 num_candy_per_student = 3 total_num_candy = num_students * num_candy_per_student result = total_num_candy return result
Ben ran 1 mile in 7 minutes and 30 seconds. If he continued running at the same pace, how long would it take him to run 4 miles?
def solve() -> int: time_per_mile = 7 * 60 + 30 num_miles = 4 total_time = time_per_mile * num_miles result = total_time return result
During one day of sale, a store offers a 20% discount to customers. If an item costs $25, what is its discounted price?
def solve() -> int: item_price = 25 discount_percent = 0.2 discounted_price = item_price * (1 - discount_percent) result = discounted_price return result
Adam has 13 boxes of chocolates, each box is 3.5 pounds. If he gave away 5.2 pounds of the chocolates, how many pounds of chocolates does Adam still have?
def solve() -> int: boxes = 13 choc_per_box = 3.5 gave_away = 5.2 result = boxes * choc_per_box - gave_away return result
A farmer has 24 chickens and 18 cows. He sells 4 chickens and 3 cows to a neighbor. He then buys 2 chickens and 5 cows from another farmer. How many animals does he have now?
def solve() -> int: chickens = 24 cows = 18 chickens -= 4 cows -= 3 chickens += 2 cows += 5 animals = chickens + cows result = animals return result
David's SAC algorithm obtained 60% of the minimum score on the Dodgeball environment. The minimum score is -200 points, and each point represents 0.01 seconds of penalty time. How much penalty time did David's SAC algorithm get?
def solve() -> int: score = 0.6 * (-200) time = score * 0.01 result = time return result
A phone plan costs $40 per month and offers unlimited talk and text. If a person talks on the phone for 10 hours every month, and the cost per minute of calling is $0.05, then what will be the total cost of the phone bill?
def solve() -> int: cost_per_month = 40 talk_time_in_hours = 10 talk_time_in_minutes = talk_time_in_hours * 60 cost_per_minute_of_calling = 0.05 cost_of_calls_per_month = talk_time_in_minutes * cost_per_minute_of_calling total_cost_per_month = cost_per_month + cost_of_calls_per_month result ...
John needs to make a square pond whose perimeter is thrice as large as a rectangular pond. If the rectangular pond has a length of 50 feet and a width of 30 feet, determine the length of one side of the square pond.
def solve() -> int: rectangular_length = 50 rectangular_width = 30 rectangular_perimeter = 2 * (rectangular_length + rectangular_width) square_perimeter = 3 * rectangular_perimeter square_side_length = square_perimeter / 4 result = square_side_length return result
Alex runs an ice cream shop and sells ice creams and smoothies with individual prices of $4 and $2 respectively. During the week he had a total income of $720 and had to pay 10% taxes. How many smoothies did he sell?
def solve() -> int: total_price = 720 tax_rate = 0.10 ice_cream_price = 4 smoothie_price = 2 final_price = total_price - (total_price * tax_rate) smoothies_sold = final_price / smoothie_price result = smoothies_sold return result
Emily has 22 necklaces. One-tenth of the necklaces have pearls. Emily's friend gives her 4 more pearl necklaces. How many pearl necklaces does Emily have in total?
def solve() -> int: num_necklaces = 22 pearl_necklaces = num_necklaces / 10 friend_necklaces = 4 total_pearl_necklaces = pearl_necklaces + friend_necklaces result = total_pearl_necklaces return result
Student: Laura has 18 stickers and Leo has 12 stickers. If Laura gives Leo 4 stickers and Leo gives Laura 3 stickers, how many fewer stickers does Leo have than Laura?
def solve() -> int: laura_stickers = 18 leo_stickers = 12 laura_stickers -= 4 leo_stickers += 4 leo_stickers -= 3 laura_stickers += 3 difference = laura_stickers - leo_stickers result = difference return result
Lucas earns $90,000 a year. He spends $40,000 on rent each year, $9,000 on groceries annually, and $18,000 on gas each year. How much money does he have left over each year?
def solve() -> int: earnings = 90000 rent = 40000 groceries = 9000 gas = 18000 total_expenses = rent + groceries + gas left_over = earnings - total_expenses result = left_over return result
Michael swims 2 miles round-trip to the beach, where he drinks a smoothie with 200 calories. If Michael burns 250 calories per mile swam, what's Michael's net calorie deficit (expressed as a positive number)?
def solve() -> int: distance_to_beach = 2 calories_smoothie = 200 calories_burned_per_mile = 250 calories_burned = distance_to_beach * calories_burned_per_mile total_calories = calories_burned - calories_smoothie result = abs(total_calories) return result
Mia went on a holiday, and her backpack weighed 6 pounds. While on vacation, she bought 7 hair clips that weighed 2 ounces each, 1 pound of strawberries, 2 tubes of toothpaste that weighed 6 ounces each and 3 bars of chocolate that weighed 4 ounces each. If 1 pound is equal to 16 ounces, what was the weight of Mia's ba...
def solve() -> int: backpack_weight = 6 hair_clip_weight = 2/16 strawberry_weight = 1*16 toothpaste_weight = 2*(6/16) chocolate_weight = 3*(4/16) total_weight = backpack_weight + (7*hair_clip_weight) + strawberry_weight + toothpaste_weight + chocolate_weight result = total_weight ...
Jupiter is made of 90% hydrogen, 8% helium, and 2% other elements. Saturn is made of 85% hydrogen, 12% helium, and 3% other elements. If Jupiter weighs 300 times more than Saturn, how many tons of other elements does Saturn have?
def solve() -> int: jupiter_hydrogen = 0.9 jupiter_helium = 0.08 jupiter_other = 0.02 saturn_hydrogen = 0.85 saturn_helium = 0.12 saturn_other = 0.03 S = 0 S = jupiter_other / (300 * saturn_other) other = saturn_other * S result = other return result...
There are 70 students on a school trip. Each bus can accommodate 28 students. How many buses are needed for all the students to go on the trip?
def solve() -> int: total_students = 70 students_per_bus = 28 buses_needed = -(-total_students // students_per_bus) result = buses_needed return result
If Anna is 10 years younger than Bob and Bob is 5 years older than Carol, and Carol is 40 years old, what is the average age of the three of them?
def solve() -> int: carol_age = 40 bob_age = carol_age + 5 anna_age = bob_age - 10 average_age = (carol_age + bob_age + anna_age) / 3 result = average_age return result
Juan has a triangle with sides 3 cm, 4 cm, and 5 cm. What is the perimeter of his triangle?
def solve() -> int: side1 = 3 side2 = 4 side3 = 5 perimeter = side1 + side2 + side3 result = perimeter return result
Student: At Rainbow Ranch, there are five fewer horses than cows. If there are 28 horses, how many cows are at Rainbow Ranch?
def solve() -> int: horses = 28 cows = horses + 5 result = cows return result
Every time Sarah goes for a run, she needs 4 ounces of water for every mile she runs. She has a 32-ounce bottle of water and a 64-ounce bottle of water. If she ran 6 miles today, which bottle will she need to use?
def solve() -> int: miles = 6 water_per_mile = 4 total_water = miles * water_per_mile small_bottle = 32 large_bottle = 64 if total_water <= small_bottle: bottle_to_use = "small" else: bottle_to_use = "large" result = bottle_to_use return ...
A company has 150 employees, of whom 40% are part-time workers. If full-time workers work 40 hours per week and part-time workers work 20 hour weeks, how many hours do all the employees work per week?
def solve() -> int: part_time_workers = 150 * 0.40 full_time_workers = 150 - part_time_workers total_hours_worked = (full_time_workers * 40) + (part_time_workers * 20) result = total_hours_worked return result
Student: Ben has some marbles in his jar. He has 18 green marbles, 8 more red marbles than green marbles, and half as many blue marbles as red marbles. How many marbles does he have in his jar?
def solve() -> int: green_marbles = 18 red_marbles = green_marbles + 8 blue_marbles = red_marbles / 2 total_marbles = green_marbles + red_marbles + blue_marbles result = total_marbles return result
A florist is creating bouquets for a wedding. The bride wants flowers to be arranged in groups of 7, with each bouquet containing 21 flowers. If the florist has 280 flowers in total, how many bouquets can she create?
def solve() -> int: total_flowers = 280 flowers_per_bouquet = 21 flowers_per_group = 7 flowers_per_group = flowers_per_bouquet / 3 num_groups = total_flowers / flowers_per_group num_bouquets = num_groups / flowers_per_group result = num_bouquets return result
10) In an online survey of 800 people, 25% expressed strong support for a new technology. How many people expressed strong support?
def solve() -> int: total_people = 800 percent_support = 25 support_people = (total_people/100)*percent_support result = support_people return result
A group of 25 students went on a field trip. They traveled on a bus that had 50 seats. If each seat costs $10, what is the total cost of the seats for the students?
def solve() -> int: number_of_students = 25 seats_per_bus = 50 seat_cost = 10 total_cost = number_of_students * seat_cost result = total_cost return result
For every 6 plants that a gardener plants, they put one tulip onto the flowerbed for decoration. If the gardener plants 54 plants in one day and 18 more plants the next day, how many tulips were put onto the flowerbed during those two days? Marcela's monthly salary is $1200. If she works 5 hours a day for 4 days a week...
def solve() -> int: plants_day1 = 54 plants_day2 = 54 + 18 total_plants = plants_day1 + plants_day2 tulips = total_plants // 6 result = tulips salary = 1200 hours_per_day = 5 days_per_week = 4 total_hours = hours_per_day * days_per_week hourly_rate = sala...
If a train can travel 120 km in 3 hours, what is the average speed of the train?
def solve() -> int: distance = 120 time = 3 average_speed = distance/time result = average_speed return result
If 3 pizzas cost $24, how many pizzas can you buy with $50?
def solve() -> int: cost_of_three_pizzas = 24 number_of_pizzas = 3 cost_of_one_pizza = cost_of_three_pizzas / number_of_pizzas pizzas_that_can_be_bought = 50 // cost_of_one_pizza result = pizzas_that_can_be_bought return result
Student: In a video game, you start off with 100 health points and each time you are hit, you lose 20 health points. If you are hit twice, how many health points do you have left?
def solve() -> int: health_points = 100 hit_times = 2 health_points = health_points - hit_times * 20 result = health_points return result
A garden is in the shape of a rectangle with a length of 10 meters and a width of 5 meters. A border is added around the garden with a width of 2 meters. What is the total area of the garden and border?
def solve() -> int: garden_length = 10 garden_width = 5 border_width = 2 garden_area = garden_length * garden_width border_area = (garden_length + (2 * border_width)) * (garden_width + (2 * border_width)) - garden_area total_area = garden_area + border_area result = total_area return res...
Laura wants to give out candy for Halloween. She is planning to buy each kid 2 cans of candy and wants to know how many cans of candy she needs to buy if she anticipates 50 kids. How many cans of candy will she need to buy?
def solve() -> int: total_cans = 50 * 2 result = total_cans return result
``` Sarah received $100 for her birthday. She spent $26 on a book, $12 on a game, and $8 on a movie. How much money does Sarah have left?
def solve() -> int: total_money = 100 spent = 26 + 12 + 8 remaining = total_money - spent result = remaining return result
A pizza restaurant charges $8 for a cheese pizza and $10 for a pepperoni pizza. If the restaurant sells 45 cheese pizzas and 25 pepperoni pizzas in one night, how much total money did the restaurant make from selling these pizzas alone?
def solve() -> int: cheese_pizza_cost = 8 pepperoni_pizza_cost = 10 cheese_pizzas_sold = 45 pepperoni_pizzas_sold = 25 total_cheese_pizza_sales = cheese_pizza_cost * cheese_pizzas_sold total_pepperoni_pizza_sales = pepperoni_pizza_cost * pepperoni_pizzas_sold total_sales = total_cheese_pizza...
A hair salon charges $30 for a haircut and $50 for a haircut and a dye job. If the cost of the dye treatment by itself is $40, how much does the salon charge for a dye treatment added to a haircut?
def solve() -> int: haircut_price = 30 dye_price = 40 haircut_dye_price = 50 price_diff = haircut_dye_price - haircut_price - dye_price result = price_diff return result
A farmer has 32 cows and each cow can produce an average of 8 gallons of milk per day. If he sells 70% of the milk to the markets, how many gallons of milk will he sell in a week?
def solve() -> int: cows = 32 milk_per_cow = 8 milk_per_day = cows * milk_per_cow total_milk_week = milk_per_day * 7 milk_to_sell = total_milk_week * 0.7 result = milk_to_sell return result
Jacob read 275 pages of Harry Potter book in 5 days. If he read the same number of pages each day, how many pages did he read each day?
def solve() -> int: pages = 275 days = 5 pages_per_day = pages/days result = pages_per_day return result
Rita sells handmade jewelry for 10 dollars per piece at a craft fair. Today, Rita sells 7 pieces and is given a 15 dollar gift card from a loyal customer. Later on, Rita uses the gift card to buy 3 pieces of jewelry from another vendor. How many dollars is Rita left with after making the purchase?
def solve() -> int: jewelry_price = 10 jewelry_sold = 7 gift_card = 15 jewelry_bought = 3 revenue = jewelry_price * jewelry_sold + gift_card money_left = revenue - jewelry_price * jewelry_bought result = money_left return result
Alfred purchased 4 papers costing $0.50 each and 5 pens costing $2 each. How much did he spend in total?
def solve() -> int: cost_papers=0.50*4 cost_pens=2*5 total_cost=cost_papers + cost_pens result = total_cost return result
A factory produces an average of 1,000 units per day. With 180 days left in the year, they've already produced 140,000 units. How many units on average do they need to produce per day to finish the year with the normal average?
def solve() -> int: total_units = 365 * 1000 days_left = 180 units_produced = 140000 total_units_needed = total_units - units_produced average_units_needed = total_units_needed / days_left result = average_units_needed return result
A class of 30 students is going on a field trip. If each bus can seat 50 passangers, how many buses are required to transport all the students?
def solve() -> int: num_students = 30 bus_capacity = 50 num_buses = num_students // bus_capacity if num_students % bus_capacity!= 0: num_buses += 1 result = num_buses return result
Yolanda got 4 stars on her 1st test, 8 stars on her 2nd test, and 12 stars on her 3rd test. If she had 25 stars total, how many stars did Yolanda have to start with?
def solve() -> int: total_stars = 25 stars_1st_test = 4 stars_2nd_test = 8 stars_3rd_test = 12 original_stars = total_stars - (stars_1st_test + stars_2nd_test + stars_3rd_test) result = int(original_stars) return result
There are 24 crayons in a box. If there are 6 boxes, how many crayons are there in total?
def solve() -> int: crayons_per_box = 24 num_boxes = 6 total_crayons = crayons_per_box * num_boxes result = total_crayons return result
Michael wants to sell his guitar for $500 and got two offers. The first buyer offered to pay the full price if Michael would pay for the guitar upgrade, which cost a tenth of Michael's asking price. The second buyer agreed to pay the price if Michael replaced the strings for $30 and the guitar pick-up for twice as much...
def solve() -> int: asking_price = 500 upgrade_cost = asking_price / 10 string_cost = 30 pickup_cost = 2 * string_cost earnings_first_buyer = asking_price - upgrade_cost earnings_second_buyer = asking_price - string_cost - pickup_cost difference = earnings_first...
Olivia earned $2500 from her summer internship. She spent $700 on a new laptop and gave 2/3 of the rest to her parents for paying bills. How much money does she have left?
def solve() -> int: earnings = 2500 laptop_cost = 700 remaining_money = earnings - laptop_cost money_for_bills = (2/3) * remaining_money money_left = remaining_money - money_for_bills result = money_left return result
At a sports stadium, there are three gates for entry. There are 800 people entering through gate 1, and gate 2 has 150 more people entering than gate 3. How many people are entering through gate 2?
def solve() -> int: gate1 = 800 gate3 = (gate1 - 150) / 2 gate2 = gate3 + 150 result = gate2 return result
A pet store sold 20 goldfish on Monday. On Tuesday, the store sold three times as many goldfish as it did on Monday. On Wednesday, the store sold half the number of goldfish it did on Tuesday. How many goldfish did the store sell by Wednesday?
def solve() -> int: monday_sales = 20 tuesday_sales = monday_sales * 3 wednesday_sales = tuesday_sales / 2 total_sales = monday_sales + tuesday_sales + wednesday_sales result = total_sales return result
Student: The perimeter of a rectangle is 24 inches. If the length is 6 inches, what is the width of the rectangle?
def solve() -> int: perimeter = 24 length = 6 width = (perimeter - 2 * length) / 2 result = width return result
Mark fills up a tank in his house every 5 days, the tank has a capacity of 5000 L, what is the rate at which he uses water in liters/day?
def solve() -> int: capacity = 5000 filling_time = 5 filling_rate = capacity / filling_time filling_rate_in_liters_per_day = filling_rate / 24 result = filling_rate_in_liters_per_day return result
Student: Alexa has 8 pieces of ribbon. Each ribbon is 22 centimetres long. She wants to cut all of the ribbons into pieces that are 10 cm long. How much extra ribbon will Alexa have after she cuts all of them?
def solve() -> int: ribbons = 8 ribbon_length = 22 cut_length = 10 total_length = ribbons * ribbon_length pieces_per_ribbon = ribbon_length // cut_length total_pieces = ribbons * pieces_per_ribbon piece_length = total_length / total_pieces extra_length = ribbon_length - pieces_per...
A merchant buys a cylindrical ingot of pure gold with the radius of 2 cm and a height of 5 cm. The density of gold is 19 grams per cubic centimeter and the merchant buying the gold pays $0.90 per gram for it. How much did the merchant pay for the gold?
def solve() -> int: volume = (3.14) * (2 ** 2) * (5) weight_in_grams = volume * 19 cost_of_the_gold = weight_in_grams * 0.90 result = cost_of_the_gold return result
The perimeter of a rectangle is 40 centimeters. If the length of the rectangle is 12 centimeters, what is the width of the rectangle?
def solve() -> int: length = 12 perimeter = 40 width = (perimeter - (2 * length)) / 2 result = width return result
A phone plan costs $50 per month with unlimited calls and texts. In addition, each gb of data cost $10 per month. Linh has used 3.5 gb this month. How much money does he need to pay?
def solve() -> int: cost_of_data = 3.5 * 10 total_cost = 50 + cost_of_data result = total_cost return result
Student: **** Jim has an amount of money that is equal to two times the amount of money Kevin has. Kevin has a fifth of the amount Mark has, while Mark has a half his total money plus $1000. How much money does Jim have?
def solve() -> int: jim_money = 0 kevin_money = 0 mark_money = 0 kevin_money = mark_money / 5 jim_money = kevin_money * 2 mark_money = (jim_money / 2) + 1000 result = jim_money return result
A recipe calls for 1/4 cup of sugar. If you want to make 3 times the recipe, how many cups of sugar do you need in total?
def solve() -> int: recipe_sugar = 1/4 recipe_multiplier = 3 total_sugar = recipe_sugar * recipe_multiplier result = total_sugar return result
There are 30 students in a class, of which 18 are boys. If each girl is given a red pen and each boy is given a blue pen, how many blue pens are there?
def solve() -> int: total_students = 30 boys = 18 girls = total_students - boys blue_pens = boys result = blue_pens return result
You want to buy a $200 camera that's on sale for 20% off. However, you also have to pay a 6% sales tax on the discounted price. What will be the final cost of the camera?
def solve() -> int: original_price = 200 discount = 0.20 discounted_price = original_price * (1 - discount) tax_rate = 0.06 tax_amount = discounted_price * tax_rate final_price = discounted_price + tax_amount result = round(final_price, 2) return result
A construction worker needs to build a wall using square blocks. Each block is 3 inches by 3 inches and the wall needs to be 30 feet wide and 10 feet high. Assuming there are no spaces between the blocks, how many blocks will the construction worker need to finish the wall?
def solve() -> int: width = 30*12 height = 10*12 block_area = 3*3 total_blocks = (width*height)//block_area result = total_blocks return result
A store bought 915 items and had to pay 27% tax on each item. What was the total cost of the items including the tax?
def solve() -> int: quantity = 915 tax_rate = 27 tax_per_item = 1 * tax_rate / 100 total_cost_before_tax = quantity * 1 total_tax = quantity * tax_per_item total_cost_including_tax = total_cost_before_tax + total_tax result = total_cost_including_tax return result
Aaron noticed a school of fish swimming together in a tank. One fifth of the fish swam into a hollow rock inside the tank. Then, 5 more fish joined the school, leading to the new number of fish being 16. How many fish were originally in the school Aaron saw in the tank?
def solve() -> int: x = (16 - 5) * 5 / 4 result = int(x) return result
John has $500 and spends $50 every week on groceries. How much money will he have after 6 weeks?
def solve() -> int: initial_money = 500 spent_on_groceries = 50 * 6 remaining_money = initial_money - spent_on_groceries result = remaining_money return result
Mark has 30 pounds of pork. He will use 12 pounds of pork to make pulled pork, which requires 0.5 pounds of pork per serving. The remaining 18 pounds of pork will be used to make pork chops, which require 0.2 pounds of pork per chop. If he sells the pulled pork for $8 per serving and the pork chops for $3 per chop, how...
def solve() -> int: pork_total = 30 pulled_pork = 12 pork_chops = pork_total - pulled_pork pulled_pork_servings = pulled_pork / 0.5 pork_chops_amount = pork_chops / 0.2 pulled_pork_earnings = pulled_pork_servings * 8 pork_chops_earnings = pork_chops_amount * 3 total_earnin...
arah has 5 bags of chips. Each bag has 6 chips. How many chips does Sarah have in total?
def solve() -> int: num_bags = 5 chips_per_bag = 6 total_chips = num_bags * chips_per_bag result = total_chips return result
A factory produces 2000 pencils in a day. Every day, 10% of the pencils are defective and have to be thrown away. How many pencils are left at the end of the day?
def solve() -> int: pencils_produced = 2000 defective_pencils = pencils_produced * 0.1 pencils_left = pencils_produced - defective_pencils result = pencils_left return result
Alice read a book that had 240 pages in 6 days. She read the same number of pages every day. How many minutes did Alice spend reading per day, if she read at a rate of 20 pages per hour?
def solve() -> int: pages_per_day = 240 / 6 hours_per_day = pages_per_day / 20 minutes_per_day = hours_per_day * 60 minutes_per_day = round(minutes_per_day) result = minutes_per_day return result
Irene buys 7 jewellery for $4.80 each. She is charged 11% tax for the items. After paying, she adds a 12 dollar tip. How much money did Irene spend?
def solve() -> int: number_of_items = 7 price_per_item = 4.80 tax_as_percent = 11 tip = 12 total_cost = number_of_items * price_per_item tax = total_cost * tax_as_percent / 100 total_cost_with_tax = total_cost + tax total_cost_with_tip = total_cost_with_tax + tip ...
Dr. Gan bought 220 donuts at 42 cents each. How much did Dr. Gan spend in total?
def solve() -> int: numDonuts = 220 costPerDonut = 0.42 totalCost = numDonuts * costPerDonut result = totalCost return result