question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: A tailor charges by the meter and by the type of fabric. He earns $8 per meter for cotton, $10 per meter for silk, and $12 per meter for wool. He also has to pay a fixed cost of $150 for the sewing machine and the scissors. He sews 10 meters of cotton, 15 meters of silk, and 8 meters of wool in a week. How muc...
def solve() -> int: cotton_meter = 10 silk_meter = 15 wool_meter = 8 cotton_price = 8 silk_price = 10 wool_price = 12 fixed_cost = 150 cotton_earning = cotton_meter * cotton_price silk_earning = silk_meter * silk_price wool_earning = wool_meter * wool_price total_earning = co...
Joe bought a dresser from the store for $240. After a sale, the dresser was discounted by 30%. How much did Joe pay for the dresser in the end?
def solve() -> int: price = 240 discount = 30 discount_amount = price * (discount / 100) final_price = price - discount_amount result = final_price return result
Student: A chef has 10 potatoes. If he wants to cut them equally into french fries, and each french fries has 20 pieces, how many french fries can he make in total?
def solve() -> int: potatoes = 10 fries_pieces = 20 fries = potatoes * fries_pieces result = fries return result
A music store sells CDs, DVDs, and Blu-rays. The CDs cost $10 each, the DVDs cost $15 each, and the Blu-rays cost $20 each. On Monday, the store sold 50 CDs, 40 DVDs, and 30 Blu-rays. On Tuesday, the store sold 20% more CDs, 10% less DVDs, and the same number of Blu-rays as on Monday. On Wednesday, the store sold half ...
def solve() -> int: cds_monday = 50 dvds_monday = 40 blu_rays_monday = 30 cost_cd = 10 cost_dvd = 15 cost_blu_ray = 20 money_monday = cds_monday * cost_cd + dvds_monday * cost_dvd + blu_rays_monday * cost_blu_ray cds_tuesday = cds_monday * 1.2 dvds_tuesday = dvds_monday * 0.9 b...
Lucas goes through 5 tennis balls every week. He needs to buy new tennis balls every 20 balls. He gets 8 free packs of tennis balls a year. If a pack of tennis balls costs $10, how much does he pay a year? Emma has 4 more bikes than 5 times the number of rollerblades she has. If she has 24 bikes, how many rollerblades ...
def solve() -> int: balls_per_week = 5 balls_per_pack = 20 free_packs = 8 cost_per_pack = 10 total_balls = 52 * balls_per_week total_packs = total_balls // balls_per_pack total_packs -= free_packs cost = total_packs * cost_per_pack result = cost bikes = 24 ...
Karen gets a subscription for her and her daughter to access a mindfulness app as much as they want. The subscription costs $15.00 each. Karen meditated using the app 30 times while her daughter meditated a total of 20 times. What was the cost per meditation session? A certain restaurant bought 15 cases of soda for the...
def solve() -> int: subscription_cost = 15.00 karen_meditations = 30 daughter_meditations = 20 total_meditations = karen_meditations + daughter_meditations total_cost = subscription_cost * 2 cost_per_session = total_cost / total_meditations cases_of_soda = 15 cans_per_case = 24...
A gym has space for 25 weight lifting machines. If there are currently 14 machines being used, how many are available for use?
def solve() -> int: available_machines = 25 - 14 result = available_machines return result
-Don't copy and paste the entire program when you create a new question. Only change the relevant numbers and variables when you create a new question. Some possible questions are: Alice wants to buy a new bike. The bike costs $400, but she has a coupon that gives her a 10% discount. She also has to pay a 7% sales tax ...
def solve() -> int: discounted_price = 400 * (1 - 0.1) tax = discounted_price * 0.07 final_price = discounted_price + tax result = final_price return result
Lily has a wall that is 12 feet high and 10 feet wide. She wants to paint it with a new color. She needs to paint both sides of the wall. Paint costs $5 per quart and a quart is good for 5 square feet. How much does she spend on paint?
def solve() -> int: height = 12 width = 10 area = 2 * height * width paint_needed = area / 5 cost_per_quart = 5 total_cost = paint_needed * cost_per_quart result = total_cost return result
Jessica has five bags of apples, each containing seven apples. If she eats three apples and then gives away two bags full of apples, how many apples does she have left?
def solve() -> int: num_bags = 5 apples_in_bag = 7 num_eaten = 3 num_bags_given_away = 2 total_apples = num_bags * apples_in_bag leftover_apples = total_apples - num_eaten - (num_bags_given_away * apples_in_bag) result = leftover_apples return result
Wade has 80 fish in his aquarium. If 25% of them are neon tetras and 60% of the remainder are betta fish, how many betta fish does Wade have?
def solve() -> int: total_fish = 80 neon_tetras = total_fish * 0.25 remainder = total_fish - neon_tetras betta_fish = remainder * 0.6 result = betta_fish return result
A car rental company offers a flat rate of $50 per day for car rentals. If the rental goes over 3 days, the rate decreases to $45. If you rent a car for 5 days, how much would you pay?
def solve() -> int: regular_rate = 50 discount_rate = 45 discount_threshold = 3 rental_days = 5 if rental_days <= discount_threshold: total_cost = regular_rate*rental_days else: total_cost = (discount_rate*(rental_days-discount_threshold))+(regular_rate*discount_threshold) re...
Alex, Mia, Jake and Zoe want to share a bag of candies equally. The bag contains 120 candies, of which 40 are red, 30 are green, 25 are blue and 25 are yellow. How many candies of each color does each child get?
def solve() -> int: candies = 120 children = 4 per_child = candies // children red_per_child = 40 // children green_per_child = 30 // children blue_per_child = 25 // children yellow_per_child = 25 // children result = (red_per_child, green_per_child, blue_per_child, yellow_per_child) ...
Mike goes to the farmers market to buy carrots. They sell them for 2 dollars per pound. He spent 8 dollars. How many pounds of carrots did he buy?
def solve() -> int: carrots_price_per_pound = 2 total_spent = 8 pounds_of_carrots = total_spent / carrots_price_per_pound result = pounds_of_carrots return result
Student: Adam wants to travel for 200 KM to visit his friend. If he travels 90 km by car and walks the rest of the way, how much percent of the total distance did he walk?
def solve() -> int: total_distance = 200 car_distance = 90 walk_distance = total_distance - car_distance percentage = walk_distance / total_distance * 100 result = percentage return result
Ethan is saving money for a new skateboard by shoveling snow. He charges $20 per driveway. The skateboard costs $170. If he has already shoveled 6 driveways, how many more driveways does he need to shovel to earn enough for the skateboard?
def solve() -> int: driveway_cost = 20 skateboard_cost = 170 driveways_shoveled = 6 total_cost = skateboard_cost - (driveway_cost * driveways_shoveled) driveways_needed = total_cost / driveway_cost result = driveways_needed return result
Tom visited a supermarket and bought 4 apples, 3 kiwis, and 2 oranges. If the cost of each apple is $1.25, each kiwi is $0.75 and each orange is $2.50, how much did Tom spend altogether?
def solve() -> int: apples = 4 kiwis = 3 oranges = 2 cost_of_apple = 1.25 cost_of_kiwi = 0.75 cost_of_orange = 2.50 total_cost = apples*cost_of_apple + kiwis*cost_of_kiwi + oranges*cost_of_orange result = total_cost return result
Leo wants to buy a skateboard that costs $25, a helmet that costs $15, and a pair of knee pads that costs $10. He has saved $30 from his birthday. How much more money does Leo need to buy all three items?
def solve() -> int: skateboard = 25 helmet = 15 knee_pads = 10 savings = 30 total_cost = skateboard + helmet + knee_pads difference = total_cost - savings result = difference return result
A car uses 7.5 litres of petrol for every 100 kilometres. How many litres of petrol will be used for a 600 kilometres journey?
def solve() -> int: litres_per_km = 7.5/100 litres = litres_per_km*600 result = litres return result
A hotel has a rate of $120 per night. If John stays for 5 nights, how much will it cost him?
def solve() -> int: nights_stayed = 5 room_rate = 120 total_cost = nights_stayed * room_rate result = total_cost return result
A worker earns $14.75 an hour. If the worker works 40 hours in a week, how much money will he earn?
def solve() -> int: hourly_wage = 14.75 hours_worked = 40 weekly_pay = hourly_wage * hours_worked result = weekly_pay return result
Luisa is driving 500 miles in her car. She drives the first 200 miles at 40mph and the rest of the miles at 50mph. How long will her drive take her in hours?
def solve() -> int: distance1 = 200 time1 = distance1 / 40 distance2 = 500 - distance1 time2 = distance2 / 50 total_time = time1 + time2 result = total_time return result
A coffee chain offers a $1 discount for every $5 purchase on any drink in the menu. If Sarah spent $25 on drinks, how much did she save in total?
def solve() -> int: purchase_amount = 25 discount = purchase_amount // 5 saved_amount = discount * 1 result = saved_amount return result
At the store, there were 120 customers. Half of them paid with cash, and the other half paid with credit cards. If one-third of the cash payments were for amounts greater than $50,000, how many transactions exceeded $50,000?
def solve() -> int: total_customers = 120 cash_payments = total_customers / 2 cash_payments_exceeding_50000 = cash_payments / 3 result = cash_payments_exceeding_50000 return result
A baker purchased 10 packages of sugar, each package containing 8 ounces of sugar. How much sugar did the baker purchase in total?
def solve() -> int: numPackages = 10 packageSize = 8 totalSugar = numPackages * packageSize result = totalSugar return result
If a dog has twice as many legs as a cat, and a cat has four legs, how many legs does a dog have?
def solve() -> int: cat_legs = 4 dog_legs = 2 * cat_legs result = dog_legs return result
Student: A car rental company charges a flat rate of $30 plus $0.20 per minute for renting a car. How long can someone rent the car if they have a budget of $50?
def solve() -> int: flat_rate = 30 per_minute = 0.20 budget = 50 total_cost = flat_rate + (per_minute * budget) total_time = (budget - flat_rate) / per_minute result = total_time return result
Asha has a box full of markers. Most of the markers are pink in color with three variations: blue, green, and purple. For every two blue markers, there are five green markers, and for every three green markers, there are six purple markers. If there are four blue markers, how many purple markers are in Asha's box?
def solve() -> int: blue_markers = 4 green_markers = blue_markers * 5 / 2 purple_markers = green_markers * 6 / 3 result = purple_markers return result
In a certain tea shop, chai tea comprised 59% of the drinks sold. If 851 drinks were sold, how many chai tea were sold?
def solve() -> int: drinks_sold = 851 percent = 0.59 result = drinks_sold*percent return result
Possible questions and programs: Mia likes to drink mango juice. She can buy a pack of 12 cans of juice at Walmart for 9 dollars. At the convenience store, a single can costs 1.25 dollars. How much money does she save by buying the pack?
def solve() -> int: cost_single = 1.25 cost_12_cans = cost_single * 12 cost_pack = 9 savings = cost_12_cans - cost_pack result = savings return result
Tiffany's bike speed is 15 kilometers per hour faster than Julian's bike speed. In 3 hours, their distance difference will be 45 kilometers less than their coach's farthest distance. If Julian's speed is 30 kilometers per hour, what is their coach's farthest distance?
def solve() -> int: julian_speed = 30 tiffany_speed = julian_speed + 15 time = 3 distance_diff = tiffany_speed * time - julian_speed * time coach_distance = distance_diff + 45 + julian_speed * time result = coach_distance return result
Lily is brewing coffee. She adds 6 ounces of ground coffee, 2 tablespoons of sugar, 1/2 tablespoon of cinnamon, 1 teaspoon of vanilla extract, and one-tenth as much nutmeg as cinnamon. What percentage of the coffee is ground coffee, rounded to the nearest integer?
def solve() -> int: ground_coffee = 6 sugar = 2 cinnamon = 1/2 vanilla_extract = 1 nutmeg = cinnamon/10 total_coffee = ground_coffee + sugar + cinnamon + vanilla_extract + nutmeg percentage_ground_coffee = (ground_coffee / total_coffee) * 100 rounded_percentage = round(percentage_gr...
Rachel needs to score at least 85 points to be eligible for an honors program. She earned 25 points for each essay and 30 points for each presentation, but lost 10 points for plagiarism. How much higher than 85 points does Rachel need to score to offset her deduction?
def solve() -> int: essay_points = 25 presentation_points = 30 plagiarism_deduction = 10 minimum_eligible_points = 85 total_points = (essay_points * 3) + (presentation_points * 2) - plagiarism_deduction difference = total_points - minimum_eligible_points result = difference ...
There were 1600 apples in a basket. 7/8 of the apples were sold and 2000 new apples were added in their place. What percentage of the original apples are still in the basket?
def solve() -> int: initial_apples = 1600 apples_sold = initial_apples * 7/8 new_apples = 2000 total_apples = initial_apples + new_apples percent_remaining = initial_apples/total_apples * 100 result = percent_remaining return result
A jar contains 18 red marbles and 12 blue marbles. Sam takes out 6 marbles at random without looking and puts them in a bag. What is the probability that the bag contains exactly 4 red marbles and 2 blue marbles?
def solve() -> int: from fractions import Fraction from math import comb total_ways = comb(30, 6) favorable_ways = comb(18, 4) * comb(12, 2) probability = Fraction(favorable_ways, total_ways) result = probability return result
A school has 350 students. If 28% of the students are in grade 6, how many students are in grade 6?
def solve() -> int: total_students = 350 grade6_percentage = 28 grade6_number = (grade6_percentage/100) * total_students result = grade6_number return result
Student: Aili worked for 42 days this month and was paid $7.50 per hour. She spent 3 hours on the weekend taking care of her kids, and her employers gave her $30 in bonus. How much did she make in total this month?
def solve() -> int: days = 42 hourly_wage = 7.50 weekend_hours = 3 bonus = 30 total_wage = (days * hourly_wage * 8) + (weekend_hours * hourly_wage) + bonus result = total_wage return result
Sarah is 28 and her husband Daniel is 35 years old. Their son, Ethan was born when Daniel was 31. How old was Sarah when she gave birth to Ethan?
def solve() -> int: sarah_age = 28 daniel_age = 35 ethan_age = daniel_age - (35 - 31) sarah_ethan_age_diff = ethan_age - sarah_age result = sarah_ethan_age_diff return result
Possible additional questions and programs are: Sara has 24 cupcakes and she wants to share them with her friends. She gives 1/3 of the cupcakes to Lucy, 1/4 of the cupcakes to Max, and the rest to Emma. How many cupcakes does Emma get?
def solve() -> int: lucy = 24 / 3 max = 24 / 4 emma = 24 - lucy - max result = emma return result
If Julia has two 10-minute coffee breaks and a 45-minute lunch break at work, how many minutes of her workday are spent on breaks?
def solve() -> int: coffee_break = 10 lunch_break = 45 total_break = (2 * coffee_break) + lunch_break result = total_break return result
The distance from New York to Boston is 200 miles and the distance from Boston to Washington D.C. is 400 miles. If a person travels to all three cities, what is the total distance he or she will travel?
def solve() -> int: distance_NY_Boston = 200 distance_Boston_DC = 400 total_distance = distance_NY_Boston + distance_Boston_DC result = total_distance return result
Alex receives a weekly allowance of $20. He spends $7 on food, $4 on transportation, and saves half of the rest. How much money does he save each week?
def solve() -> int: allowance = 20 food = 7 trans = 4 rest = allowance - food - trans savings = rest/2 result = savings return result
Amanda earns 65 cents for every mile she runs. She also earns a bonus of 15 dollars for every 120 miles ran. If she runs 300 miles, including bonuses, how much will she earn?
def solve() -> int: cents_per_mile = 65 bonus_per_mile = 15/120 total_miles = 300 earnings_without_bonus = cents_per_mile * total_miles / 100 earnings_from_bonus = bonus_per_mile * (total_miles // 120) * 100 total_earnings = earnings_without_bonus + earnings_from_bonus re...
If you buy 3 packs of pencils that cost $1.25 each, 4 pens that cost $0.70 each, and 2 packs of markers that cost $5.00 each, what is the total cost?
def solve() -> int: pencil_cost = 1.25 number_of_packs_pencils = 3 pen_cost = 0.70 number_of_pens = 4 marker_cost = 5.00 number_of_packs_markers = 2 total_cost = (pencil_cost*number_of_packs_pencils) + (pen_cost*number_of_pens) + (marker_cost*number_of_packs_markers) result = total_cost ...
A cake recipe needs 1/4 cups of sugar. If you want to make 2 cakes, how many cups of sugar do you need in total?
def solve() -> int: sugar_recipe = 1/4 number_cakes = 2 total_sugar = sugar_recipe * number_cakes * 2 result = total_sugar return result
Student: Catherine is buying 3 items with a suggested retail price of $15 each. She is offered a 20% discount and shipping is free. How much will she save compared to the original prices?
def solve() -> int: item_price = 15 discount_percentage = 0.2 total_price_before_discount = item_price * 3 total_price_after_discount = total_price_before_discount * (1 - discount_percentage) amount_saved = total_price_before_discount - total_price_after_discount result = amount_saved retur...
A train travels 600 km in 6 hours. How long will it take for the train to travel 800 km at the same speed?
def solve() -> int: distance1 = 600 time1 = 6 distance2 = 800 time2 = (distance2*time1)/distance1 result = time2 return result
A bakery sells cakes, pies, and muffins. Each cake costs $12, each pie costs $8, and each muffin costs $1. On Monday, the bakery sold 15 cakes, 10 pies, and 40 muffins. On Tuesday, the bakery sold twice as many cakes and pies as on Monday, but half as many muffins. How much money did the bakery make from selling cakes,...
def solve() -> int: monday_cakes_cost = 15 * 12 monday_pies_cost = 10 * 8 monday_muffins_cost = 40 * 1 tuesday_cakes_cost = 2 * 15 * 12 tuesday_pies_cost = 2 * 10 * 8 tuesday_muffins_cost = 0.5 * 40 * 1 total_cost = monday_cakes_cost + monday_pies_cost + monday_muffins_cost + tuesday_cakes_c...
If Andrew has 4 hours more than John, who has 5 hours less than Peter, who has 20 hours to finish his homework. If Eric has 2 hours less than twice the time left compared to Andrew, how many hours in total do these four have left for homework?
def solve() -> int: peter = 20 john = peter - 5 andrew = john + 4 eric = (2*andrew) - 2 total = peter + john + andrew + eric result = total return result
Paul traveled 600km in a car. If the car ran at a constant speed of 75 km/h, how long did the trip take?
def solve() -> int: speed = 75 distance = 600 time_in_hr = distance/speed time_in_min = time_in_hr * 60 result = time_in_min return result
In 9 years, Ella will be five times as old as Lily is now. Lily is currently 4 years more than two times as old as Cole is now. Cole is currently 3 years younger than Noah is now. If Noah is currently 6 years old, how old will Ella be in 9 years?
def solve() -> int: noah = 6 cole = noah - 3 lily = 2 * cole + 4 ella = 5 * lily + 9 result = ella return result
Student: Sally has 18 sweets. She eats 3/4 of them and then shares the remaining with her friend. How many sweets does each person get?
def solve() -> int: sweets = 18 eaten = 3/4 * sweets remaining = sweets - eaten result = remaining / 2 return result
Student: A store has 15 televisions for sale, each costing $350. How much money would Jack need to buy all of the televisions?
def solve() -> int: num_of_tvs = 15 price_of_tv = 350 total_cost = num_of_tvs * price_of_tv result = total_cost return result
- A pack of gum has 10 mg of sugar per piece. Alex wants to limit his sugar intake to 50 mg per day. If he chews four pieces of gum, how many milligrams of sugar did Alex consume over his limit?
def solve() -> int: sugar_per_piece = 10 sugar_limit = 50 gum_pieces = 4 sugar_from_gum = sugar_per_piece * gum_pieces sugar_over_limit = sugar_from_gum - sugar_limit result = sugar_over_limit return result
David uses 3 batteries per month in his flashlight. Each battery lasts for 7 hours. He decides to buy a 56-hour battery pack. How many months can he use it without buying new batteries?
def solve() -> int: batteries_per_month = 3 battery_lifetime = 7 battery_pack_lifetime = 56 total_batteries_needed = battery_pack_lifetime / battery_lifetime months_without_buying_batteries = total_batteries_needed / batteries_per_month result = months_without_buying_batteries ...
Student: Peter has 3 packs of cookies. On Monday he ate 6 cookies and Tuesday he ate the same amount. How many cookies did Peter eat in total?
def solve() -> int: packs_of_cookies = 3 cookies_per_pack = 12 cookies_eaten_on_monday = 6 cookies_eaten_on_tuesday = cookies_eaten_on_monday total_cookies_eaten = (cookies_eaten_on_monday + cookies_eaten_on_tuesday) * packs_of_cookies result = total_cookies_eaten return result
Leo read 4 times as many books as his cousin Max, who read 7 books. The most avid reader in their library read 10 more books than Leo. How many books did the avid reader read?
def solve() -> int: leo = 4 max = 7 avid = 10 leo_books = leo * max avid_books = avid + leo_books result = avid_books return result
Sally is doing a survey and finds that 70% of people prefer dogs over cats. If she surveys 100 people randomly, how many would she expect to prefer cats?
def solve() -> int: percent_dogs = 70 total_people = 100 percent_cats = 100 - percent_dogs expected_cats = (percent_cats / 100) * total_people result = expected_cats return result
In a group of 24 students, two-thirds are wearing sweaters and the remainder are wearing coats. If the number of students wearing coats is double the number of students wearing sweaters, how many students are wearing sweaters?
def solve() -> int: students = 24 thirds = students // 3 coats = thirds * 2 sweaters = coats - thirds result = sweaters return result
has 3 times as many CDs as DVDs but 5 fewer DVDs than video games. If she has 18 CDs, how many video games make up her collection?
def solve() -> int: total_CDs = 18 DVDs = total_CDs/3 - 5 result = DVDs + total_CDs return result
Student: Ava, Cole, Ella and Finn are cousins. Ava is 5 years older than Cole, and Ella is 3 years younger than Finn. If Cole is 8 years old, and Finn is 11 years old, how old are all four cousins in total?
def solve() -> int: cole_age = 8 ava_age = cole_age + 5 finn_age = 11 ella_age = finn_age - 3 total_age = cole_age + ava_age + finn_age + ella_age result = total_age return result
To prepare for his presentation, James has to read 15 pages of a book, watch 2 videos, and do research on the internet for 30 minutes. He can read each page of the book in 2 minutes, each video takes 5 minutes to watch, and the research takes 1 minute to gather information for each minute spent. How long will it take J...
def solve() -> int: book_pages = 15 video_count = 2 research_time = 30 book_time = book_pages * 2 video_time = video_count * 5 research_info_time = research_time total_time = book_time + video_time + research_info_time result = total_time return result
A truck carrying two tanks is on its way to deliver water. The first tank has a capacity of 2500 liters and is filled to the brim. The second tank has a capacity of 3500 liters but is only 60% filled. How many more liters of water are needed to fill both tanks?
def solve() -> int: first_tank_capacity = 2500 second_tank_capacity = 3500 second_tank_filled_percentage = 60 second_tank_filled_liters = (second_tank_filled_percentage / 100) * second_tank_capacity total_liters_needed = first_tank_capacity + (second_tank_capacity - second_tank_filled_liters) ...
``` Carlos has 16 books on his bookshelf. He wants to put an equal number of books on each of his 4 shelves. How many books will be on each of the shelves?
def solve() -> int: books_per_shelf = 16 // 4 result = books_per_shelf return result
Sara has a rectangular garden that measures 12 meters by 8 meters. She wants to plant roses along the perimeter of the garden. She needs one rose plant for every meter of the perimeter. Each rose plant costs $2.50. How much money does Sara need to buy all the rose plants?
def solve() -> int: length = 12 width = 8 rose_cost = 2.5 perimeter = (length + width) * 2 rose_plants = perimeter * 1 money_needed = rose_plants * rose_cost result = money_needed return result
imon is taking a geometry course and needs to complete 50 problems. Each page has 10 problems in it. How many pages does Simon need to complete?
def solve() -> int: total_problems = 50 problems_in_each_page = 10 num_of_pages = total_problems//problems_in_each_page result = num_of_pages return result
Jeff has $350.00 on his credit card and the credit card company charges an 11% interest rate. What will be the new balance if he makes a payment of $30.00 this month?
def solve() -> int: balance = 350 payment = 30 interest_rate = 0.11 remaining_balance = balance - payment new_balance = remaining_balance + (remaining_balance*interest_rate) result = new_balance return result
A room is 12 feet long, 9 feet wide, and 8 feet tall. What is the volume of the room in cubic feet?
def solve() -> int: length = 12 width = 9 height = 8 result = length * width * height return result
Tyler studies for exams. He studies for 1 hour every afternoon except for 4 days per week. How many hours does he study in a year?
def solve() -> int: days_per_week = 7 days_not_studying = 4 hours_per_day = 1 days_studying = days_per_week - days_not_studying weeks_per_year = 52 hours_per_year = days_studying * hours_per_day * weeks_per_year result = hours_per_year return result
Each month, Alex earns $450. Every three months, he spends $415 on new clothes. How long will it take him to save $1,500?
def solve() -> int: months = 0 savings = 0 while savings < 1500: months += 1 savings += 450 if months % 3 == 0: savings -= 415 result = months return result
Sarah saves 18% of her $60,000 salary every year. She wants to buy a new motorcycle which costs $10,000 and needs to save up for a 50% downpayment. How long will it take her to reach her goal?
def solve() -> int: salary = 60000 savings_percentage = 0.18 motorcycle_cost = 10000 downpayment_percentage = 0.5 annual_savings = salary * savings_percentage downpayment_amount = motorcycle_cost * downpayment_percentage years_to_save = downpayment_amount / annual_savings resul...
Student: Faith bought two items - one for $50 and the other for $75. The store charges a 10% tax rate on all items. What was the total cost of Faith's purchase including tax?
def solve() -> int: item1 = 50 item2 = 75 tax_rate = 0.1 total_cost_before_tax = item1 + item2 total_tax = total_cost_before_tax * tax_rate result = total_cost_before_tax + total_tax return result
Emily has 24 candy bars for a Halloween party. She wants to divide them equally among her 8 friends. How many candy bars will each friend get?
def solve() -> int: candy_bars_per_friend = 24/8 result = candy_bars_per_friend return result
A small crate can hold 12 bottles and a large crate can hold 24 bottles. Tom has ordered 4 small crates and 3 large ones of soda. He wants to drink 50% of the soda himself. His 2 friends Alex and Bob want to share the rest equally. How many bottles will each of them get?
def solve() -> int: small_crate_capacity = 12 large_crate_capacity = 24 small_crates_ordered = 4 large_crates_ordered = 3 total_small_bottles = small_crate_capacity * small_crates_ordered total_large_bottles = large_crate_capacity * large_crates_ordered total_bottles = total_s...
A recipe calls for 2/3 cup of sugar. If you want to make half the recipe, how much sugar will you need?
def solve() -> int: recipe_amount = 2/3 recipe_scale = 1/2 new_amount = recipe_amount * recipe_scale result = new_amount return result
Kevin has twice as much money as David. If Kevin has $320, how much money does David have?
def solve() -> int: david = 320 / 2 result = david return result
A grocery store sells strawberries and blueberries for a total of $15. If the strawberries cost $6 more than the blueberries, what is the cost of the strawberries?
def solve() -> int: strawberries_cost = 4.5 + 6 result = strawberries_cost return result
A photographer is going on a seven day vacation where she will not have access to her email. On the first day, she receives 15 new photo editing requests. On each of the following days, she receives one-sixth as many new editing requests as she received on the previous day. How many new editing requests will she have t...
def solve() -> int: day_1 = 15 day_2 = day_1 / 6 day_3 = day_2 / 6 day_4 = day_3 / 6 day_5 = day_4 / 6 day_6 = day_5 / 6 day_7 = day_6 / 6 total_requests = day_1 + day_2 + day_3 + day_4 + day_5 + day_6 + day_7 result = total_requests return result
Rebecca’s electricity and gas bill costs her an average of $70 per month. On her first month, she received a rebate of one-quarter the regular price. Nevertheless, in the fourth month, her gas bills were much higher than usual, and she ended up paying an extra $10. How much did Rebecca pay for electricity and gas in th...
def solve() -> int: avg_cost_per_month = 70 rebate = avg_cost_per_month / 4 extra_payment = 10 total_cost_first_month = avg_cost_per_month - rebate total_cost_fourth_month = avg_cost_per_month + extra_payment total_cost_seven_months = (total_cost_first_month * 1) + (avg_cost_per_month ...
Lisa made a necklace with beads. She used 15 blue beads that cost $0.1 each, 10 red beads that cost $0.2 each, and 5 green beads that cost $0.3 each. She also bought a string that cost $1. How much did she spend on making the necklace?
def solve() -> int: blue_cost = 15 * 0.1 red_cost = 10 * 0.2 green_cost = 5 * 0.3 total_cost = blue_cost + red_cost + green_cost + 1 result = total_cost return result
Robert made a design with 16 equal tiles. Four tiles are yellow and the number of green tiles is three times the number of yellow tiles. Eight tiles are purple and the remaining tiles are white. How many white tiles are there?
def solve() -> int: result = 0 for i in range(16): if i < 4: result += 0 elif 4 <= i < 12: result += 0 else: result += 1 return result
A rectangle has a length of 15 cm and a width of 8 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 15 width = 8 perimeter = 2 * (length + width) result = perimeter return result
Peter has 15 chickens. If he sells 40% of the chickens, and the remaining increase in value by 75%, how much were the remaining chickens worth?
def solve() -> int: chickens = 15 sold_chickens = chickens * 0.4 remaining_chickens = chickens - sold_chickens increased_value = remaining_chickens * 0.75 worth_of_remaining_chickens = remaining_chickens + increased_value result = worth_of_remaining_chickens return result
arah has a collection of stuffed animals. She has 3 teddy bears, 4 dogs, 2 cats, and 1 elephant. How many legs do all of her stuffed animals have in total?
def solve() -> int: num_legs = (3*4) + (4*4) + (2*4) + (1*4) result = num_legs return result
A recipe calls for 2 1/2 cups of flour. How many cups of flour are needed for 3 batches of the recipe?
def solve() -> int: cups_per_batch = 2.5 num_batches = 3 total_cups = cups_per_batch * num_batches result = total_cups return result
A plant grows 5 inches every week. If it is currently 29 inches tall, how many weeks will it take to grow to a height of 50 inches?
def solve() -> int: growth_per_week = 5 current_height = 29 target_height = 50 num_weeks = (target_height - current_height) // growth_per_week + (target_height - current_height) % growth_per_week > 0 result = num_weeks return result
Emily bought a house for $500,000 and spent $200 every month on utilities. She also spent $15,000 on repairs. If she sold the house for $600,000 after one year, what is her profit?
def solve() -> int: house_price = 500000 utilities_cost = 200 * 12 repair_cost = 15000 selling_price = 600000 total_cost = house_price + utilities_cost + repair_cost profit = selling_price - total_cost result = profit return result
If a restaurant employs 8 people and they work a total of 120 hours in a week, how many hours on average does each employee work in a week?
def solve() -> int: avg_hours_per_employee = 120/8 result = avg_hours_per_employee return result
If the profit gained on a pencil is 25% and the pencil costs $4, what is the selling price of the pencil?
def solve() -> int: cost_price = 4 profit_percentage = 25 profit = cost_price * ( profit_percentage / 100 ) selling_price = cost_price + profit result = selling_price return result
Lily and Jack are saving money for a trip. Lily saves $10 every week and Jack saves $8 every week. They both start with $0. How many weeks will it take them to have $200 together?
def solve() -> int: weekly_savings = 10 + 8 weeks = 200 / weekly_savings result = weeks return result
Daniel is painting his office space. The walls in the main workspace take up 1300 square feet. He has five small offices. The walls in each office take up 350 square feet. If one gallon of paint can cover 900 square feet, how many gallons of paint does Daniel need to paint his office space?
def solve() -> int: workspace_walls = 1300 office_walls = 350 number_of_offices = 5 gallons_coverage = 900 total_walls = workspace_walls + (office_walls * number_of_offices) gallons_needed = total_walls / gallons_coverage result = round(gallons_needed) return result
Student: A jar has 12 marbles and 8 stones. If the jar needs 25 items to be full, how many more items are needed?
def solve() -> int: marbles = 12 stones = 8 total_items = marbles + stones needed_items = 25 items_needed = needed_items - total_items result = items_needed return result
A store sells 10 pounds of apples for $14. How much would it cost for 5 pounds of apples?
def solve() -> int: cost_of_10_pounds = 14 cost_of_1_pound = cost_of_10_pounds / 10 cost_of_5_pounds = cost_of_1_pound * 5 result = cost_of_5_pounds return result
Student: Jill was preparing for a big family reunion and needed to buy snacks for the event. She has enough money to buy 17 bags of chips and each bag contains 10 chips. How many chips can Jill buy?
def solve() -> int: bags_of_chips = 17 chips_per_bag = 10 total_chips = bags_of_chips * chips_per_bag result = total_chips return result
There are 2000 employees in a company. If 12% of the employees are managers, and a quarter of that number have been with the company for over 10 years, how many employees are both managers and have been with the company for over 10 years?
def solve() -> int: total_employees = 2000 managers = total_employees * 0.12 ten_years = managers * 0.25 managers_and_ten_years = ten_years result = managers_and_ten_years return result
Lily runs 4 miles every Monday and Thursday. Then she runs three times as far she ran on Monday every Tuesday, Wednesday, and Friday. How many miles will she run in a month with 5 weeks?
def solve() -> int: monday_distance = 4 tuesday_distance = monday_distance * 3 wednesday_distance = monday_distance * 3 thursday_distance = 4 friday_distance = monday_distance * 3 week_distance = monday_distance + tuesday_distance + wednesday_distance + thursday_distance + friday_distance ...
Tom wants to buy a car that costs $20,000. He has saved up $10,000 and is saving $500 every month. How long will it take him to save up enough money?
def solve() -> int: cost = 20000 savings_so_far = 10000 saving_rate = 500 months_needed = (cost - savings_so_far) / saving_rate result = months_needed return result
Three farmers, Olivia, Peter, and Quentin, have different numbers of apples in their orchard. Olivia has 50 apples, Peter has 75 apples, and Quentin has 120 apples. How many more apples does Quentin have than both Olivia and Peter combined?
def solve() -> int: olivia_apples = 50 peter_apples = 75 quentin_apples = 120 total_apples = olivia_apples + peter_apples difference = quentin_apples - total_apples result = difference return result
At Sarah's bakery, she sells muffins in packs of 4 and cookies in packs of 2. If 6 customers order muffins and 20 customers order cookies, how many pastries does Sarah need to prepare?
def solve() -> int: muffins_per_pack = 4 cookies_per_pack = 2 num_muffin_orders = 6 num_cookie_orders = 20 total_muffins = muffins_per_pack * num_muffin_orders total_cookies = cookies_per_pack * num_cookie_orders total_pastries = total_muffins + total_cookies result = tota...
John earns twice as much as Jason every week. If John earns $720 in a week, how much does Jason earn?
def solve() -> int: Jason_earn = 720 / 2 result = Jason_earn return result