question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A bus travels at a speed of 60 mph for the first half of a journey and then reduces its speed to 40 mph for the second half. If the total distance of the journey is 800 miles, how long does the whole journey take?
def solve() -> int: distance = 800 speed1 = 60 speed2 = 40 time1 = distance/2 / speed1 time2 = distance/2 / speed2 total_time = time1 + time2 result = total_time return result
A company has a budget of $500. They bought office supplies worth $235 and paid $75 to rent tables at a fair. How much money is left in their budget now?
def solve() -> int: Budget = 500 Office_supplies = 235 Rent = 75 remaining_budget = Budget - Office_supplies - Rent result = remaining_budget return result
In a factory, there are 50 workers. Of these, 20 are engineers and the remaining workers are technicians. If the engineers get paid twice as much as the technicians, how much do all the workers get paid in total?
def solve() -> int: total_workers = 50 engineers = 20 technicians = total_workers - engineers engineer_salary = 2 technician_salary = engineer_salary/2 total_salary = (engineer_salary*engineers)+(technician_salary*technicians) result = total_salary return result
hirley was filling up her car at the gas station, and she spent $53. She filled 9 gallons of gas. What was the cost per gallon?
def solve() -> int: cost = 53 gallons = 9 cost_per_gallon = cost / gallons result = cost_per_gallon return result
If a train travels at a speed of 50 mph for 3 hours, how far does it travel?
def solve() -> int: speed = 50 time = 3 distance = speed * time result = distance return result
Oliver is calculating his remaining expenses for the week and needs to find out how much he has left to pay his bills. His internet bill costs $60, and he has made four separate payments of $10 each. His water bill was $30 and he has already paid three-quarters of this. He then makes another payment of $5 towards it wh...
def solve() -> int: internet_bill = 60 internet_payments = 4 * 10 water_bill = 30 water_payments = 3/4 * water_bill additional_water_payment = 5 book_expense = 15 electricity_bill = 50 electricity_payment = 1/2 * electricity_bill total_expenses = internet_bill + w...
Student: Ms. Wong bought five times as many books for herself as she bought for her nephew. If the nephew received 12 books, how many books did Ms. Wong buy?
def solve() -> int: nephew_books = 12 wong_books = 5 * nephew_books total_books = wong_books + nephew_books result = total_books return result
Student: A bakery made 240 cupcakes and wants to package them in boxes that hold cupcakes in multiples of 8. How many boxes of 8 cupcakes will the bakery have left over?
def solve() -> int: cupcakes = 240 box_size = 8 num_boxes = cupcakes // box_size leftover_cupcakes = cupcakes % box_size leftover_boxes = leftover_cupcakes // box_size result = leftover_boxes return result
Ben sells lemonade for $0.50 per cup. He spends $10.00 to buy the ingredients and the cups. He sells 120 cups of lemonade in one day. How much profit does he make in one day?
def solve() -> int: revenue = 0.5 * 120 cost = revenue - 10 profit = revenue - cost result = round(profit, 2) return result
A boat can travel downstream 120 km in 8 hours and upstream 80 km in 10 hours. What is the speed of the boat in still water and the speed of the current?
def solve() -> int: distance_downstream = 120 time_downstream = 8 distance_upstream = 80 time_upstream = 10 speed_of_boat_in_still_water = (distance_downstream/time_downstream + distance_upstream/time_upstream)/2 speed_of_current = (distance_downstream/time_downstream) - speed_of_boat_in_still_w...
Student: A factory has 3 machines. Machine A can produce 100 units in 10 hours, machine B can produce 200 units in 12 hours and machine C can produce 140 units in 6 hours. What is the productivity of all three machines combined in 8 hours?
def solve() -> int: machine_a_units_per_hour = 100/10 machine_b_units_per_hour = 200/12 machine_c_units_per_hour = 140/6 total_units_per_hour = machine_a_units_per_hour + machine_b_units_per_hour + machine_c_units_per_hour total_units_in_8_hours = total_units_per_hour * 8 result = total_units_in...
David, Emma, and Frank collected cans and bottles to recycle. David collected 24 cans and 16 bottles, Emma collected 18 cans and 12 bottles, and Frank collected half as many cans and bottles as David and Emma combined. If they received $0.1 for each can and $0.2 for each bottle and then shared the money equally among t...
def solve() -> int: d_c = 24 d_b = 16 e_c = 18 e_b = 12 f_c = (d_c + e_c) // 2 f_b = (d_b + e_b) // 2 total_c = d_c + e_c + f_c total_b = d_b + e_b + f_b c_price = 0.1 b_price = 0.2 money = total_c * c_price + total_b * b_price share = money / 3 result = s...
8. How much did the airline make from the pre-bought tickets?
def solve() -> int: price_at_prebuy = 155 num_at_prebuy = 20 total_at_prebuy = num_at_prebuy * price_at_prebuy result = total_at_prebuy return result
A small pizza costs $10 and a large pizza costs $15. If you buy 3 small pizzas and 2 large pizzas, what is the total cost?
def solve() -> int: small_pizza_cost = 10 large_pizza_cost = 15 num_small_pizzas = 3 num_large_pizzas = 2 total_cost = (small_pizza_cost * num_small_pizzas) + (large_pizza_cost * num_large_pizzas) result = total_cost return result
A florist buys 200 roses for $400. She sells 1 rose for $5. If she sells all the roses, how much profit will she make?
def solve() -> int: price_per_rose = 5 total_earned = 200 * price_per_rose cost = 400 profit = total_earned - cost result = round(profit, 2) return result
Mr. Kim has 200 balloons. He inflates 50 of them and ties them to a string. He gives 20 balloons to his son and 30 balloons to his daughter. How many uninflated balloons does he have left?
def solve() -> int: inflated_balloons = 50 give_balloons = 20 + 30 uninflated_balloons = 200 - inflated_balloons - give_balloons result = uninflated_balloons return result
Jasmine has 32 stickers. She bought 4 more sheets of stickers with 6 stickers each. She also gave 5 stickers to her little sister. How many stickers does Jasmine have now?
def solve() -> int: stickers = 32 new_sheets = 4 * 6 sister = 5 total_stickers = stickers + new_sheets - sister result = total_stickers return result
Carlos gets a discount on his car insurance because of his age. If he turns 25 and loses his discount, but earns an extra $50/day working a temporary job, how much less money will he have in his pocket each month if his car insurance increases by $30/month?
def solve() -> int: age = 24 discount = 100 extra_income = 50 insurance_increase = 30 monthly_income_before = (30 * extra_income) + discount monthly_income_after = (30 * extra_income) - insurance_increase difference = monthly_income_before - monthly_income_after resul...
Tim bought 4 ties at $12 each and 2 suits at $100 each. How much money did he use to purchase these items if he gave $500?
def solve() -> int: price_ties = 4 * 12 price_suits = 2 * 100 total_price = price_ties + price_suits result = total_price return result
Her sister Tamy is 3 times Sue's age. How old will Tamy be in 12 years?
def solve() -> int: sueAge = 24 ageDifference = 3 numberOfYears = 12 tamyAge = sueAge + ageDifference * numberOfYears result = tamyAge return result
A company produces 6000 units of a product and sells them for $8 each. If the company's fixed costs are $20,000 and it costs $4 to produce each unit, what is the company's profit?
def solve() -> int: fixed_costs = 20000 units_produced = 6000 unit_production_cost = 4 unit_sales_price = 8 total_production_cost = unit_production_cost * units_produced total_sales_revenue = unit_sales_price * units_produced total_profit = total_sales_revenue - (fixed_costs + total_producti...
Lily is making lemonade for a fundraiser. She needs 4 lemons and 2 cups of sugar for each pitcher of lemonade. She buys 36 lemons and 15 cups of sugar from the store, and she already has 6 lemons and 4 cups of sugar at home. How many pitchers of lemonade can Lily make in total?
def solve() -> int: lemons_total = 36 + 6 sugar_total = 15 + 4 pitchers_lemons = lemons_total // 4 pitchers_sugar = sugar_total // 2 pitchers_total = min(pitchers_lemons, pitchers_sugar) result = pitchers_total return result
A recipe calls for 2/3 cup of flour and makes 9 cookies. If a baker wants to make 12 cookies, how much flour is needed?
def solve() -> int: cup_per_cookie = 2/27 desired_num_cookies = 12 needed_cup = cup_per_cookie * desired_num_cookies result = needed_cup return result
Emily sold t-shirts at a local concert. She bought 60 t-shirts for $5 each and sold each shirt for $15. She sold all but 10 shirts. What was her profit?
def solve() -> int: num_bought = 60 cost_per_shirt = 5 selling_price = 15 num_sold = num_bought - 10 total_cost = num_bought * cost_per_shirt total_revenue = num_sold * selling_price profit = total_revenue - total_cost result = profit return re...
Student: Julie has 3 boxes. 1 box has 24 crayons, another box has 14 colored pencils, and the last box has 12 markers. If a pack of markers has 6 markers inside, how many markers is she missing to complete her set?
def solve() -> int: crayons = 24 colored_pencils = 14 markers = 12 markers_per_pack = 6 packs = markers // markers_per_pack missing_markers = packs * markers_per_pack - markers result = missing_markers return result
Sarah has 40 apples and wants to sell them at a farmers market. She sells them in bags of 6. How many bags can she make, and how many apples will be left over?
def solve() -> int: apples = 40 apples_per_bag = 6 bags = apples // apples_per_bag leftover_apples = apples % apples_per_bag result = f'Sarah can make {bags} bags and will have {leftover_apples} apples left over.' return result
Paul has 4 times as many detective novels as historical novels in his collection. If Paul has 128 detective novels, how many historical novels does he have?
def solve() -> int: total_detective_novels = 128 total_historical_novels = total_detective_novels / 4 result = total_historical_novels return result
Olivia went to the movie theater and bought 3 tickets for her friends, 2 tickets for herself, and a bucket of popcorn. If Olivia spent a total of $40 and the popcorn cost $8, how much did each movie ticket cost?
def solve() -> int: num_friends = 3 num_self = 2 popcorn_cost = 8 total_cost = 40 ticket_cost = (total_cost - popcorn_cost) / (num_friends + num_self) result = ticket_cost return result
Below are some possible questions and python programs: - The local coffee shop sells 15 cups of coffee every 10 minutes during the morning rush, 7 am - 9 am. During the rest of the day, they sell 10 cups of coffee every 10 minutes. From 8 am to 10 am, how much revenue do they generate if each cup of coffee costs $2.50?...
def solve() -> int: morning_rush_cups = 15 * 6 rest_of_day_cups = 10 * 1 total_cups = morning_rush_cups + rest_of_day_cups revenue = total_cups * 2.50 result = revenue return result
Tom is half as old as Jerry. Jerry is 20 years old. Tom's brother Bob is 10 years older than Tom. How old is Bob?
def solve() -> int: jerry_age = 20 tom_age = jerry_age / 2 bob_age = tom_age + 10 result = bob_age return result
A coffee shop is comparing their day’s sales to their average. They usually sell 80 lattes and 40 espressos. Today they sold 75 lattes and 45 espressos. If lattes are sold for $5 and espressos are sold for $3, what is the difference, in dollars, between the coffee shop’s daily average and total for today?
def solve() -> int: lattes_average = 80 espressos_average = 40 lattes_today = 75 espressos_today = 45 latte_price = 5 espresso_price = 3 lattes_difference = lattes_today - lattes_average espressos_difference = espressos_today - espressos_average lattes_total = lattes_differ...
A grocery store sells apples and oranges. It has a rule that for every apple you buy, you must buy 5 oranges which cost 2/5 the price of the apples. If they sold 100 apples and earned $500, how much do oranges cost?
def solve() -> int: apples = 100 total_earnings = 500 price_per_apple = total_earnings / apples price_per_orange = (2/5) * price_per_apple result = price_per_orange return result
Kelly had 24 stickers in her album. She gave away 6 stickers to her friend and then received 5 plus half the number of stickers she had left. How many stickers does Kelly have in her album now?
def solve() -> int: stickers_left = 24 - 6 stickers_received = 5 + (stickers_left / 2) stickers_total = stickers_left + stickers_received result = stickers_total return result
A store offers a 20% discount on all items. If an item originally costs $50, what is the discounted price?
def solve() -> int: original_price = 50 discount_percent = 20 discount_amount = original_price * (discount_percent / 100) discounted_price = original_price - discount_amount result = discounted_price return result
Karen drinks 4 cups of water every day. If she drinks water for 5 days, how many cups of water did she drink in total?
def solve() -> int: cups_per_day = 4 days = 5 total_cups = cups_per_day * days result = total_cups return result
A gas tank can store 30 gallons of gasoline. If 9 gallons have already been used, how much gas remains?
def solve() -> int: total_gallons = 30 used_gallons = 9 remaining_gallons = total_gallons - used_gallons result = remaining_gallons return result
A product that originally costs $125 is on sale for $100 in a supermarket. If you have a coupon for a 10% discount, how much money will you save?
def solve() -> int: original_price = 125 discounted_price = 100 coupon_percent = 10 coupon_amount = coupon_percent/100 * discounted_price saved_amount = original_price - (discounted_price - coupon_amount) result = saved_amount return result
Student: A bag contains 12 marbles, if 6 of them are blue, how many are not blue?
def solve() -> int: total = 12 blue = 6 non_blue = total - blue result = non_blue return result
Student: Kristin has 6 boxes of crayons. Each box has 24 crayons. She used 10 crayons to draw a picture and then donated 2 boxes to her school. How many crayons does she have now?
def solve() -> int: boxes = 6 crayons_per_box = 24 used = 10 donated = 2 total = boxes * crayons_per_box used_and_donated = used + donated * crayons_per_box result = total - used_and_donated return result
A car travels at a speed of 50 km/h for the first hour, then it increases its speed by 20% for the second hour, and finally decreases its speed by 10% for the third hour. How far does the car travel in 3 hours?
def solve() -> int: distance_first_hour = 50 distance_second_hour = distance_first_hour * 1.2 distance_third_hour = distance_second_hour * 0.9 total_distance = distance_first_hour + distance_second_hour + distance_third_hour result = total_distance return result
Student: A 10-day car rental is normally $80 per day. The car rental company is currently offering a deal for $600 for the 10-day rental, plus a $20 credit for each day that the car is returned with a full tank of gas. How many dollars cheaper is the deal than the normal rental, assuming that the car is returned with a...
def solve() -> int: normal_rental = 80 deal_rental = 600 credit = 20 days = 10 normal_total = normal_rental * days deal_total = deal_rental + (credit * days) difference = normal_total - deal_total result = difference return result
Student: Greg went to buy 3 bags of chips and 5 bottles of soda with his mom. Each bag of chips cost $2.99 and each bottle of soda cost $1.69. His mom gave the cashier $20. How much change should Greg get?
def solve() -> int: bags = 3 chips_price = 2.99 bottles = 5 soda_price = 1.69 cash = 20 total_cost = bags * chips_price + bottles * soda_price change = cash - total_cost result = change return result
Alex is managing a team of 14 employees. He provides 7 laptops to share, with 2 employees sharing each laptop. Half of the employees complete 5 tasks each and the other half complete 6 tasks each. How many tasks are completed in total by the team?
def solve() -> int: employees = 14 laptops = 7 tasks_per_laptop = 5 + 6 tasks_completed = laptops * tasks_per_laptop result = tasks_completed return result
Susan bakes 24 cookies and sells 3 every day. After how many days will she have sold all the cookies?
def solve() -> int: cookies_baked = 24 cookies_sold_per_day = 3 days = cookies_baked // cookies_sold_per_day result = days return result
Jack had 90 trading cards in his collection. He lost a third of them while playing with them, gave 25 to his younger cousin, and then found 11 more in his closet. His dad then bought him nine times as many cards as he lost. How many trading cards does Jack have now?
def solve() -> int: cards_in_collection = 90 cards_lost = cards_in_collection / 3 cards_given_to_cousin = 25 cards_found_in_closet = 11 cards_bought_by_dad = 9 * cards_lost total_cards = cards_in_collection - cards_lost - cards_given_to_cousin + cards_found_in_closet + cards_bought_by_dad ...
Leo paints 5 pictures a month. In the first 4 months of the year, he painted 24 pictures in total. How many pictures a month does he have to paint in the remaining 8 months of the year to reach his target of 60 pictures for the year?
def solve() -> int: pictures_left = 60 - 24 pictures_per_month = pictures_left / 8 result = pictures_per_month return result
The temperature in my room is 26 degrees Celsius. If I want to increase the temperature by 10%, how many degrees should I increase it by?
def solve() -> int: room_temperature = 26 increase_percentage = 0.1 temperature_increase = room_temperature * increase_percentage result = temperature_increase return result
If Sammy rolls three six-sided dice, what is the probability of rolling a sum of 12?
def solve() -> int: dice_one = [1,2,3,4,5,6] dice_two = [1,2,3,4,5,6] dice_three = [1,2,3,4,5,6] result = len([(x,y,z) for x in dice_one for y in dice_two for z in dice_three if x + y + z == 12])/216 return result
John is twice as old as Karen. If John is 30 years old, how old is Karen?
def solve() -> int: age_john = 30 age_karen = age_john / 2 result = age_karen return result
Amy is sewing masks. She has 5 hours to make 100 masks, and each mask takes 15 minutes to sew and uses 0.5 meters of fabric. In the first hour, Amy sews 8 masks. The second hour she sews 10 masks. How many meters of fabric will Amy need to use per hour to finish the job?
def solve() -> int: total_hours = 5 total_masks = 100 mask_time = 15 mask_fabric = 0.5 first_hour = 8 second_hour = 10 remaining_hours = total_hours - 2 remaining_masks = total_masks - (first_hour + second_hour) fabric_needed = remaining_masks * mask_fabric ave...
If a rectangle has a perimeter of 144, and the length of the width is unknown, what is the length of the width?
def solve() -> int: perimeter = 144 length = perimeter / 2 width = perimeter / length result = round(width, 2) return result
A pool was being filled by two hoses. Hose A filled the pool with 2 gallons of water every 3 minutes, and hose B filled the pool with 3 gallons of water every 4 minutes. If the pool was initially empty, how many minutes did it take for the pool to be filled completely?
def solve() -> int: fill_rate_hose_a = 2 / 3 fill_rate_hose_b = 3 / 4 total_fill_rate = fill_rate_hose_a + fill_rate_hose_b time_to_fill_pool = 1 / total_fill_rate * 60 result = time_to_fill_pool return result
Maxine and Jude have four brothers and sisters altogether. Maxine has one brother while Jude has two. How many sisters do they have in total?
def solve() -> int: def sisters(a, b): total = a + b return total result = sisters(1, 2) return result
A group of 10 people buy a pizza for $12.50. If they split it evenly, how much does each person owe?
def solve() -> int: num_people = 10 total_cost = 12.5 cost_per_person = total_cost/num_people result = cost_per_person return result
A grocery store is having a sale where all items are 20% off. A customer bought a cart of groceries that cost $150 before the sale. What is the cost of the cart after the discount?
def solve() -> int: original_price = 150 discount_percent = 0.2 discount_amount = original_price * discount_percent price_after_discount = original_price - discount_amount result = price_after_discount return result
Possible questions and programs: Tony earned $50 a day. Every day, he spent $15 on lunch and saved the rest. After 30 days of work, he used his savings to buy a bike for $600. How much money did Tony have left after buying the bike?
def solve() -> int: daily_earnings = 50 lunch_cost = 15 work_days = 30 bike_cost = 600 total_earnings = daily_earnings * work_days total_spending = lunch_cost * work_days total_savings = total_earnings - total_spending remaining_money = total_savings - bike_cost ...
Student: A bank offers an interest of 5% on its savings account. If a customer deposits $1000 in the account, how much interest will they earn in 6 months?
def solve() -> int: principal = 1000 interest_rate = 0.05 time = 6 interest = principal * interest_rate * time total_amount = principal + interest result = total_amount - principal return result
A car travels 40 km/h for the first half of its journey and 60 km/h for the second half. If the journey is 480 km long, how long does it take to complete the journey?
def solve() -> int: time_for_first_half = 240/40 time_for_second_half = 240/60 total_time = time_for_first_half + time_for_second_half result = total_time return result
Student: Karen has been saving her allowance for the last 3 months. She saved $30 this month, $20 last month and $40 the month before. How much did she save in total in the last 3 months?
def solve() -> int: saved_this_month = 30 saved_last_month = 20 saved_two_months_ago = 40 total_saved = saved_this_month + saved_last_month + saved_two_months_ago result = total_saved return result
Student: 4. John buys a car for $5,000. He has to pay 0.75% of its worth in taxes every year. How much will he have to pay for 3 years?
def solve() -> int: car_price = 5000 tax_rate = 0.0075 years = 3 annual_tax = car_price * tax_rate total_tax = annual_tax * years result = total_tax return result
A car rental company charges $30 per day and $0.25 per mile driven. If Mark rents a car and drives 500 miles over 5 days, how much will he be charged?
def solve() -> int: rental_fee_per_day = 30 fee_per_mile = 0.25 number_of_days = 5 distance_driven = 500 rental_fee = number_of_days*rental_fee_per_day mileage_fee = fee_per_mile*distance_driven total_fee = rental_fee+mileage_fee result = total_fee return result
Mr. Brown purchased 10 pears for $4 each and sold them for $5 each. How much profit did he make?
def solve() -> int: price_bought = 4 price_sold = 5 num_pears = 10 total_income = price_sold*num_pears total_expense = price_bought*num_pears result = total_income - total_expense return result
Madison has 40 puzzles. Ethan has half as many puzzles as Madison. Michael has 10 more puzzles than Ethan. How many puzzles do they have in total?
def solve() -> int: madison = 40 ethan = madison / 2 michael = ethan + 10 total = madison + ethan + michael result = total return result
Student: Noah is taking his dog to the vet, which is 2 miles from his house. Then he will stop by the park, which is 4 miles from the vet and 3 miles from his house, to let his dog play for a while. After that, he will go to the pet store, which is 3 miles from the park and 6 miles from his house, to buy some treats. F...
def solve() -> int: house_to_vet = 2 vet_to_park = 4 park_to_store = 3 store_to_house = 6 total_distance = house_to_vet + vet_to_park + park_to_store + store_to_house result = total_distance return result
Troy buys 8 graphic novels for $20 each, 3 figurines for $10 each and a board game for $35. He pays with a $200 bill. How much change does he get?
def solve() -> int: price_novel = 20 quantity_novel = 8 price_figurines = 10 quantity_figurines = 3 price_game = 35 total_cost = price_novel*quantity_novel + price_figurines*quantity_figurines + price_game change = 200 - total_cost result = change return result
Richard bought 10 bags of birdseed for his birdhouse, with each bag containing 5 pounds of seed. He lost 2 pounds of seed from each bag due to spillage and had 35 pounds of seed left at the end. How many pounds of birdseed did he buy to start with?
def solve() -> int: num_bags = 10 bag_weight = 5 total_weight = num_bags * bag_weight lost_weight = num_bags * 2 remaining_weight = 35 start_weight = total_weight - lost_weight + remaining_weight result = start_weight return result
Isabella collected 120 stickers. She gave 6 stickers to each of her 12 friends. She gave everyone else in class 1 sticker each. If she has 18 stickers left over, how many students are in the class, including Isabella?
def solve() -> int: total_stickers = 120 num_friends = 12 stickers_per_friend = 6 total_stickers_friends = num_friends * stickers_per_friend stickers_left = total_stickers - total_stickers_friends num_students = stickers_left - 18 result = num_students + num_fri...
A teacher grades 30 papers every hour. If she has 120 papers to grade, how many hours will she need?
def solve() -> int: papers_graded_per_hour = 30 total_papers = 120 hours_needed = total_papers // papers_graded_per_hour result = hours_needed return result
A box of apples weighs 15 pounds. If each apple weighs 0.25 pounds, how many apples are there in the box?
def solve() -> int: box_weight = 15 apple_weight = 0.25 num_apples = box_weight / apple_weight result = num_apples return result
A store is having a sale where everything is 20% off. If a shirt originally costs $25, what is the discounted price?
def solve() -> int: original_price = 25 discount_rate = 0.2 discounted_price = original_price * (1 - discount_rate) result = discounted_price return result
Possible questions and programs: Lisa has 15 stickers and she gives some to her friends. She gives 3 stickers to Amy, 4 stickers to Ben, and 2 stickers to Chris. How many stickers does Lisa have left?
def solve() -> int: stickers = 15 stickers -= 3 stickers -= 4 stickers -= 2 result = stickers return result
Grace has $100 at the beginning of the month. She saves $50 on the 15th of the month and spends $20 every day until the end of the month. How much does she have at the end of the month?
def solve() -> int: beginning_of_month_savings = 100 mid_month_savings = 50 remaining_days = 31 - 15 remaining_spending = 20 * remaining_days total_savings = beginning_of_month_savings + mid_month_savings - remaining_spending result = total_savings return result
What is the volume of a cylinder with a diameter of 4 meters and a height of 8 meters?
def solve() -> int: radius = 4 / 2 pi = 3.14 volume_of_cylinder = pi * radius**2 * 8 result = volume_of_cylinder return result
Student: 2. Dale and Eric were washing a car. Dale took 1.5 hours to wash the car and Eric took 1 hour. How long did it take them to wash the car together?
def solve() -> int: dale_time = 1.5 eric_time = 1 total_time = dale_time + eric_time result = total_time return result
Isabella sold necklaces for $25 each or three for $60. If she started with 30 necklaces and made $375 from selling necklaces for $25 each, how much in total did she make from selling her necklaces?
def solve() -> int: necklaces_sold_for_25 = 375 / 25 necklaces_sold_for_60 = (30 - necklaces_sold_for_25) / 3 total_money_made = (necklaces_sold_for_25 * 25) + (necklaces_sold_for_60 * 60) result = total_money_made return result
You and your friend have to pay for internet connection fees of $25 each month. What is the total amount you need to pay for internet connection fees if you share it with your friend for one year?
def solve() -> int: total_cost = 25 * 12 result = total_cost return result
Joey and his 3 friends decided to share a certain amount of money between them. If Joey received twice as much as each of his friends, and they shared a total of $600, how much did Joey receive?
def solve() -> int: x = 600 y = x/4 z = 2*y result = z return result
Sarah is considering paying $10,000 for a new refrigerator that will last for 15 years, or paying $3,000 for a used refrigerator that will last for 5 years. How much money can she save by choosing the cheaper option?
def solve() -> int: new_cost = 10000 used_cost = 3000 new_lifespan = 15 used_lifespan = 5 new_cost_per_year = new_cost / new_lifespan used_cost_per_year = used_cost / used_lifespan savings_per_year = used_cost_per_year - new_cost_per_year total_savings ...
Student: Sarah buys 6 sandwiches for $5 each and splits the cost with her 3 friends. How much did each person pay?
def solve() -> int: sandwiches = 6 price = 5 friends = 3 total_cost = sandwiches * price average_cost = total_cost / (friends + 1) result = average_cost return result
Leo has a rectangular garden that measures 12 meters by 8 meters. He wants to fence the garden with wire mesh that costs $2 per meter. He also wants to leave a gap of 1 meter for a gate on one of the longer sides of the garden. How much money does he need to spend on the wire mesh?
def solve() -> int: length = 12 width = 8 cost_per_meter = 2 gate = 1 perimeter = 2 * (length + width) fence = perimeter - gate total_cost = fence * cost_per_meter result = f'Leo needs to spend ${total_cost} on the wire mesh.' result = total_cost return result
Student: John starts driving from point A and goes 57 miles west, then he turns south and drives 76 miles. How far is John from his starting point?
def solve() -> int: distance_west = 57 distance_south = 76 total_distance = distance_west + distance_south result = total_distance return result
Student: Taylor ate 4/5 of the whole pizza, how many 5ths of the pizza did Taylor eat?
def solve() -> int: fraction = 4/5 x = 4/5 result = x return result
Student: A recipe calls for 3/4 cup of flour. If you want to make half the recipe, how much flour do you need (in tablespoons)?
def solve() -> int: recipe_amount = 3/4 half_recipe_amount = recipe_amount / 2 tablespoon_per_cup = 16 half_recipe_amount_tablespoon = half_recipe_amount * tablespoon_per_cup result = half_recipe_amount_tablespoon return result
Daisy and Ella are sisters who share a piggy bank. Daisy puts 25 cents into the piggy bank every day, and Ella puts 15 cents into the piggy bank every day. At the beginning of the week, the piggy bank had $2.50 in it. How much money will the piggy bank have at the end of the week (after 7 days)?
def solve() -> int: daisy_cents = 25 ella_cents = 15 initial_money = 2.50 daisy_total_cents = daisy_cents * 7 ella_total_cents = ella_cents * 7 total_cents = daisy_total_cents + ella_total_cents total_money = total_cents / 100 result = initial_money + total_money return result...
Student: Three friends went to a restaurant and received a bill for $75. They decided to split the bill evenly and add a 20% tip. How much will each person pay?
def solve() -> int: bill = 75 tip_rate = 0.2 people = 3 total = bill * (1 + tip_rate) per_person = total / people result = per_person return result
Nina can climb 10 feet per minute. How many minutes will it take her to climb 120 feet?
def solve() -> int: distance = 120 speed = 10 time = distance/speed result = time return result
Tom needs to build a shelf that is 2 meters long. He purchases a piece of wood that is 4 meters long. How much wood will he have left, in meters?
def solve() -> int: wood_length = 4 length_needed = 2 remaining_length = wood_length - length_needed result = remaining_length return result
If a rectangle has a length of 5 cm and its perimeter is 20 cm, what is the width of the rectangle?
def solve() -> int: length = 5 perimeter = 20 width = (perimeter - 2*length)/2 result = width return result
A bakery sells 100 loaves of bread each day. If the bakery increases its daily sales by 10% every week, how many loaves of bread will the bakery sell on the 5th week?
def solve() -> int: daily_sales = 100 for week in range(5): daily_sales *= 1.1 result = f'<<<{daily_sales}>>>' result = daily_sales return result
Michael can paint a room in 3 hours and earns $30 per hour. If he wants to earn $300, how many rooms does he need to paint?
def solve() -> int: total_hours = 300/30 total_rooms = total_hours/3 result = total_rooms return result
Student: Evelyn takes a bus 12km to school every day. If she stays at home 1 day every week, find the total distance she travels by bus to school for 6 weeks in kilometers.
def solve() -> int: distance_per_day = 12 days_in_week = 7 days_at_home = 1 days_at_school = days_in_week - days_at_home distance_per_week = distance_per_day * days_at_school total_distance = distance_per_week * 6 result = total_distance return result
Jason made 20 sandwiches for a picnic. The next day, he made half the number of sandwiches he made on the first day because he ran out of bread. On the third day, he made three times the number of sandwiches he did on the second day but his roommate ate 3 of those sandwiches. How many sandwiches did Jason have at the e...
def solve() -> int: sandwiches_day1 = 20 sandwiches_day2 = sandwiches_day1 / 2 sandwiches_day3 = (sandwiches_day2 * 3) - 3 total_sandwiches = sandwiches_day1 + sandwiches_day2 + sandwiches_day3 result = total_sandwiches return result
Rachel scores 10 points more than Mark in a test. Rachel's score is 80% of the total marks. How many marks did Mark score if there were 50 questions and each carried 2 marks?
def solve() -> int: total_marks = 100 rachel_marks = 40*total_marks*0.8/50 mark_marks = rachel_marks - 10 result = mark_marks return result
Alex is studying for a chemistry exam and studies for 2 hours on the first day. The second day, he studies twice as long plus an extra hour. The third day he studies 5/8 as much as he did on the second day. The fourth day, he takes a break due to a headache. On the fifth day, he studies half as many hours as day two. H...
def solve() -> int: day1 = 2 day2 = (2 * 2) + 1 day3 = (5/8) * day2 day4 = 0 day5 = day2 / 2 result = day5 return result
Ann has six toy cars and Nick has two toy planes, how many toys do Ann and Nick have together?
def solve() -> int: num_of_toy_cars_ann = 6 num_of_toy_planes_nick = 2 total = num_of_toy_cars_ann + num_of_toy_planes_nick result = total return result
A store is giving a 20% discount on its products. If an item originally costs $25, how much will it cost after the discount?
def solve() -> int: original_price = 25 discount_percentage = 0.2 discount_amount = original_price * discount_percentage final_price = original_price - discount_amount result = final_price return result
John can pedal his bike for 13500 times while riding on a 10km track. If he rides around the track 2 times, how many times did he pedal his bike?
def solve() -> int: pedals_per_track = 13500 track_distance = 10 num_tracks = 2 total_pedals = pedals_per_track * num_tracks result = total_pedals return result
Emily needs to deliver orders for her bakery. She needs to drive 5 miles to deliver cupcakes, 2 miles to deliver brownies, and 10 miles to deliver cakes. If her car gets 28 miles per gallon and gas costs $2.75 per gallon, how much will Emily have to spend on gas for the deliveries?
def solve() -> int: cupcakes_distance = 5 brownies_distance = 2 cakes_distance = 10 total_distance = cupcakes_distance + brownies_distance + cakes_distance miles_per_gallon = 28 gas_cost_per_gallon = 2.75 total_gas_cost = (total_distance / miles_per_gallon) * gas_cost_per_gall...
There are 1000 sq ft of available space in Jessica's house. Her kitchen is 200 sq ft and her master bedroom is 250 sq ft. If she wants to add a game room that is three times as large as her kitchen and bedroom combined, how much sq ft will the game room be?
def solve() -> int: total_sq_ft = 200 + 250 game_room_sq_ft = total_sq_ft * 3 result = game_room_sq_ft return result
If a college student works 15 hours a week at a rate of $9.50 per hour, with 25% of their pay going towards savings, and they work for 14 weeks in a semester, how much money can they save from their paychecks in a semester?
def solve() -> int: hours_per_week = 15 hourly_rate = 9.5 weeks_per_semester = 14 savings_rate = 0.25 total_hours = hours_per_week * weeks_per_semester gross_pay = total_hours * hourly_rate savings_amount = gross_pay * savings_rate result = round(savings_amount, 2) return result