question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: Molly and Alice are going to a fashion show. Molly has 3 tops, 4 skirts and 2 bags. Alice has 2 tops, 6 skirts and 1 bag. How many more items do they have if they combine their outfits?
def solve() -> int: molly_tops = 3 molly_skirts = 4 molly_bags = 2 alice_tops = 2 alice_skirts = 6 alice_bags = 1 molly_items = molly_tops + molly_skirts + molly_bags alice_items = alice_tops + alice_skirts + alice_bags combined_items = molly_items + alice_items result = combined...
A company sells 2000 units of product B every month. The production cost per unit is $20, and the selling price per unit is $30. How much profit does the company make in one year?
def solve() -> int: profit_per_unit = 30 - 20 profit_per_month = profit_per_unit * 2000 profit_per_year = profit_per_month * 12 result = profit_per_year return result
A clothing store is having a sale of 30% off the full price. If a shirt originally costs $25 and is on sale, how much does it cost now?
def solve() -> int: full_price = 25.00 discount = 0.30 total_cost = full_price * (1-discount) result = total_cost return result
Lily is having a baby shower. She invites 5 of her colleagues and 15 of her family members. Each guest requests to bring a plus one. How many people will be attending Lily's baby shower?
def solve() -> int: colleagues = 5 family_members = 15 total_guests = colleagues + family_members plus_ones = total_guests total_attendees = total_guests + plus_ones result = total_attendees return result
Miss Johnson has 46 pens. She wants to divide them equally among her 12 students. How many pens will each student get and how many pens will she have left?
def solve() -> int: pens = 46 students = 12 pens_per_student = pens // students leftover_pens = pens % students result = (pens_per_student, leftover_pens) return result
A pizza with a radius of 8 inches costs $10. What is the cost of a pizza with a 10-inch radius?
def solve() -> int: area_ratio = (10**2)/(8**2) cost_of_10_inch_pizza = area_ratio * 10 result = cost_of_10_inch_pizza return result
Student: Amy is making a cake and the recipe calls for 450grams of sugar. She has packets of sugar in her pantry, each packet containing 75 grams. How many packets of sugar does Amy need to use for the cake?
def solve() -> int: sugar_needed = 450 sugar_per_packet = 75 packets_needed = sugar_needed // sugar_per_packet result = packets_needed return result
Lily and Max went to the candy store to buy some chocolates and candies. Max bought 2 times more chocolates and candies than Lily. If Max bought 16 chocolates and 24 candies, how many chocolates and candies did Lily buy in total?
def solve() -> int: lily_chocolates = 16 / (2 + 1) lily_candies = 24 / (2 + 1) lily_total = lily_chocolates + lily_candies result = lily_total return result
A recipe serves six people. How many servings will translate into 48 pancakes?
def solve() -> int: serving_size = 6 pancakes = 48 servings = pancakes / serving_size result = servings return result
A store has 200 pens. They sold 75 of the pens and then received a shipment of 50 pens. How many pens does the store have now?
def solve() -> int: pens = 200 pens = pens - 75 pens = pens + 50 result = pens return result
Student: The price of a car is $25,000. If the car is sold at a 10% discount, what is the new price of the car?
def solve() -> int: price = 25000 discount = 0.1 * price new_price = price - discount result = new_price return result
Student: James is planning a road trip with his friends and wants to estimate the cost of gas. He knows that his car has a fuel efficiency of 25 miles per gallon and that the average price of gas is $2.50 per gallon. He also knows that the total distance of the trip is 800 miles and that he will split the cost of gas w...
def solve() -> int: fuel_efficiency = 25 gas_price = 2.50 distance = 800 people = 4 gas_needed = distance / fuel_efficiency gas_cost = gas_needed * gas_price cost_per_person = gas_cost / people result = cost_per_person return result
Student: Sam collects stamps and has 120 stamps in his album. He buys 10 new stamps every month and also trades 4 stamps with his friends every week. How many stamps will he have in his album after a year (12 months)?
def solve() -> int: stamps_in_album = 120 new_stamps_per_month = 10 traded_stamps_per_week = 4 total_stamps = stamps_in_album + (new_stamps_per_month * 12) - (traded_stamps_per_week * 52) result = total_stamps return result
Kelly wants to bake a cake. She buys a pack of 36 eggs. She uses 3/5 of the eggs for the cake. How many eggs are left over?
def solve() -> int: pack_of_eggs = 36 eggs_used = pack_of_eggs * (3/5) eggs_remaining = pack_of_eggs - eggs_used result = eggs_remaining return result
A pack of pencils costs 5 dollars. Amy buys 2 packs of pencils and Ben buys 3 packs of pencils. They pay with a 20-dollar bill and a 10-dollar bill. How much change do they get?
def solve() -> int: cost = 5 total_cost = cost * 2 total_cost = total_cost + cost * 3 payment = 20 + 10 change = payment - total_cost result = change return result
ophia had $150. She gave 3/4 of her money to her friend and 5/12 of her money to her sister. How much money did Sophia have left?
def solve() -> int: money = 150 friend = money * (3/4) sister = money * (5/12) remain = money - friend - sister result = remain return result
A half gallon of ice cream costs $5.00. A gallon costs $10.50. Which is the better deal per quart and how much more is it per quart?
def solve() -> int: half_gallon_price = 5 gallon_price = 10.50 half_gallon_volume = 0.5*4 gallon_volume = 4 price_per_quart_for_half_gallon = half_gallon_price/half_gallon_volume price_per_quart_for_gallon = gallon_price/gallon_volume more_expensive_per_quart = price_per_quart_for_gallon -...
John has 20 candies and 8 lollipops. Katie wants to buy twice as many candies as John has and four times as many lollipops as John has. How many items does Katie want to have in total?
def solve() -> int: candy = 2 * 20 lollipop = 4 * 8 result = candy + lollipop return result
Michelle works as a nurse and earns $32 per hour. She works 60 hours per week. Anything over 40 hours per week is considered overtime and is paid at 1.5 times the normal rate. She wants to save $20,000 for a down payment on a house. How many weeks does she need to work to reach her savings goal?
def solve() -> int: hourly_rate = 32 weekly_hours = 60 overtime_threshold = 40 overtime_rate = 1.5 * hourly_rate savings_goal = 20000 regular_pay = hourly_rate * min(weekly_hours, overtime_threshold) overtime_pay = overtime_rate * max(weekly_hours - overtime_threshold, 0) weekly_pay...
Student: Violet has a garden with 6 types of trees. In her garden, she planted 10 rows with 17 trees in each row. She planted 3 times more orange trees than yellow trees, and 4 times more blue trees than yellow trees. How many yellow trees did Violet plant?
def solve() -> int: orange_trees = 0 yellow_trees = 0 blue_trees = 0 orange_trees = 3 * yellow_trees blue_trees = 4 * yellow_trees total_trees = 10 * 17 yellow_trees = total_trees / (3 + 4 + 1) result = yellow_trees return result
The sum of two numbers is 24. If one number is 2 more than the other, what are the two numbers?
def solve() -> int: result = (11, 13) return result
Student: Q8: A piece of string is 5 yards long. If each knot needs to be 4 inches apart, how many knots will there be?
def solve() -> int: length_string = 5 * 3 * 12 distance_knot = 4 num_knots = length_string // distance_knot result = num_knots return result
4. Abbi has 32 pencils and 8 less erasers than pencils. How many erasers does Abbi have?
def solve() -> int: total_pencils = 32 total_erasers = total_pencils - 8 result = total_erasers return result
A store sells T-shirts for $15 each. If they have a 10% discount for customers who buy 5 or more T-shirts, how much would it cost for someone to buy 6 T-shirts?
def solve() -> int: cost = 6 * 15 if cost >= 5 * 15: cost *= 0.9 result = cost return result
Mark is building a birdhouse. He needs 36 inches of wood for each side of the house, and there are four sides. In addition, he needs 24 inches of wood for the roof and floor. If Mark has three pieces of wood that are each 60 inches long, how much wood will he have left over?
def solve() -> int: side_length = 36 num_sides = 4 roof_floor_length = 24 num_roof_floor = 2 wood_needed = (side_length * num_sides) + (roof_floor_length * num_roof_floor) wood_available = 60 * 3 wood_left_over = wood_available - wood_needed result = wood_left_over return result
Bailey is putting together a puzzle using small and large pieces. For every 2 small pieces, she adds 1 large piece. She has room for 36 rows of pieces in total. If each row can hold 10 small pieces, how many large pieces will she have in total?
def solve() -> int: small_pieces_per_row = 10 total_rows = 36 total_small_pieces = small_pieces_per_row * total_rows total_large_pieces = total_small_pieces // 2 result = total_large_pieces return result
A school has 450 students and 30 teachers. What is the student to teacher ratio?
def solve() -> int: student_teacher_ratio = 450/30 result = student_teacher_ratio return result
Joey wants to choose between two routes to reach his home. Route A is 12 kilometers and mostly downhill so he can cover it at a speed of 6 kilometers per hour. Route B is 16 kilometers and mostly uphill, so Joey can only cover it at 4 kilometers per hour. He will have to take a 20-minute break halfway through. How many...
def solve() -> int: route_a_distance = 12 route_a_speed = 6 route_b_distance = 16 route_b_speed = 4 break_time = 20 route_a_time = route_a_distance / route_a_speed route_b_time = route_b_distance / route_b_speed + break_time / 60 time_difference = route_b_time - route_a_time ...
Student: Ben had $50 and his dad had $100. They went to a toy store where they bought a Lego set for $40, a board game for $20, and a stuffed animal for $10. They also got a 10% discount on the total purchase. The tax came to $7.50. How much change should they have received in total?
def solve() -> int: ben_money = 50 dad_money = 100 lego_set = 40 board_game = 20 stuffed_animal = 10 total_purchase = lego_set + board_game + stuffed_animal discount = total_purchase * 0.1 total_after_discount = total_purchase - discount tax = total_after_discount * 0.075 total_a...
A snail is racing across a garden path at 3ft per minute. If the garden path is 360ft long, how many minutes will the snail take to reach the end?
def solve() -> int: distance = 360 speed = 3 minutes = 0 while distance > 0: minutes += 1 distance -= speed result = minutes return result
You have 30 employees. If you want to divide them evenly into teams of 5, how many teams can you form?
def solve() -> int: num_employees = 30 num_per_team = 5 num_teams = num_employees // num_per_team result = num_teams return result
A farmer has 24 chickens and 12 cows. He sells each chicken for $8 and each cow for $120. How much money does he make in total from selling all his animals?
def solve() -> int: chicken_income = 24 * 8 cow_income = 12 * 120 total_income = chicken_income + cow_income result = total_income return result
Student: A farmer harvested 200 pounds of apples in a season. If one apple weighs 1/3 of a pound, how many apples did the farmer harvest?
def solve() -> int: pounds = 200 weight_of_one_apple = 1/3 number_of_apples = pounds / weight_of_one_apple result = number_of_apples return result
ally is trying to save money and has a goal of $1,000. If she saves $50 each week, how many weeks will it take her to reach her goal?
def solve() -> int: goal = 1000 weekly_savings = 50 weeks_to_save = goal//weekly_savings result = weeks_to_save return result
A rectangle has a length of 5cm and a width of 3cm. What is its perimeter?
def solve() -> int: length = 5 width = 3 perimeter = (2 * length) + (2 * width) result = perimeter return result
Tina bakes 10 cupcakes every day from Monday to Thursday. On Friday and Saturday, she bakes 20 cupcakes each day. She also bakes 12 cupcakes on Sunday. How many cupcakes does Tina bake in 2 weeks?
def solve() -> int: monday_to_thursday = 10 * 4 friday_and_saturday = 20 * 2 sunday = 12 total_cupcakes = (monday_to_thursday + friday_and_saturday + sunday) * 2 result = total_cupcakes return result
Danielle does yoga for 1 hour every weekday and has done this consistently for 4 years. How many hours has she spent doing yoga?
def solve() -> int: weekday_hours = 1 years = 4 total_hours = weekday_hours * 5 * 52 * years result = total_hours return result
A wizard has collected 65 gold coins, 50 silver coins, and 13 copper coins. If each silver coin is worth 8 copper coins, and each gold coin is worth 5 silver coins, what is the total value of his coins expressed as a number of copper coins?
def solve() -> int: total_money = 0 total_money = 65*5*8 + 50*8 +13 result = total_money return result
A company’s annual budget is $100,000. If the company spends $30,000 on salaries per quarter, how much money is left at the end of the year?
def solve() -> int: budget = 100_000 salary_per_quarter = 30_000 budget_left = budget - (salary_per_quarter * 4) result = budget_left return result
Possible questions and programs: Amy is making a quilt for her grandmother. She needs 6 squares of fabric of the same size for each row, and 8 rows in total. Each square of fabric has an area of 36 square inches. How much fabric does she need total?
def solve() -> int: squares = 6 * 8 area = 36 * squares result = area return result
A train travels 300 miles in 5 hours. What is the average speed of the train in miles per hour?
def solve() -> int: distance = 300 time = 5 speed = distance / time result = speed return result
A delivery truck can carry 300 packages in one trip. If there are 1800 packages total, how many trips does the delivery truck need to make?
def solve() -> int: total_packages = 1800 packages_per_trip = 300 trips_needed = total_packages // packages_per_trip result = trips_needed return result
If a shirt is on sale for 20% off its original price of $30, what is its sale price?
def solve() -> int: original_price = 30 percent_off = 20 discount = original_price * (percent_off/100) sale_price = original_price - discount result = sale_price return result
A car travels 480 km in 6 hours. What is the average speed of the car?
def solve() -> int: distance = 480 time = 6 average_speed = distance/time result = average_speed return result
Student: A store is offering a 20% discount on all shirts. If a shirt originally costs $25, what is the new price?
def solve() -> int: original_price = 25 discount_percentage = 20 discount_amount = original_price * (discount_percentage / 100) new_price = original_price - discount_amount result = new_price return result
Tom has 35 cookies and wants to share them equally among his 5 friends. How many cookies will each person get?
def solve() -> int: cookies = 35 friends = 5 cookies_per_person = cookies // friends result = cookies_per_person return result
Student: Bobby is getting ready for an outdoor adventure. He bought a compass that cost $30, 3 jackets that cost $40 each, and 8 boxes of energy bars that cost $2.5 each. How much did he spend in total?
def solve() -> int: compass_cost = 30 jacket_cost = 40 num_jackets = 3 energy_bar_cost = 2.5 num_energy_bars = 8 total_cost = compass_cost + (jacket_cost * num_jackets) + (energy_bar_cost * num_energy_bars) result = total_cost return result
Amy has a budget of $75 for buying groceries. If she has already spent $54.80, how much more can she spend?
def solve() -> int: budget = 75 spent = 54.8 remaining = budget - spent result = remaining return result
Michael has 7 more than six times the number of markers as Sarah. If Sarah has 12 markers, how many markers do the two have together?
def solve() -> int: marker_sarah = 12 marker_michael = 6 * marker_sarah + 7 marker = marker_sarah + marker_michael result = marker return result
Mark's burger recipe makes enough for 8 people and calls for 2 pounds of ground beef. He only wants to make enough for 2 people for lunch. How much ground beef will he need?
def solve() -> int: people_recipe = 8 beef_recipe = 2 people_lunch = 2 beef_lunch = (people_lunch / people_recipe) * beef_recipe result = beef_lunch return result
Lily went to buy 20 cherries. She kept one third of the cherries for herself, then planted a tree from the remaining cherries for each cherry she did not keep. How many cherries did Lily plant trees from?
def solve() -> int: total_cherries = 20 kept_cherries = total_cherries / 3 remaining_cherries = total_cherries - kept_cherries num_trees = remaining_cherries planted_cherries = num_trees * 1 result = planted_cherries return result
The cost of a plane ticket to Europe is $800, and this can take you to any city on the continent before returning. Emily wanted to backpack through Europe for 2 months and spent 1/3 of the travel money on lodging. How much did she spend in total?
def solve() -> int: ticket_cost = 800 months = 2 lodging_percentage = 1/3 total_cost = ticket_cost + (ticket_cost * lodging_percentage) result = total_cost * months return result
A bakery has 18 cupcakes, but sells 4. Then, they bake 9 more. If they give away 1 cupcake for a promotion, how many cupcakes do they have left?
def solve() -> int: cupcakes = 18 cupcakes = cupcakes - 4 cupcakes = cupcakes + 9 cupcakes = cupcakes - 1 result = cupcakes return result
``` If 5 items cost $10.50, what is the price for 12 items?
def solve() -> int: item_amt = 5 item_cost = 10.50 price_per_item = item_cost / item_amt total_price = price_per_item * 12 result = total_price return result
Angela had saved $420 in her secret box. She had made a bet with her sister that the Pacers will win the game. If she won the bet, her sister had agreed to give her three times the amount of money she had in her secret box. Calculate the total amount of money Angela was entitled to get from her sister?
def solve() -> int: secret_box_amount = 420 bet_multiplier = 3 result = secret_box_amount * bet_multiplier return result
A group of 6 colleagues is planning to go on a road trip. They need to pack snacks for the trip, and each pack contains 10 items and costs $15. If they plan to bring at least 3 packs, how much will each colleague pay if they decided to split the cost equally?
def solve() -> int: num_colleagues = 6 num_packs = 3 items_per_pack = 10 cost_per_pack = 15 total_items = num_packs * items_per_pack total_cost = num_packs * cost_per_pack cost_per_colleague = total_cost / num_colleagues result = cost_per_colleague return result
Nikki has 30 marbles in a bag. If she gives away 2/3 of her marbles to her friends, how many marbles does she have left?
def solve() -> int: marbles_in_bag = 30 marbles_given_away = (2/3) * marbles_in_bag marbles_left = marbles_in_bag - marbles_given_away result = marbles_left return result
A student receives 10% off of their textbook purchase of $200. If the student also has a $20 coupon, how much do they actually pay at checkout?
def solve() -> int: original_price = 200 discount_percent = 0.1 discounted_price = original_price * (1 - discount_percent) total_price = discounted_price - 20 result = total_price return result
Emily's restaurant had 50 customers each day for the first 6 days and then on the last day of the week it had six times as many customers as every other day combined. If she charges $10 per meal, how much did she make that week?
def solve() -> int: customers_first_six_days = 50 * 6 customers_last_day = customers_first_six_days * 6 total_customers = customers_first_six_days + customers_last_day total_revenue = total_customers * 10 result = total_revenue return result
Student: - Tom wants to make his own postcards. He needs cardboard, markers, stamps, and envelopes. He has $20 for supplies. He buys one piece of cardboard for $2, which he can cut into 8 postcards. He also buys one pack of markers for $5, which has 10 colors. He needs one stamp for each postcard, which costs $0.5 each...
def solve() -> int: cardboard_price = 2 postcards_from_cardboard = 8 markers_price = 5 markers_colors = 10 stamp_price = 0.5 envelope_price = 0.1 total_cost = cardboard_price + markers_price + (stamp_price * postcards_from_cardboard) + (envelope_price * postcards_from_cardboard) postcard...
A bakery sells cupcakes for $1.50 each and muffins for $2.00 each. On Monday, the bakery sold 36 cupcakes and 24 muffins. On Tuesday, the bakery sold 28 cupcakes and 32 muffins. How much more money did the bakery earn on Tuesday than on Monday?
def solve() -> int: monday_cupcakes = 36 * 1.5 monday_muffins = 24 * 2 monday_revenue = monday_cupcakes + monday_muffins tuesday_cupcakes = 28 * 1.5 tuesday_muffins = 32 * 2 tuesday_revenue = tuesday_cupcakes + tuesday_muffins revenue_difference = tuesday_revenue - monday_revenue result ...
If the surface area of a cube is 1000 square centimeters, what is the volume of the same cube?
def solve() -> int: surface_area = 1000 edge_length = surface_area ** (1/2) volume = edge_length **3 result = volume return result
Jake needs to hydrate his flowers. Each rose needs three times as much water as a daisy, and the sunflowers need 30 gallons of water. If Jake has 12 daisies and 6 roses, and each daisy needs 1 gallon of water, how many gallons of water does Jake need to bring?
def solve() -> int: daisies = 12 roses = 6 sunflowers = 30 daisy_water = 1 rose_water = daisy_water * 3 total_daisy_water = daisies * daisy_water total_rose_water = roses * rose_water total_sunflower_water = sunflowers total_water_needed = total_daisy_water + total_ros...
Student: There are 13 cards on the table. Taking away 5 cards and then adding 4 cards would leave half as many cards as if 6 were taken away. How many cards were originally on the table?
def solve() -> int: cards = 13 result = cards return result
A pizza is divided into 8 slices. If 3 people eat 2 slices each, and 1 person eats 3 slices, how many slices are left?
def solve() -> int: slices_per_pizza = 8 people_1 = 3 people_2 = 1 slices_eaten_1 = 2 * people_1 slices_eaten_2 = 3 * people_2 total_slices_eaten = slices_eaten_1 + slices_eaten_2 slices_left = slices_per_pizza - total_slices_eaten result = slices_left return result
A water bottle can hold 800 milliliters of water. If Amy fills the bottle to the brim and drinks 100 milliliters every hour, how much water is left in the bottle after 7 hours?
def solve() -> int: bottle_capacity = 800 drink_rate = 100 hours = 7 water_drank = drink_rate * hours result = bottle_capacity - water_drank return result
Emma buys 7 books and each of them costs 2.5$. What is the total cost of her books?
def solve() -> int: book_cost = 2.5 num_books = 7 total_cost = book_cost * num_books result = total_cost return result
Two freight trains are going to the same city, but each has a different number of cargo. The first train has 75 tons of cargo, the second has 90 tons of cargo. A train can go 120 MPH without any cargo, but each ton of cargo makes it go 1 MPH slower. What is their average speed?
def solve() -> int: cargo_train_1 = 75 cargo_train_2 = 90 speed_train_1 = 120 - cargo_train_1 speed_train_2 = 120 - cargo_train_2 average_speed = (speed_train_1 + speed_train_2) / 2 result = average_speed return result
How many different 7-digit numbers can be formed using each of the digits 2, 3, 4, 5, 6, 7, 8 exactly once?
def solve() -> int: from math import factorial as fact digits_available = 7 arrangements = fact(digits_available) result = arrangements return result
If the number of books in a library was originally one-sixth the number of magazines in the library before 25 new books were donated, and now there are three times as many books as magazines, how many magazines were in the library, to begin with, if there are 75 books now?
def solve() -> int: books_now = 75 books_before_donation = books_now - 25 magazines_before = books_before_donation * 6 magazines_now = books_now / 3 magazines_begin = magazines_before result = magazines_begin return result
If a cell phone plan costs $30 per month plus $0.10 per minute of talking time, how many minutes can you talk if you have $50 for the monthly bill?
def solve() -> int: monthly_bill = 50 fixed_cost = 30 variable_cost_per_minute = 0.1 max_minutes = (monthly_bill - fixed_cost) / variable_cost_per_minute result = max_minutes return result
A recipe calls for 3/4 cups of sugar. If you want to make 2/3 of the recipe, how much sugar will you need?
def solve() -> int: original_sugar = 3/4 portion = 2/3 new_sugar = original_sugar*portion result = new_sugar return result
Tyler had $225 in his savings account. He withdrew $50 per week for 4 weeks. How much money does he now have?
def solve() -> int: savings = 225 withdrawal = 50 weeks_withdrawing = 4 new_savings = savings - (withdrawal * weeks_withdrawing) result = new_savings return result
A sink is being drained through a pipe and filled with a tap. The pipe can drain the sink in 10 minutes and the tap can fill the sink in 2 minutes. The sink can hold 20 gallons of water. If the sink starts filled with water, how much water will be left after 4 minutes?
def solve() -> int: pipe_rate = 1/10 tap_rate = 1/2 sink_capacity = 20 drained_water = 4 * pipe_rate filled_water = 4 * tap_rate net_change = filled_water - drained_water water_left = sink_capacity - net_change result = water_left return result
A flower bed has 8 rows of 12 flowers each. If each flower blooms for 3 days, how many flowers will bloom in a month?
def solve() -> int: total_flowers_in_bed = 8 * 12 total_days = 30 total_flowers_in_a_month = total_flowers_in_bed * (total_days // 3) result = total_flowers_in_a_month return result
John is making a tablecloth for his dining table. He needs to make a rectangular cloth that measures 10 feet by 8 feet. If the material he uses costs $6 per square foot, how much does he spend on the material in total?
def solve() -> int: length = 10 width = 8 area = length * width cost_per_square_foot = 6 total_cost = area * cost_per_square_foot result = total_cost return result
Emily needs to paint a room that is 10 feet high, 12 feet long, and 8 feet wide. If she buys a can of paint that covers 20 square feet, how many cans of paint does she need to buy?
def solve() -> int: height = 10 length = 12 width = 8 coverage = 20 total_area = 2 * (length * height + width * height) + length * width cans_needed = total_area / coverage result = cans_needed return result
Jenna attends 8 classes in a day, 2 of which are sports classes lasting a total of 2 hours. What is the average duration of one of her remaining classes in minutes if she stays for 9 hours?
def solve() -> int: hours_in_a_day = 24 minutes_in_an_hour = 60 total_classes = 8 sports_classes = 2 total_hours = 9 remaining_classes = total_classes - sports_classes remaining_hours = total_hours - (sports_classes * 2) average_duration = remaining_hours / remaining_class...
A pizza is cut into 8 slices. If 3 people each have 2 slices, and 2 people each have 3 slices, how many slices are left?
def solve() -> int: total_slices = 8 slices_eaten = (3 * 2) + (2 * 3) slices_left = total_slices - slices_eaten result = slices_left return result
A tree has 7 branches. Each branch has 20 leaves, except for the top two branches. The top two branches have each 5 leaves less than the others. How many leaves does the tree have in total?
def solve() -> int: branches = 7 leaves_per_branch = 20 leaves_per_top_branch = leaves_per_branch - 5 total_leaves = (branches - 2) * leaves_per_branch + 2 * leaves_per_top_branch result = total_leaves return result
Ethan wants to build his strength by lifting weights, but he can only lift a third of what his friend Tyler can. Tyler can lift 150 pounds. As Ethan gets stronger, he adds 15 more pounds to his maximum lift. Tyler follows this and reaches his peak at 270 pounds. If Ethan reaches his absolute peak and can lift half of w...
def solve() -> int: tyler_max_lift = 270 ethan_max_lift = tyler_max_lift / 2 ethan_start_lift = ethan_max_lift - 15 ethan_increase = ethan_max_lift - ethan_start_lift result = ethan_increase return result
If a rectangle is 5 meters wide and the perimeter is 20 meters, what is the length of the rectangle?
def solve() -> int: width = 5 perimeter = 20 length = (perimeter - 2*width) / 2 result = length return result
Mark has a coupon that gives him a 20% discount on a bike that costs $150. How much does he save with the coupon?
def solve() -> int: tenpercent = 150 / 10 discount = tenpercent * 2 saved = discount result = saved return result
In two years, Lucy will be four times older than her little brother. If her little brother is currently 4 years old, how old is Lucy?
def solve() -> int: little_brother_age = 4 lucy_age_in_two_years = 4 * (little_brother_age + 2) lucy_age = lucy_age_in_two_years - 2 result = lucy_age return result
Student: Q1: Sean saved $25 and his friend gave him an additional $10. He bought 5 books that costed $8 each, 1 teddy bear that costs $20 and 3 chocolates that cost $2 each. How much money does he have left after the purchase?
def solve() -> int: saved = 25 additional = 10 books = 5 book_price = 8 teddy_bear = 1 teddy_bear_price = 20 chocolates = 3 chocolate_price = 2 total_cost = books * book_price + teddy_bear * teddy_bear_price + chocolates * chocolate_price total_money = saved + additional resu...
A group of friends went to the beach and decided to share the cost of a $200 rental equally. If there were 7 friends present, how much did each person pay?
def solve() -> int: cost_per_person = 200/7 result = round(cost_per_person, 2) return result
Marie earns $3,400 a month and her electric and water bill costs $240 each month. Her monthly food expense is $420 and her car and house insurance cost 1/3 and 2/5 of what she earns respectively. How much money does she have left after paying those four bills?
def solve() -> int: electric_water_cost = 240 food_cost = 420 monthly_salary = 3400 x = (1/3)*monthly_salary car_insurance_cost = x y = (2/5)*monthly_salary house_insurance_cost = y total_cost = electric_water_cost + food_cost + car_insurance_cost + house_insurance_...
Student: John is making a recipe that requires 3/4 cup of milk. If he wants to make 4 times the recipe, how much milk will he need?
def solve() -> int: milk_one = 3/4 scale = 4 milk_four = milk_one * scale result = milk_four return result
Student: Liam and his mom go to the grocery store to buy some food for the week. Liam buys 5 apples, 3 bananas, 2 oranges, and 1 pineapple. Each apple costs $0.5. Each banana costs $0.4. Each orange costs $0.8. Each pineapple costs $3. If Liam's mom pays for 60% of the total cost of all the fruit, how much does Liam pa...
def solve() -> int: apple_cost = 0.5 banana_cost = 0.4 orange_cost = 0.8 pineapple_cost = 3 apple_num = 5 banana_num = 3 orange_num = 2 pineapple_num = 1 total_cost = apple_cost * apple_num + banana_cost * banana_num + orange_cost * orange_num + pineapple_cost * pineapple_num mom...
A gym charges $50 per month and $10 per personal training session. If you take 8 personal training sessions this month, how much do you pay in total?
def solve() -> int: num_sessions = 8 monthly_cost = 50 total_cost = monthly_cost + (num_sessions * 10) result = total_cost return result
Mark's new game sold 2 million copies. He got an advance to pay for 500,000 copies. He gets $10 for each copy sold. His game store takes 20% of that. How much money did he earn not including the advance amount?
def solve() -> int: copies_sold = 2000000 advance_copies = 500000 price_per_copy = 10 store_cut_percentage = 20 total_earnings = (copies_sold - advance_copies) * price_per_copy store_cut = total_earnings * store_cut_percentage / 100 earnings_without_advance = total_earnings - store_cut ...
David is making a rectangular wooden platform. The width of the platform is 6 feet and the length is 10 feet. If each gallon of varnish covers 40 square feet, how many gallons of varnish does David need to coat the platform? Sarah is three times older than Emma. In 5 years, Emma's current age will be 10. How old is Sar...
def solve() -> int: width = 6 length = 10 area = width * length varnish_coverage = 40 varnish_needed = area / varnish_coverage result = varnish_needed Emma_age_in_5_years = 10 Emma_current_age = Emma_age_in_5_years - 5 Sarah_age = Emma_current_age * 3 result = Sara...
A cake recipe needs 5 tablespoons of sugar, but Laura only has teaspoon measurements. How many teaspoons is the same as 5 tablespoons?
def solve() -> int: tablespoons = 5 teaspoons = 0 teaspoons = tablespoons * 3 result = teaspoons return result
Jonathan spent 1/3 of his paycheck on rent. He then spent 1/5 of the remaining money on a gym membership. If he only has $200 left, how much was his paycheck?
def solve() -> int: paycheck = 0 rent = 0 gym_membership = 0 rent = paycheck / 3 remaining_money = paycheck - rent gym_membership = remaining_money / 5 remaining_money -= gym_membership if remaining_money == 200: result = paycheck else: result...
The sum of the ages of three girls is 28. Two of the girls are the same age and the third is twice the age of the other two. How old are three girls?
def solve() -> int: total = 28 age_1 = total // 3 age_2 = age_1 * 2 result = age_1, age_1, age_2 return result
A stationery store has 24 notebooks, 15 pens, and 10 highlighters for sale. The notebooks are priced at $6 each, the pens are priced at $2 each, and the highlighters are priced at $1 each. If the store spent $95 to buy everything and sells all of the merchandise, how much profit will they make?
def solve() -> int: total_cost = (24*6) + (15*2) + (10*1) total_income = (24*6) + (15*2) + (10*1) profit = total_income - total_cost result = f'<<<${profit}>>>' result = profit return result
Student: A class has 24 students, including 12 boys and 12 girls. If 1 boy and 3 girls are absent, what is the ratio of boys to girls present?
def solve() -> int: boys = 12 girls = 12 absent_boys = 1 absent_girls = 3 present_boys = boys - absent_boys present_girls = girls - absent_girls result = present_boys / present_girls return result
You are buying a new computer with a list price of $2000, but you get a 25% discount due to a promotion. How much do you end up paying?
def solve() -> int: list_price = 2000 discount = 0.25 final_price = list_price*(1-discount) result = final_price return result
A store sells clothes with a 35% discount during a sale. If a dress originally costs $120, how much will it cost during the sale?
def solve() -> int: original_price = 120 discount_percent = 0.35 discounted_price = original_price * (1 - discount_percent) result = discounted_price return result
At the Mexican restaurant, Miguel orders a burrito, his friend orders a quesadilla, his sister orders tacos, and his mother orders a fajita. The burrito has 2 toppings, the quesadilla has 1 topping, and the fajita has 3 toppings. The tacos have half as many toppings as the burrito. How many toppings did the chef add in...
def solve() -> int: burrito_toppings = 2 quesadilla_toppings = 1 fajita_toppings = 3 tacos_toppings = burrito_toppings / 2 total_toppings = burrito_toppings + quesadilla_toppings + fajita_toppings + tacos_toppings result = total_toppings return result