question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Possible new questions and python programs are: If Anna has three times as much money in her wallet as Ben does, and Ben has half the amount of money that Carl has in his pocket, and Carl has $40 in his pocket, how much more money does Anna have in her wallet than Ben?
def solve() -> int: carl = 40 ben = carl / 2 anna = ben * 3 difference = anna - ben result = difference return result
John saves $250 a month. How much will he save in a year?
def solve() -> int: savings_per_month = 250 savings_per_year = savings_per_month * 12 result = savings_per_year return result
The bookstore sells paperbacks for $5, hardcovers for $15, and audiobooks for $10. If they sell 300 paperbacks, 100 hardcovers, and 75 audiobooks, how much money do they make in total?
def solve() -> int: paperback_price = 5 hardcover_price = 15 audiobook_price = 10 paperback_quantity = 300 hardcover_quantity = 100 audiobook_quantity = 75 paperback_total = paperback_price * paperback_quantity hardcover_total = hardcover_price * hardcover_quantity audioboo...
A recipe calls for 2 cups of flour to make 12 muffins. If Paul wants to make 24 muffins, how many cups of flour does he need?
def solve() -> int: cups_of_flour_per_muffin = 2 / 12 muffins_to_make = 24 cups_of_flour_needed = cups_of_flour_per_muffin * muffins_to_make result = cups_of_flour_needed return result
The science museum needs to sell 400 tickets for an exhibit within 20 days. If they sell 10 tickets every day, how many more tickets should they sell per day to meet their goal in 15 days instead?
def solve() -> int: total_tickets = 400 total_days = 20 tickets_per_day = 10 new_days = 15 current_tickets_sold = tickets_per_day * total_days remaining_tickets = total_tickets - current_tickets_sold new_tickets_per_day = remaining_tickets / new_days additional_ticket...
Student: Sarah buys 5 packs of batteries, each pack cost 4.75 dollars. She has to pay 10% tax for all the batteries. What is the total amount she pays?
def solve() -> int: pack_cost = 4.75 num_packs = 5 subtotal = pack_cost * num_packs tax_rate = 0.1 tax_amount = subtotal * tax_rate total = subtotal + tax_amount result = total return result
Reese wants to water her vegetable garden with a watering can. The watering can she has holds 1 gallon of water, and it takes her 8 seconds to fill it up from the hose and walk over to the garden to water the plants. If she needs to water her entire garden with 12 gallons of water, how many trips will Reese need to mak...
def solve() -> int: can_capacity = 1 fill_time = 8 total_water_needed = 12 one_trip_time = fill_time + (can_capacity * 2) num_trips = total_water_needed / can_capacity num_trips = int(num_trips + 0.5) result = num_trips return result
Karen is a hair stylist, she works 3 hours every weekday and 8 hours every Saturday. If she earns $25 per hour and earns an additional $10 per hour on Saturdays, how much does she earn every week? There's a sale at your favorite "Any item $5" store. If you buy 1 pencil you pay $5. If you buy 2, you get the second one a...
def solve() -> int: weekday_hours = 3 saturday_hours = 8 weekday_pay = 25 saturday_pay = 35 weekly_earnings = (weekday_hours * 5 * weekday_pay) + (saturday_hours * saturday_pay) pencil_price = 5 discounted_price = pencil_price * 0.6 total_saved = (pencil_price * 2) - (pencil_price...
Student: If a bag of chips costs $3 and I have $4, how many bags of chips can I buy?
def solve() -> int: cost_of_bag = 3 amount_of_money = 4 number_of_bags = amount_of_money // cost_of_bag result = number_of_bags return result
Darcy has 98/200 of a loaf of bread, how many pieces of bread can she have?
def solve() -> int: fraction_of_bread = 98/200 pieces_of_bread = fraction_of_bread * 200 result = pieces_of_bread return result
Bob is 3 years younger than his sister Alice but 2 years older than his brother Chris. If Chris is 7 years old, what is the sum of Bob's and Alice's ages?
def solve() -> int: Bob = 7 + 2 Alice = Bob + 3 sum = Bob + Alice result = sum return result
Nathan parks his car in a parking garage near his office on Mondays, Wednesdays, and Fridays. It takes him a total of 10 minutes each day to drive to the garage, park, and walk to the office. How much time has he spent on these activities in a week?
def solve() -> int: time_spent_parking = 0 for day in range (1, 6): if (day == 0 or day == 2 or day == 4): time_spent_parking += 10 result = time_spent_parking return result
A car travels at 60 km/hr for the first 3 hours and 40 km/hr for the next 2 hours. What is the average speed of the car?
def solve() -> int: distance1 = 60*3 distance2 = 40*2 total_time = 5 total_distance = distance1 + distance2 average_speed = total_distance / total_time result = average_speed return result
There are 556 blocks in the box. Joanne took 245 blocks and Reed took 38 blocks. How many blocks are left in the box?
def solve() -> int: num_blocks_ori = 556 took_joanne = 245 took_reed = 38 result = num_blocks_ori - took_joanne - took_reed return result
Tom drove his car for 25 minutes at a speed of 45 miles per hour. After this, he stopped for a 5 minute break and then drove at a speed of 60 miles per hour for the remaining 15 minutes. How many miles had Tom driven then?
def solve() -> int: time_initial = 25 speed_initial = 45 time_final = 15 speed_final = 60 distance_traveled = (time_initial * speed_initial) + (time_final * speed_final) result = distance_traveled return result
A car rental company offers 20% off on renting for 7 or more days. If the rent for a car is $70 per day, then how much will it cost to rent for 10 days?
def solve() -> int: rent_per_day = 70 discount_percent = 20 no_of_days = 10 regular_rent = rent_per_day * no_of_days if no_of_days >= 7: discounted_rent = regular_rent * ((100 - discount_percent) / 100) total_rent = discounted_rent else: total_rent = regular_rent resu...
Carol gets a discount of 20% on her electricity bill because she's low-income. If her average monthly bill is $80 before the discount, how much will she save a year if the discount is reduced to 15%?
def solve() -> int: B = 80 d1 = 0.2 d2 = 0.15 D1 = B * (1 - d1) D2 = B * (1 - d2) S1 = 12 * (B - D1) S2 = 12 * (B - D2) result = S1 - S2 return result
9. Jack bought some balloons for a party. He has 12 packs of balloons with 6 balloons in each pack. How many balloons does Jack have in total?
def solve() -> int: number_of_packs = 12 number_of_balloons_per_pack = 6 total_number_of_balloons = number_of_packs * number_of_balloons_per_pack result = total_number_of_balloons return result
There are 60 students in a class. 20% of them got an A grade, 50% got a B grade, and the rest got a C grade. How many students got a C grade?
def solve() -> int: students_total = 60 percent_a = 0.2 percent_b = 0.5 a = students_total * percent_a b = students_total * percent_b c = students_total - a - b result = round(c) return result
While rock climbing, Ben fell from the seventh ledge and fell past Nancy after falling 2.5 meters. If he fell for an additional four more times that depth before reaching the ground, and the ledges are evenly spaced out in height, what ledge was Nancy on?
def solve() -> int: ben_fell_from = 7 additional_fall_depth = 4 * 2.5 total_fall_distance = additional_fall_depth + 2.5 ledge_height = total_fall_distance / ben_fell_from nancy_ledges = (total_fall_distance - 2.5) // ledge_height nancy_ledge_height = (nancy_ledges + 1) * ledg...
Max was running in the park at a speed of 10 miles per hour. A dog was running alongside him, keeping up with the same pace until it doubled its speed and ran ahead. A squirrel was keeping up with Max and the dog, and when the dog increased its speed, the squirrel also increased its speed but only by half as much as th...
def solve() -> int: max_speed = 10 dog_speed = max_speed dog_speed *= 2 squirrel_speed = max_speed squirrel_speed += (dog_speed - max_speed) / 2 result = squirrel_speed return result
A square lot has an area of 625 square meters. What is the length of each side of the lot?
def solve() -> int: area = 625 side_length = area ** 0.5 result = side_length return result
Tina and Ryan are collecting coins for a charity. Tina has 25 quarters, 18 dimes, and 12 nickels. Ryan has 19 quarters, 22 dimes, and 15 nickels. How much more money does Tina have than Ryan in cents?
def solve() -> int: tina_amount = 25 * 25 + 18 * 10 + 12 * 5 ryan_amount = 19 * 25 + 22 * 10 + 15 * 5 difference = tina_amount - ryan_amount result = difference return result
Jill's first three tests were weighted triple than her fourth and fifth tests. If she got 95, 90 and 85 for her first three tests and 82 and 87 for her last two tests, what is her average score?
def solve() -> int: totalScore = 0 totalTests = 0 totalScore = (95*3) + (90*3) + (85*3) + (82) + (87) totalTests = 8 averageScore = totalScore/totalTests result = averageScore return result
Ryan and Ava sold lemonade and cookies at their lemonade stand. Ryan made 12 liters of lemonade and sold them at $0.50 per glass (250 ml) while Ava made 36 cookies and sold them at $0.25 each. If they spent $6 on lemons and $4 on sugar for the lemonade and $8 on flour and $2 on chocolate chips for the cookies, how much...
def solve() -> int: ryan_glasses = 12 * 1000 / 250 ryan_money = ryan_glasses * 0.5 ava_money = 36 * 0.25 total_money = ryan_money + ava_money total_cost = 6 + 4 + 8 + 2 profit = total_money - total_cost result = profit return result
Giorgio has 12 balloons more than Karla, who has twice as many balloons as Maria. If Maria has 8 balloons, how many balloons do they all have?
def solve() -> int: maria_balloons = 8 karla_balloons = maria_balloons * 2 giorgio_balloons = karla_balloons + 12 total_balloons = maria_balloons + karla_balloons + giorgio_balloons result = total_balloons return result
Mark planned to practice meditation for 30 minutes every day for a month. On Thursday, he could only practice for 20 minutes, but he practiced for an extra 10 minutes on Saturday. How much time did Mark spend meditating in total for the entire month?
def solve() -> int: daily_time = 30 total_time_planned = daily_time * 30 actual_time = total_time_planned - (daily_time * 2) + 20 + 10 result = actual_time return result
Tom has $20. He wants to buy a toy that costs $7. How much money will he have left?
def solve() -> int: money = 20 toy_cost = 7 money_left = money - toy_cost result = money_left return result
Maria swims from one end of the pool to the other in 10 minutes. From the other end, she has to swim back to where she started and it takes her 8 minutes. When she finishes, she will have been swimming for a total of 28 minutes. If she swam to the hot tub before starting the swim, how long is the walk from the hot tub ...
def solve() -> int: swim_time = 10 swim_back_time = 8 total_swim_time = 28 total_pool_time = swim_time + swim_back_time walk_time = total_swim_time - total_pool_time result = walk_time return result
Alexis is ordering office supplies for her team. Each notebook costs $3 and each pen costs $1. If she orders 40 notebooks and 50 pens, how much does Alexis spend in total?
def solve() -> int: notebook_cost = 3 pen_cost = 1 num_notebooks = 40 num_pens = 50 total_cost = (notebook_cost * num_notebooks) + (pen_cost * num_pens) result = total_cost return result
In a restaurant, the number of pizzas is 25% more than the number of burgers. If there are 160 burgers in the restaurant, calculate the total number of pizzas and burgers that are there.
def solve() -> int: burgers = 160 pizzas = burgers * (1 + 0.25) total = burgers + pizzas result = total return result
At the amusement park, each ticket to ride on the Ferris wheel costs $1.75. If Lily has $21 in her wallet, how many rides can she take on the Ferris wheel?
def solve() -> int: cost_per_ride = 1.75 total_cash = 21 num_rides = total_cash // cost_per_ride result = num_rides return result
Some possible questions are: Mara and Leah share a pizza that costs $8. They also order 3 bottles of juice for $1.5 each and a salad for $4. The tip is 15% of the total bill. How much money do they each need to pay?
def solve() -> int: total_bill = 8 + 3 * 1.5 + 4 + 0.15 * (8 + 3 * 1.5 + 4) each_pay = total_bill / 2 result = each_pay return result
Sophia spent $20 on a pizza. Later on, she bought a pasta dish that costs twice as much as the pizza and an ice cream dessert that costs three times as much as the pasta. If Sophia had $100 remaining in her savings, how much money did she have before her Italian dinner? If the sum of two integers is 68, and if the seco...
def solve() -> int: pizza_cost = 20 pasta_cost = pizza_cost * 2 ice_cream_cost = pasta_cost * 3 total_cost = pizza_cost + pasta_cost + ice_cream_cost savings = 100 initial_money = total_cost + savings result = initial_money return result
A recipe calls for 2/3 cup of sugar, but you only have a 1/4 cup measuring cup. How many times will you need to fill the measuring cup to get the 2/3 cup of sugar?
def solve() -> int: recipe_amount = 2/3 measuring_cup = 1/4 num_times_to_fill = recipe_amount / measuring_cup result = round(num_times_to_fill) return result
A train travels at 60 miles per hour. How far will it travel in 3 and a half hours?
def solve() -> int: distance = 60 * 3.5 result = distance return result
Student: A family of 4 spends 12,500 miles a year driving 2 different cars with a combined fuel economy of 25 miles per gallon. Approximately how much money does the family spend on gas per year if gas costs $2.50 per gallon?
def solve() -> int: miles = 12500 cars = 2 mpg = 25 cost = 2.50 gallons = miles / mpg result = gallons * cost return result
There are 120 birds in a forest. The number of blue birds is 5 times the number of yellow birds and the number of red birds is an additional 2 yellow birds. How many blue birds are there?
def solve() -> int: birds_total = 120 yellow_birds = birds_total // (5 + 2) blue_birds = yellow_birds * 5 result = blue_birds return result
Student: Ryan is painting a mural on a rectangular wall that is 3 meters high and 5 meters wide. He has a paint bucket that can cover 2 square meters of wall with one liter of paint. If he wants to paint the whole wall with two coats of paint, calculate how many liters of paint he needs to buy.
def solve() -> int: height = 3 width = 5 area_per_liter = 2 total_area = height * width total_liters = total_area * 2 / area_per_liter result = total_liters return result
Lily has 250 seashell collections. Aria has 67 more seashell collections. How many seashell collections do they have combined?
def solve() -> int: lily_collections = 250 aria_collections = lily_collections + 67 combined_collections = lily_collections + aria_collections result = combined_collections return result
Nana has 56 cents and she spends a third of the total amount on a toy. How many cents does she have left?
def solve() -> int: total = 56 third = total/3 result = total - third return result
Mary is taking her five birds out of their cages so they can fly in the room. How many wings will be flying together in the space?
def solve() -> int: birds = 5 wings_per_bird = 2 total_wings = birds * wings_per_bird result = total_wings return result
A farmer has 30 chicken and 20 goats. If each chicken costs $5 and each goat costs $20, what is the total worth of all animals?
def solve() -> int: num_chicken = 30 num_goats = 20 chicken_price = 5 goat_price = 20 total_value = (num_chicken * chicken_price) + (num_goats * goat_price) result = total_value return result
A group of 12 friends has to share 48 cookies. They decide to split the cookies according to their ages. The youngest friend gets 1 cookie, the second youngest gets 2 cookies, and so on. The oldest friend gets 12 cookies. How many cookies does the fifth youngest friend get?
def solve() -> int: age = 5 cookies = age result = cookies return result
The circumference of a circle with a radius of 5 cm is?
def solve() -> int: def get_circumference(radius): pi = 3.14159 circumference = 2*pi*radius return circumference result = get_circumference(5) return result
Jack has a collection of coins with different values. He has three times as many quarters as dimes. He has five more nickels than dimes. He has twice as many pennies as nickels. If he has 40 pennies, how many dollars does he have in total?
def solve() -> int: w = 40 z = (w / 2) - 5 y = (z - 5) * 3 x = (y / 3) total = (y * 25 + x * 10 + z * 5 + w * 1) / 100 result = total return result
Lily had 90 beads. She gave 30 away to her sister. Someone found a fifth of the beads she gave away and returned them. How many beads does Lily have now?
def solve() -> int: beads = 90 beads_given_away = 30 beads_returned = beads_given_away / 5 beads_remaining = beads - beads_given_away + beads_returned result = beads_remaining return result
In a factory, a machine can produce 2500 products per day. If the factory runs for 5 days a week, how many products are produced in a month of 30 days?
def solve() -> int: num_products_day = 2500 num_days_week = 5 num_days_month = 30 products_per_month = num_products_day * num_days_week * num_days_month result = products_per_month return result
Emma drove to the beach at 9:00 AM and reached there at 12:00 PM. She left the beach at 5:00 PM and reached home at 8:00 PM. She took a stop of 15 minutes. What was her total driving duration?
def solve() -> int: start_time = 9 * 60 end_time = 12 * 60 beach_duration = end_time - start_time stop_duration = 15 start_time = 17 * 60 end_time = 20 * 60 home_duration = end_time - start_time total_duration = beach_duration + stop_duration + home_duration ...
A movie theater charges adults $10.50 per ticket and children $6.50 per ticket. If a family of two adults and three children goes to the movies, how much will they pay in total?
def solve() -> int: adult_ticket_price = 10.50 child_ticket_price = 6.50 total_cost = (2 * adult_ticket_price) + (3 * child_ticket_price) result = total_cost return result
A store is having a 25% off sale. If a shirt originally costs $40, what is the sale price?
def solve() -> int: original_price = 40 sale_percent = 25 sale_price = original_price - (original_price * sale_percent/100) result = sale_price return result
A delivery service charges $5 flat rate plus $0.50 per mile for each delivery. If a delivery is 10 miles away, how much will it cost for the delivery?
def solve() -> int: distance = 10 cost_per_mile = 0.5 flat_rate = 5 total_cost = flat_rate + distance*cost_per_mile result = total_cost return result
Robert is purchasing a new car. He makes a 20% down payment and will pay the remaining balance at the time of pick-up. The new car is 50% more expensive than the used car he bought last year for $12,000. What is the amount he still needs to pay at pickup, in dollars?
def solve() -> int: used_car_price = 12000 new_car_price = used_car_price * 1.5 down_payment = new_car_price * 0.2 remaining_balance = new_car_price - down_payment result = remaining_balance return result
Oliver is driving a car that can travel 40 miles/gallon of gas. If the car has a gas tank that can hold up to 10 gallons of gas, how far can Oliver travel on a full tank of gas?
def solve() -> int: miles_per_gallon = 40 gas_tank_capacity = 10 distance_traveled = miles_per_gallon * gas_tank_capacity result = distance_traveled return result
Gabi, Haris and Ida are tutors at a learning center, earning $20 per hour. They work 4 hours a day, four days a week. Gabi spends 1/5 of her salary on transportation, Haris spends 1/4 of his salary on food, while Ida spends 1/6 of her salary on clothes. What is the average amount of money that the three tutors save per...
def solve() -> int: hourly_rate = 20 hours_per_day = 4 days_per_week = 4 gabi_salary = hourly_rate * hours_per_day * days_per_week haris_salary = hourly_rate * hours_per_day * days_per_week ida_salary = hourly_rate * hours_per_day * days_per_week gabi_spending = gabi_salary * 1/5 haris...
The sum of ages of Sarah and John is 33 years. If the ratio of Sarah's age to John's age is 7:5, find the age of each person.
def solve() -> int: sarah_age = (33 / (7 + 5)) * 7 john_age = 33 - sarah_age result = (sarah_age, john_age) return result
A cinema has a seating capacity of 450 people. If tickets are sold in packages of 5, how many ticket packages need to be sold to fill the cinema?
def solve() -> int: seating_capacity = 450 tickets_per_package = 5 num_packages_needed = seating_capacity//tickets_per_package + 1 result = num_packages_needed return result
Dale has 3/10 of a bag of flour and 1/5 of a bag of sugar. If he uses 1/20 of a bag of flour and 1/25 of a bag of sugar per cake, how many cakes can he bake?
def solve() -> int: flour = 3/10 sugar = 1/5 flour_per_cake = 1/20 sugar_per_cake = 1/25 flour_cakes = flour / flour_per_cake sugar_cakes = sugar / sugar_per_cake cakes = min(flour_cakes, sugar_cakes) result = int(cakes) return result
If a crate holds 120 oranges and it takes 3 oranges to make a glass of juice, how many glasses of juice can be made from one crate?
def solve() -> int: oranges_per_glass = 3 num_of_glasses = 120 // oranges_per_glass result = num_of_glasses return result
If Jake and Amber each purchase a $25 meal with a $8 dessert, how much will Jake have to pay in tips if he wants to cover 90% of a 25% tip for the two of them?
def solve() -> int: meal_cost = 25 dessert_cost = 8 total_cost = 2 * (meal_cost + dessert_cost) tip_percentage = 0.25 tip_amount = total_cost * tip_percentage jake_tip = tip_amount * 0.9 / 2 result = jake_tip return result
Ethan has 6 more peaches than Jordan. Maria has four times as many peaches as Ethan. If Maria has 120 peaches, how many peaches do Jordan and Ethan have together?
def solve() -> int: jordan_peaches = 0 ethan_peaches = 0 maria_peaches = 120 ethan_peaches = jordan_peaches + 6 ethan_peaches = maria_peaches / 4 total_peaches = jordan_peaches + ethan_peaches result = total_peaches return result
A chocolate factory has 5000 chocolate bars. They want to pack them into boxes, with 30 chocolate bars in each box. How many boxes can they make? How many chocolate bars are left after all the boxes are filled?
def solve() -> int: chocolates = 5000 bars_per_box = 30 boxes = chocolates // bars_per_box bars_left = chocolates % bars_per_box result = boxes, bars_left return result
Result: 55 Tina is seven years younger than twice the age of Max. If Max is twenty-five years old, how old is Tina?
def solve() -> int: age_max = 25 age_tina = 2 * age_max - 7 result = age_tina return result
Bob bought a pack of 24 pencils and a pack of 18 erasers. He gave 6 pencils and 3 erasers to his friend. He then sold the rest of the pencils and erasers for $0.50 each. How much money did he make from selling the pencils and erasers?
def solve() -> int: pencils = 24 - 6 erasers = 18 - 3 total_items = pencils + erasers total_money = total_items * 0.50 result = total_money return result
The toy store is having a "Build Your Own Lego Set" event. A small Lego set costs $10, and each additional piece is $1. Maria wants to create a medium-sized set with 20 additional pieces. What will be the total cost of her set?
def solve() -> int: small_set_cost = 10 additional_pieces = 20 additional_piece_cost = 1 total_cost = small_set_cost + (additional_pieces * additional_piece_cost) result = total_cost return result
If David bought 7 meters of ribbon for $3.50, how much will 10 meters of ribbon cost?
def solve() -> int: ribbon_length = 7 ribbon_cost = 3.50 cost_per_meter = ribbon_cost / ribbon_length cost_of_10_meters = cost_per_meter * 10 result = cost_of_10_meters return result
A store offers a buy 2 get 1 free promotion on all items. If the original price of an item is $20, what is the final price for a customer who takes advantage of this promotion and buys 6 items?
def solve() -> int: original_price = 20 items_bought = 6 items_paid = items_bought - (items_bought // 3) final_price = items_paid * original_price result = final_price return result
Jared drives his sister and three of her friends to a mall, which is 20 miles away. Gas prices are currently at $2.00/gallon, and Jared's car has a fuel efficiency of 35 miles/gallon. If they equally split the cost of gas, how much should each person contribute towards gas expenses?
def solve() -> int: distance = 20 gas_price = 2.00 fuel_efficiency = 35 gas_needed = distance / fuel_efficiency total_cost = gas_needed * gas_price cost_per_person = total_cost / 4 result = cost_per_person return result
Jake studies for a total of 16 hours each week on Monday, Tuesday, Thursday, and Saturday. He studies for 2 hours and 20 minutes each on Monday and Thursday. If he studies the same amount of time on Tuesday and Saturday, how many hours does he study on Saturday?
def solve() -> int: total_weekly_study_hours = 16 mon_thu_study_hours = 2 + 20/60 tue_sat_study_hours = (total_weekly_study_hours - 2*mon_thu_study_hours)/2 sat_study_hours = tue_sat_study_hours result = sat_study_hours return result
A restaurant has 35 tables and each table can seat a maximum of 6 customers. How many customers can the restaurant serve at full capacity?
def solve() -> int: num_tables = 35 max_customers_per_table = 6 total_capacity = num_tables*max_customers_per_table result = total_capacity return result
Mark purchased 5 bottles of champagne at $100 each, 1 bottle was for his boss. How much money did he spend on champagne for himself?
def solve() -> int: num_bottles = 5 price_per_bottle = 100 bottles_for_boss = 1 total_spent = num_bottles * price_per_bottle spent_on_boss = bottles_for_boss * price_per_bottle spent_on_self = total_spent - spent_on_boss result = spent_on_self return result
In a basketball game, John scored 2/5 of the team's final score. If the team won 60-48, how many points did John score? Sarah, Mia and Olivia want to divide a gift of $300 in the ratio 2:3:4 respectively. If Olivia takes 20% of the gift, how much money will Mia get after the division?
def solve() -> int: team_score = 60 + 48 john_score = (2/5) * team_score olivia_money = 0.2 * 300 total_ratio = 2 + 3 + 4 mia_money = (3/total_ratio) * (300 - olivia_money) result = mia_money return result
Ella is making bracelets. She needs 15 beads for each bracelet. A pack of beads contains 120 beads. She has 9 packs of beads. How many bracelets can she make with her beads?
def solve() -> int: total_beads = 9 * 120 bracelet_beads = 15 bracelets = total_beads // bracelet_beads result = bracelets return result
Theresa is making lemonade and in each cup she adds 12 ounces of liquid. She made 10 cups of lemonade. How many ounces of liquid did she use in total?
def solve() -> int: total_ounces = 0 for cups in range(10): total_ounces += 12 result = total_ounces return result
Kelly bought a pack of 24 crayons. She used 8 crayons to draw a picture, and gave 5 crayons to her brother. She also lost 2 crayons on her way home. How many crayons does Kelly have left?
def solve() -> int: crayons_left = 24 - 8 - 5 - 2 result = crayons_left return result
Camila sells lemonade for 50 cents per cup and cookies for 25 cents each. She sells 12 cups of lemonade and 8 cookies per day for 14 days. Noah sells hot chocolate for 75 cents per cup and brownies for 50 cents each. He sells 10 cups of hot chocolate and 6 brownies per day for 10 days. Ella sells twice as much lemonade...
def solve() -> int: camila_per_day = 50 * 12 + 25 * 8 noah_per_day = 75 * 10 + 50 * 6 ella_per_day = 2 * camila_per_day camila_total = camila_per_day * 14 noah_total = noah_per_day * 10 ella_total = ella_per_day * 8 total = camila_total + noah_total + ella_total result = total ...
Rachel went to the store and bought 3 shirts for $15 each and 2 pants for $20 each. She received a 10% discount on the total purchase. How much did Rachel spend after the discount?
def solve() -> int: shirt_price = 15 pants_price = 20 num_shirts = 3 num_pants = 2 subtotal = (shirt_price * num_shirts) + (pants_price * num_pants) discount = 0.1 * subtotal total = subtotal - discount result = total return result
arah is a wedding photographer. She is paid $200 for each wedding she shoots. On Wednesday she shoot 4 weddings. How much money did Sarah make on Wednesday?
def solve() -> int: total_money = 0 price_wedding = 200 quantity_wedding = 4 total_money += price_wedding * quantity_wedding result = total_money return result
A recipe calls for a mixture of flour and sugar in the ratio of 4:3. If the recipe requires 2 cups of sugar, how many cups of flour are needed?
def solve() -> int: sugar = 2 flour_ratio = 4/3 flour = sugar * flour_ratio result = round(flour, 2) return result
Rachel is delivering packages on a route. On Monday she delivered 15 packages and on Tuesday she delivered 20 packages. On Wednesday she delivered 50% fewer packages than the day before. On Thursday she delivered as many as the sum of the packages from Monday and Wednesday. How many packages did Rachel deliver in total...
def solve() -> int: monday = 15 tuesday = 20 wednesday = tuesday * 0.5 thursday = monday + wednesday total_packages = monday + tuesday + wednesday + thursday result = total_packages return result
Nathan is planning a road trip that will take 6 hours to drive. His car travels an average speed of 60 miles per hour. How many miles is Nathan's road trip?
def solve() -> int: time = 6 speed = 60 distance = time * speed result = distance return result
David can do his homework in 2 hours. Today, he worked for a total of 4 hours with breaks of 20, 10 and 15 minutes. If he has to complete a total of 10 hours of homework, how much time does he still need to work on it?
def solve() -> int: time_homework = 2 break_1 = 0.33 break_2 = 0.17 break_3 = 0.25 total_time = time_homework + break_1 + break_2 + break_3 total_homework_done = total_time * 2 total_homework = 10 remaining_homework = total_homework - total_homework_done result = round(remaining_home...
Owen sold 150 cups at $3 each and earned a profit of $225. What was the cost of each cup for Owen?
def solve() -> int: cups_sold = 150 price_per_cup = 3 total_revenue = cups_sold * price_per_cup profit = 225 cost_per_cup = (total_revenue - profit) / cups_sold result = cost_per_cup return result
Last week, there were 30 customers in a restaurant. On Monday, there were 10 customers who left, but 8 customers came in. How many customers are there this Monday?
def solve() -> int: customers_last_week = 30 customers_left = 10 customers_arrived = 8 customers_now = customers_last_week - customers_left + customers_arrived result = customers_now return result
Ava is counting the birds in her backyard. All the birds are either blue or red. She sees 60 blue birds and 40 red birds. If she picks one bird at random, what is the percentage chance it's a blue bird, rounded to the nearest integer?
def solve() -> int: blue_birds = 60 red_birds = 40 total_birds = blue_birds + red_birds blue_percentage = (blue_birds / total_birds) * 100 result = round(blue_percentage) return result
Mary bought 5 times as many items as John. John bought 8 items. If Mary spent 10 dollars per item and John spent 15 dollars per item. How much more money did Mary spend than John?
def solve() -> int: items_mary = 5*8 items_john=8 spent_mary = items_mary*10 spent_john = items_john*15 difference = spent_mary - spent_john result = difference return result
In a drawer full of socks, there are 10 black, 6 white, and 8 blue socks. If a person selects 2 socks at random, what is the probability of getting a matching pair?
def solve() -> int: total_socks = 24 black_socks = 10 white_socks = 6 blue_socks = 8 prob_of_black_pair = black_socks/total_socks * (black_socks-1)/(total_socks-1) prob_of_white_pair = white_socks/total_socks * (white_socks-1)/(total_socks-1) prob_of_blue_pair = blue_socks/total_socks * (blu...
Ms. Nina runs a lemonade stand and sells lemonade at $1.5 per cup and cookies at $0.5 each. She buys lemons at $0.1 each and sugar at $0.05 per teaspoon. She uses 6 lemons and 12 teaspoons of sugar to make one liter of lemonade. She makes 10 liters of lemonade and 50 cookies for the day. Calculate her profit (income mi...
def solve() -> int: lemonade_price = 1.5 cookie_price = 0.5 lemon_cost = 0.1 sugar_cost = 0.05 lemons_per_liter = 6 sugar_per_liter = 12 liters_made = 10 cups_per_liter = 4 cookies_made = 50 lemonade_income = lemonade_price * liters_made * cups_per_liter cookie_income = cooki...
At a restaurant, John ordered 2 pizzas and 1 salad for $27 total, and Jane ordered 1 pizza and 2 salads for $20 total. Each pizza cost the same price, and each salad cost the same price. How much does 1 pizza cost?
def solve() -> int: pizzas = 1 salads = 2 total_cost_jane = 20 pizza_cost = (total_cost_jane - (salads * 2)) / pizzas result = pizza_cost return result
A bicycle has two wheels with a diameter of 26 inches. What is the circumference of each wheel?
def solve() -> int: wheel_diameter = 26 wheel_radius = wheel_diameter / 2 pi = 3.14159 circumference = 2 * pi * wheel_radius result = circumference return result
Jamie has $200 saved up. She spends $50 on groceries, $30 on gas, and $20 on a concert ticket. How much money does Jamie have left after these purchases?
def solve() -> int: savings = 200 groceries = 50 gas = 30 ticket = 20 total_spending = groceries + gas + ticket remaining_savings = savings - total_spending result = remaining_savings return result
A geologist discovered three rock layers from different ages in one area. The geologist dated the first rock layer as 520 years more recent than the second rock layer. The third rock layer was recorded 4100 years before the first rock layer. The fourth rock layer was twice as old as the third rock layer. The geologist ...
def solve() -> int: first_rock_layer = 7700 third_rock_layer = first_rock_layer - 4100 fourth_rock_layer = third_rock_layer * 2 second_rock_layer = first_rock_layer - 520 result = second_rock_layer return result
Student: Carl has 24 cookies in a box that he plans to share with his three cousins. In how many boxes must Carl divide the cookies so each cousin can get the same amount?
def solve() -> int: cookies = 24 cousins = 3 boxes = cookies // cousins result = boxes return result
Kevin and Mia are selling some cookies for a fundraiser. Kevin sells 20 boxes of chocolate chip cookies and 15 boxes of oatmeal cookies. Mia sells 25 boxes of chocolate chip cookies and 10 boxes of oatmeal cookies. Each box of chocolate chip cookies costs $5 and each box of oatmeal cookies costs $4. They want to split ...
def solve() -> int: chocolate_chip_boxes = 20 + 25 chocolate_chip_price = 5 oatmeal_boxes = 15 + 10 oatmeal_price = 4 total_money = chocolate_chip_boxes * chocolate_chip_price + oatmeal_boxes * oatmeal_price people = 2 money_per_person = total_money / people result ...
A gas station sells regular gas for $2.50 per gallon and premium gas for $3.25 per gallon. If a customer purchases 10 gallons of regular gas and 5 gallons of premium gas, how much do they owe?
def solve() -> int: regularPrice = 2.5 premiumPrice = 3.25 regularGallons = 10 premiumGallons = 5 totalCost = (regularPrice*regularGallons) + (premiumPrice*premiumGallons) result = totalCost return result
Student: William needs to purchase 4 sets of new tires for his car. Each tire cost $85. The store is offering a sale of buy 3 sets of tires get 1 set of tires at 55% off. How much will it cost him to buy all 4 sets of tires?
def solve() -> int: num_sets = 4 tire_cost = 85 total_cost_without_discount = num_sets * tire_cost num_sets_discounted = num_sets // 3 discounted_cost = num_sets_discounted * tire_cost * 0.55 total_cost_with_discount = total_cost_without_discount - discounted_cost result = total_cost_with_di...
If Mrs. Jones wants to make a $2000 profit selling clothes, and her cost is $5000, how much does she need to sell the clothes for (assuming no other expenses or fees)?
def solve() -> int: profit = 2000 cost = 5000 selling_price = cost + profit result = selling_price return result
A triangle has a base of 10 cm and a height of 6 cm. What is its area?
def solve() -> int: base = 10 height = 6 area = 0.5*base*height result = area return result
Student: Jessica's uncle is an organic farmer and he decides to give some vegetables to his family. Jessica's father gets 2 bags of potatoes, her mother gets 4 bags of onions, and Jessica gets 6 bags of carrots. Calculate the total number of bags of vegetables the family got from the farmer.
def solve() -> int: bags_potatoes = 2 bags_onions = 4 bags_carrots = 6 total_bags = bags_potatoes + bags_onions + bags_carrots result = total_bags return result
Two basketball teams decided to play a friendly game. Each team had 7 players, and they invited 3 more players, who brought 2 spectators with them. After halftime, 4 players left, including the captain, and 1 spectator left with them. How many players and spectators were left watching the game?
def solve() -> int: team_players = 7 extra_players = 3 extra_spectators = 2 captain_left = 1 players_left = team_players + extra_players - captain_left - 4 spectators_left = extra_spectators + 1 result = players_left + spectators_left return result