question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Maria solved 25 more math problems than twice the number of problems her brother solved. If they solved a total of 45 math problems, how many problems did Maria's brother solve?
def solve() -> int: brother_problems = 7 result = brother_problems return result
A recipe calls for 1/4 of a cup of sugar for every 2 cups of flour. If you have 8 cups of flour, how much sugar will you need?
def solve() -> int: flour = 8 flour_per_sugar = 2/0.25 sugar = flour/flour_per_sugar result = sugar return result
Student: A car travels 200 miles in 5 hours. What is the average speed of the car?
def solve() -> int: distance = 200 time = 5 speed = 0 speed = distance / time result = speed return result
Anna is baking cookies and needs 10 cups of sugar, 5 cups of butter, and 3 cups of chocolate chips. How many cups of ingredients does Anna need in total?
def solve() -> int: cups_of_sugar = 10 cups_of_butter = 5 cups_of_chocolate = 3 total_ingredients = cups_of_sugar + cups_of_butter + cups_of_chocolate result = total_ingredients return result
A rectangular box has a height of 8cm and a volume of 180cm^3. What is the length of the box if its width is twice its height?
def solve() -> int: height = 8 volume = 180 width = 2 * height length = volume / (height * width) result = length return result
A rectangular prism has a height of 8 meters, a length of 12 meters, and a width of 6 meters. What is the volume of the rectangular prism?
def solve() -> int: height = 8 length = 12 width = 6 volume = height * length * width result = volume return result
Student: A recipe calls for 2 cups of sugar to make 24 cookies. If you want to make 36 cookies, how much sugar will you need?
def solve() -> int: cookies = 36 original_cookies = 24 original_sugar = 2 sugar = (cookies / original_cookies) * original_sugar result = sugar return result
In a tennis match, Mike won 6 games. John won half as many games as Mike, and Cindy won 3 more games than John. The rest of the games were won by their teammates. If the whole team won 30 games, how many games did their teammates win?
def solve() -> int: games_Mike = 6 games_John = games_Mike/2 games_Cindy = games_John + 3 games_team = 30 games_rest = games_team - (games_Mike + games_John + games_Cindy) result = games_rest return result
Alex aims to drink 2.5 liters of water during the day. She drinks 400 milliliters of water every hour. How many hours does she need to drink?
def solve() -> int: target_amount = 2.5 hourly_amount = 0.4 hours_needed = target_amount / hourly_amount result = hours_needed return result
Laura can paint a room in 5 hours. If it takes her 2 hours to prep the room for painting, how long does it take her to complete the entire job, including prep?
def solve() -> int: paint_time = 5 prep_time = 2 total_time = paint_time + prep_time result = total_time return result
-------------------------------------------------------------------------------------- Here are 10 possible questions and programs: A cake recipe calls for 3 cups of flour, 2 cups of sugar, and 4 eggs. How many eggs are needed to make 6 cakes?
def solve() -> int: flour = 3 * 6 sugar = 2 * 6 eggs = 4 * 6 result = eggs return result
-You may use variables like x, y, z, etc. for unknown values. Some possible questions and programs are: If Amy runs 18 km in a marathon, and Bob runs 4 km more, how many km does Carl run if he runs only 60% as far as Amy?
def solve() -> int: amy = 18 bob = amy + 4 carl = 0.6 * amy result = carl return result
Diana needed to buy some grapes. The store was offering a 40% discount on the usual price. She spent a total of $18 for 12 pounds of grapes. What was the original price of the grapes?
def solve() -> int: total_price = 18 discount = 0.40 total_pounds = 12 discounted_price = total_price * discount original_price = (total_price + discounted_price) / total_pounds result = original_price return result
John has 5 books and wants to buy 7 more. How many books does he have in total?
def solve() -> int: total_books = 5 + 7 result = total_books return result
Janine went to the grocery store and bought 5 packs of cheese at $2 each, 6 bottles of milk at $3 each, and 3 packages of cookies at $4 each. How much did she spend in all?
def solve() -> int: cheese_price = 2 milk_price = 3 cookie_price = 4 num_cheese = 5 num_milk = 6 num_cookies = 3 total_cost = (cheese_price*num_cheese) + (milk_price*num_milk) + (cookie_price*num_cookies) result = total_cost return result
Michael wants to find a new hobby but doesn't know where to start. He tries out 15 different activities but doesn't enjoy any of them. Michael is picky so he does this a total of 6 times before he finally discovers a hobby he likes. If the activity he chooses is the 10th option on the final try, how many activities did...
def solve() -> int: activities_per_try = 15 total_tries = 6 final_try = 10 total_activities_tried = (activities_per_try * (total_tries - 1)) + final_try result = total_activities_tried return result
A car travels at a speed of 50 miles per hour for 3 hours and then at a speed of 70 miles per hour for 2 hours. What is the average speed of the car for the entire trip?
def solve() -> int: speed1 = 50 time1 = 3 distance1 = speed1 * time1 speed2 = 70 time2 = 2 distance2 = speed2 * time2 total_distance = distance1 + distance2 total_time = time1 + time2 average_speed = total_distance / total_time result = average_speed retu...
Student: A book that originally cost $30 is now on sale at 10% off. If you have a coupon worth 5% off the eventual sale price, how much will you pay?
def solve() -> int: original_cost = 30 sale_discount = 0.1 coupon_discount = 0.05 sale_price = original_cost * (1 - sale_discount) final_price = sale_price * (1 - coupon_discount) result = final_price return result
6 bottles of juice contain 3 liters of juice. The juice is poured equally into 9 glasses. How much juice is in each glass?
def solve() -> int: juice_per_bottle = 3 / 6 juice_per_glass = juice_per_bottle / 9 result = "Each glass has " + str(juice_per_glass) + " liters of juice." return result
A rectangle has a length of 10 cm and a width of 5 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 10 width = 5 perimeter = 2 * (length + width) result = perimeter return result
There are 600 balls in a bag, of which 144 are white, 192 are black, 72 are green, and the remaining balls are red. If a ball is chosen at random, what's the probability that it is not white?
def solve() -> int: total_balls = 600 white_balls = 144 black_balls = 192 green_balls = 72 red_balls = total_balls - white_balls - black_balls - green_balls non_white_prob = ((black_balls + green_balls + red_balls)/total_balls) * 100 result = non_white_prob return result
Lisa wants to make a pizza for her friends. She has a recipe that calls for 3 cups of flour to make one pizza. She wants to make 4 pizzas. How much flour will Lisa need in total?
def solve() -> int: flour_per_pizza = 3 num_pizzas = 4 total_flour = flour_per_pizza * num_pizzas result = total_flour return result
Alex drove West for 50 miles, then turned North and drove 30 miles less than the distance he had driven to the West. After turning East, Alex drove for 40 miles, how far did he travel in total?
def solve() -> int: distance_1 = 50 distance_2 = distance_1 - 30 distance_3 = 40 total_distance = distance_1 + distance_2 + distance_3 result = total_distance return result
Olivia went shopping and bought a t-shirt for $25, a pair of jeans for $50 and a jacket for $75. How much money did she spend in total?
def solve() -> int: price_tshirt = 25 price_jeans = 50 price_jacket = 75 total_price = price_tshirt + price_jeans + price_jacket result = total_price return result
A store has a total of $2500. If they sold $1500 worth of products, how much money does the store have left?
def solve() -> int: total_money = 2500 sold_money = 1500 remaining_money = total_money - sold_money result = remaining_money return result
A concert charges $20 for each ticket. If 4 tickets are bought, the fifth ticket is free. How much money will it cost for 7 people to attend the concert?
def solve() -> int: ticket_cost = 20 num_tickets = 7 tickets_costed = 5 total_cost = (num_tickets - tickets_costed) * ticket_cost + (tickets_costed * ticket_cost) result = total_cost return result
Emma has 18 eggs in a carton and 12 eggs in a bowl. She used 9 eggs to make a cake and bought 6 more eggs from the store. How many eggs does Emma have left?
def solve() -> int: carton = 18 bowl = 12 cake = 9 store = 6 before = carton + bowl after = before - cake + store result = after return result
A pair of shoes costs $50. A pair of shoes and three pairs of socks together cost $80. How much would you pay for 5 pairs of shoes and 4 pairs of socks?
def solve() -> int: shoe_cost = 50 shoe_socks_cost = 80 total_shoes = 5 total_socks = 4 total_cost = (total_shoes * shoe_cost) + (total_socks * ((shoe_socks_cost - shoe_cost) / 3)) result = total_cost return result
Student: The classroom has 36 chairs. If the teacher wants to arrange the chairs into 6 equal groups, how many chairs will be in each group?
def solve() -> int: chairs = 36 groups = 6 chairs_per_group = chairs // groups result = chairs_per_group return result
If a store sells 2,000 items a month for $10 each with a cost of $5 to produce each item, how much profit do they make each month?
def solve() -> int: items_per_month = 2000 price_per_item = 10 cost_per_item = 5 monthly_income = items_per_month * price_per_item monthly_cost = items_per_month * cost_per_item monthly_profit = monthly_income - monthly_cost result = monthly_profit return result
A baker has 15 dozen cakes. He sells 8 dozen in a day. How many days will it take for the baker to sell all the cakes?
def solve() -> int: total_cakes = 15 * 12 cakes_per_day = 8 * 12 days = total_cakes // cakes_per_day if total_cakes % cakes_per_day!= 0: days += 1 result = days return result
Adam is creating a painting with 6 different colors. He has 8 times as much yellow paint as red, and 2 times as much blue paint as yellow. If Adam can make 4 brushstrokes with each color, how many brushstrokes can Adam make?
def solve() -> int: num_red = 1 num_yellow = num_red * 8 num_blue = num_yellow * 2 num_brushstrokes = min(num_red*4, num_yellow*4, num_blue*4) result = num_brushstrokes return result
Lisa is making necklaces and wants to have enough to sell at least 50. She thinks that she will lose 1/5 of them while making. For each bundle of beads, she can make 2 necklaces. How many bundles of beads should Lisa buy?
def solve() -> int: bundles_to_buy = 50 / (2 * (1 - 1/5)) result = int(bundles_to_buy) return result
Student: A bottle contains 2 liters of soda. If each person gets 250 ml, how many people can be served?
def solve() -> int: bottle_volume = 2000 person_volume = 250 num_people = bottle_volume // person_volume result = num_people return result
The ratio of two numbers is 3:4. If the larger number is 72, what is the smaller number?
def solve() -> int: num1 = 72*(3/7) num2 = 72*(4/7) num2 = num2 result = num2 return result
John had a collection of 50 baseball cards. He sold 30% of them and then bought 20 more. How many cards does he have now?
def solve() -> int: cards = 50 sold = cards * 0.3 remaining_cards = cards - sold + 20 result = remaining_cards return result
As chefs, Ria, Ken, and Lin have been cooking a lot of dishes over the week. Ria has cooked 35 dishes for the week and Ken has cooked 5 more dishes than Ria. Meanwhile, Lin has cooked half as many dishes as Ken was able to. How many dishes have they cooked for the entire week?
def solve() -> int: ria = 35 ken = ria + 5 lin = ken / 2 total = ria + ken + lin result = total return result
A family bought 3 ice cream cones. The first and second cost $3 each and the third cost $2 less. How much did they spend in total?
def solve() -> int: price_one = 3 price_two = 3 price_three = 2 total_price = price_one + price_two + price_three result = total_price return result
Student: John has 14 marbles and 6 more stones than he has marbles. How many stones does he have?
def solve() -> int: marbles = 14 stones = marbles + 6 result = stones return result
Jake and Jenna are going on a road trip and need to stock up on snacks. They buy individual bags of chips and candy as well as bottles of water. They also buy three sandwiches for themselves. Chips are $1.50 each. Candy is $2 each. Bottled water is $1.25 each. Sandwiches are $7 each. How much did they spend on their ro...
def solve() -> int: chips = 4 candy = 3 water = 2 sandwiches = 3 chips_cost = chips * 1.5 candy_cost = candy * 2 water_cost = water * 1.25 sandwiches_cost = sandwiches * 7 total_cost = chips_cost + candy_cost + water_cost + sandwiches_cost result = total_cost return result
A cylindrical water storage tank has a diameter of 2 meters and a height of 4 meters. If the water is being pumped at a rate of 20 liters per minute, how long will it take to fill the tank?
def solve() -> int: r = 2/2 volume = 3.14*(r**2)*4 time = volume/(20*60) result = time return result
A recipe calls for 2/3 cups of sugar to make 20 cookies. If you want to make 48 cookies, how many cups of sugar do you need?
def solve() -> int: cookies_needed = 48 cookies_given = 20 sugar_given = 2/3 result = (sugar_given / cookies_given) * cookies_needed return result
During a friendly race, five athletes each ran for a different amount of time. Athlete 1 finished in 40 seconds, athlete 2 took 45 seconds, athlete 3 ran in 50 seconds, athlete 4 ran in 25 seconds, and athlete 5 took 5 seconds more than athlete 4. How long, in seconds, did it take all the athletes to complete the race?
def solve() -> int: athlete_1 = 40 athlete_2 = 45 athlete_3 = 50 athlete_4 = 25 athlete_5 = athlete_4 + 5 result = athlete_1 + athlete_2 + athlete_3 + athlete_4 + athlete_5 return result
David went to a restaurant and ordered a burger and fries for $10. He also ordered a drink for $2. He paid the waiter $20. How much change did he receive?
def solve() -> int: meal_cost = 10 + 2 total_cost = meal_cost change = 20 - total_cost result = change return result
Emma has $200. She spends one-twelfth on a book and a certain amount on a bookmark. If Emma has $165 remaining, how much did the bookmark cost, together, in dollars?
def solve() -> int: book = 200 / 12 spent = 200 - 165 bookmark = spent - book result = bookmark return result
There are 3 times as many cats as dogs in the pet store. If there are 15 dogs in the store, how many cats are there?
def solve() -> int: dogs = 15 cats = 3 * dogs result = cats return result
Sarah had 90 pencils. She gave 1/3 of them to her sister, Emma, and then gave 2/5 of the remaining pencils to her brother, James. How many pencils did Sarah give to James?
def solve() -> int: pencils = 90 sister_share = pencils * (1/3) remaining_pencils = pencils - sister_share james_share = remaining_pencils * (2/5) result = james_share return result
Lily is making a salad. The recipe calls for 1/2 cup of carrots per serving. In a bag of carrots, there are 3 cups of carrots. How many servings of salad can Lily make with one bag of carrots?
def solve() -> int: carrots_per_serving = 1/2 carrots_in_bag = 3 servings_of_salad = carrots_in_bag / carrots_per_serving result = servings_of_salad return result
The price per pound of tomatoes is 50 cents. The price of a crate of tomatoes that weighs 20 pounds is $8. How much can you save, in cents per pound, if you buy a crate versus individual pounds of tomatoes?
def solve() -> int: price_per_pound = 50 crate_weight = 20 crate_price = 800 price_per_pound_crate = crate_price / crate_weight savings = price_per_pound - price_per_pound_crate result = savings return result
A group of students is collecting cans for recycling. They get $0.05 for every can they collect. They have 40 minutes to collect as many cans as they can. The winner is the person who collects the most cans. The winner collects 300 cans. How much money did they earn per can?
def solve() -> int: total_money = 300 * 0.05 money_per_can = total_money / 300 result = money_per_can return result
onya is saving up to buy a bike. She bought a bike last year for $125. This year she wants to buy the same kind of bike but it costs $135. If she wants to save up for the bike, how much money does she need to set aside each week if she has 5 weeks to save up?
def solve() -> int: total = 135 - 125 weeks = 5 amount = total/weeks result = amount return result
A recipe requires 2 cups of sugar for every 3 cups of flour. If you have 9 cups of flour, how many cups of sugar do you need?
def solve() -> int: flour = 9 sugar_per_flour = 2/3 sugar_required = flour * sugar_per_flour result = sugar_required return result
Ethan is a baker who bakes bread every day. He bakes 40 loaves of bread each day, and sells each loaf for $8. How much money does he make per week?
def solve() -> int: loaves_per_day = 40 price_per_loaf = 8 days_per_week = 7 total_loaves = loaves_per_day * days_per_week total_income = total_loaves * price_per_loaf result = total_income return result
Tina has a plan of saving $300 for eight weeks. She saved $10 in the first week and every week, she adds $20 more than the amount saved in the previous one. What is the amount of money that Tina will save on the eighth week to reach her goal?
def solve() -> int: week_one = 10 total_weeks = 8 total_savings_goal = 300 total_savings = week_one for i in range(2, total_weeks+1): savings_this_week = week_one + (i-1)*20 total_savings += savings_this_week savings_week_eight = total_savings_goal - total_savings + wee...
Possible math questions and programs: Amy is making cookies for her friends. She has 5 cups of flour, 3 cups of sugar, and 12 eggs. She needs 1 cup of flour, half a cup of sugar, and 2 eggs for each batch of cookies. How many batches of cookies can she make?
def solve() -> int: flour_batches = 5 // 1 sugar_batches = 3 // 0.5 egg_batches = 12 // 2 min_batches = min(flour_batches, sugar_batches, egg_batches) result = min_batches return result
Tyler sends 5 emails with 2-page attachments to 4 different colleagues every day. How many pages of attachments does he send in a week?
def solve() -> int: emails_per_day = 5 pages_per_email = 2 colleagues_per_day = 4 pages_per_day = emails_per_day * pages_per_email * colleagues_per_day pages_per_week = pages_per_day * 7 result = pages_per_week return result
A candy store sells chocolates for $2 per piece and gummies for $1 per piece. If you buy 10 or more chocolates, you get a 10% discount on the chocolates. If you buy 20 or more gummies, you get a 5% discount on the gummies. How much would it cost in total to buy 15 chocolates and 25 gummies?
def solve() -> int: chocolate_price = 2 chocolate_quantity = 15 gummy_price = 1 gummy_quantity = 25 if chocolate_quantity >= 10: chocolate_discount = 0.1 else: chocolate_discount = 0 if gummy_quantity >= 20: gummy_discount = 0.05 else: gummy_discount = 0 ...
Student: Eight children bought 16 candy bars and divided them equally. If each candy bar costs $0.75, how much money did they spend in total?
def solve() -> int: num_children = 8 num_candy_bars = 16 cost_per_candy_bar = 0.75 total_cost = num_children * num_candy_bars * cost_per_candy_bar result = total_cost return result
Possible questions and programs: A can of juice costs $1.20. The cost of a sandwich is 150% of the cost of the juice and the cost of a cookie is 40% of the cost of the juice. A group of 6 friends bought 6 cans of juice, 4 sandwiches, and 8 cookies. How much did they spend?
def solve() -> int: juice_cost = 1.2 sandwich_cost = juice_cost * 1.5 cookie_cost = juice_cost * 0.4 total_cost = (6 * juice_cost) + (4 * sandwich_cost) + (8 * cookie_cost) result = total_cost return result
Sandra wants to buy a new bike that costs $500. If she saves $20 each week, how many weeks will it take her to save up enough money to buy the bike?
def solve() -> int: total_cost = 500 weekly_savings = 20 number_of_weeks = total_cost / weekly_savings result = number_of_weeks return result
On national flower day, half of the students who joined the gardening club planted flowers. Of those students who planted flowers, one-third planted roses. There were four times as many students who planted tulips as were who planted roses. If 90 students joined the gardening club, how many planted tulips?
def solve() -> int: flower_students = 90 * (1/2) rose_students = flower_students * (1/3) tulip_students = rose_students * 4 result = tulip_students return result
A business earns a profit of $3000 in 5 months. What will be its average monthly income?
def solve() -> int: monthly_income = (3000/5) result = f'{monthly_income}' result = monthly_income return result
Student: Kyle has 24 oranges, while Lucas has twice as many oranges as Kyle. If Lucas ate 8 of his oranges, and Kyle gave 4 of his oranges to Lucas, how many oranges did Kyle have left?
def solve() -> int: kyle_oranges = 24 lucas_oranges = kyle_oranges * 2 lucas_oranges = lucas_oranges - 8 kyle_oranges = kyle_oranges - 4 lucas_oranges = lucas_oranges + 4 result = kyle_oranges return result
Denise needs seven yards of ribbon for her project. If the ribbon is sold in 6 yard lengths, how many lengths of ribbon does she need to buy?
def solve() -> int: total_yards_needed = 7 yards_in_length = 6 lengths_needed = total_yards_needed / yards_in_length result = lengths_needed return result
Jack has 180 toy cars. He gave 40 toy cars to his brother and then sold 1/2 of the remaining toy cars. If he had 20 toy cars left, how many toy cars were sold?
def solve() -> int: toy_cars = 180 brother = 40 leftover = toy_cars - brother sold = leftover - 20 result = sold return result
A teacher gives a quiz with 20 questions. Each correct answer is worth 5 points, each incorrect answer is worth -2 points, and each unanswered question is worth 0 points. If a student gets 12 correct, 4 incorrect, and leaves 4 unanswered, what is their total score?
def solve() -> int: correct_answers = 12 incorrect_answers = 4 unanswered = 4 correct_points = correct_answers * 5 incorrect_points = incorrect_answers * -2 total_points = correct_points + incorrect_points result = total_points return result
If a recipe for pancakes serves 8 people and calls for 2 cups of flour, how much flour is needed to make pancakes for 18 people?
def solve() -> int: people = 18 flour_per_person = 2 / 8 flour_needed = flour_per_person * people result = flour_needed return result
In a basket of 50 fruits, 70% are apples and the rest are oranges. Out of the oranges, 45% have a diameter larger than 5cm. How many oranges have a diameter larger than 5cm?
def solve() -> int: total_fruits = 50 num_apples = total_fruits * 0.7 num_oranges = total_fruits - num_apples num_large_oranges = num_oranges * 0.45 result = num_large_oranges return result
Mr. Rodriguez walks his dog twice a day. Yesterday morning, his dog ran 4 miles and in the evening, his dog ran 2 miles. This morning, his dog ran 1 mile less than he had yesterday morning. After playing with his dog in the evening, Mr. Rodriguez's dog has only 5 miles left. How much did he earn by running the dog if e...
def solve() -> int: morning_yesterday = 4 evening_yesterday = 2 morning_today = morning_yesterday - 1 total_distance = morning_yesterday + evening_yesterday + morning_today remaining_distance = 5 cost_per_mile = 4.50 total_cost = total_distance * cost_per_mile earned_money = total_c...
Olivia and Claire are skiing down a slope. Olivia goes down at a speed of 30 mph, while Claire skis 8 mph faster. If Olivia skis a distance of 2 miles, how far will Claire have skied by that time?
def solve() -> int: olivia_speed = 30 claire_speed = olivia_speed + 8 olivia_distance = 2 claire_distance = (claire_speed / olivia_speed) * olivia_distance result = claire_distance return result
Student: - A bakery sells 300 pastries. 80 pastries are croissants. 120 pastries are muffins. The rest are donuts. What percentage of pastries are donuts?
def solve() -> int: total_pastries = 300 croissants = 80 muffins = 120 donuts = total_pastries - croissants - muffins percentage_donuts = donuts / total_pastries * 100 result = percentage_donuts return result
Emma runs 5 miles a day for 7 days. She runs for 30 minutes a day on Monday and Wednesday. If she runs the same amount of time on Tuesday and Thursday, how long does she run on Thursday?
def solve() -> int: miles_per_day = 5 days = 7 total_miles = miles_per_day * days minutes_mon_wed = 30 minutes_tue_thu = minutes_mon_wed total_minutes = (minutes_mon_wed * 2) + (minutes_tue_thu * 2) minutes_per_day = total_minutes / days minutes_thursday = minutes_per...
At Pizza Place, pizzas cost $15 per pizza with a 5-pizza minimum. If Hank spent $150 on pizzas, how many pizzas over the minimum did he purchase?
def solve() -> int: total_pizzas = 150 / 15 pizzas_over_minimum = total_pizzas - 5 result = pizzas_over_minimum return result
A park has a capacity of 5,000 people. How many people can the park host in a month of 4 weekends?
def solve() -> int: capacity = 5000 weekends = 4 people_per_weekend = capacity / 2 people_per_month = people_per_weekend * weekends result = people_per_month return result
``` A bus travels 100 kilometers in 2 hours and 15 minutes. What is the bus's average speed in meters per second?
def solve() -> int: distance_km = 100 time_hours = 2.25 distance_m = distance_km * 1000 time_s = time_hours * 3600 speed_mps = distance_m / time_s result = speed_mps return result
Martin bought 10 books at a total cost of $7.20. If each book cost $0.72, how much money did Martin save from buying all 10 books together?
def solve() -> int: numBooks = 10 costPerBook = 0.72 totalCost = 7.20 priceFor10Books = numBooks * costPerBook discount = priceFor10Books - totalCost result = discount return result
Julia has saved $2000 to buy a plane ticket for her dream vacation. She asked her mom and her best friend to help her raise the total amount of money she needs for her trip. If her mom gave her 1/3 times of what she saved and her best friend gave her half of her mom's contribution, how much does the plane ticket cost i...
def solve() -> int: julias_savings = 2000 moms_contribution = julias_savings / 3 friends_contribution = moms_contribution / 2 total_money = julias_savings + moms_contribution + friends_contribution plane_ticket_cost = total_money - 1000 result = plane_ticket_cost return result
The temperature increased by 5 degrees every hour for 3 hours. If the original temperature was 70 degrees Fahrenheit, what is the final temperature?
def solve() -> int: original_temp = 70 temp_increase_per_hour = 5 hours_passed = 3 final_temp = original_temp + (temp_increase_per_hour * hours_passed) result = final_temp return result
``` Ava has 6 hours to finish her assignments. Her math homework takes her 40 minutes, her English homework takes her 25 minutes, her science homework takes her 35 minutes, and her history homework takes her 50 minutes. She also has to complete a special project that takes her 1 hour and 30 minutes. How much time does ...
def solve() -> int: total_time = 6 * 60 math_time = 40 english_time = 25 science_time = 35 history_time = 50 project_time = 90 time_spent = math_time + english_time + science_time + history_time + project_time time_left = total_time - time_spent result = time_left return result
Below is an example: Liza and her family are going to a zoo that charges $15 for adults and $10 for children. They also want to buy some souvenirs that cost $8 each. How much will they spend in total if there are 2 adults and 3 children in the family?
def solve() -> int: adult_tickets = 2 * 15 child_tickets = 3 * 10 ticket_cost = adult_tickets + child_tickets souvenirs = 8 * 5 souvenir_cost = souvenirs total_cost = ticket_cost + souvenir_cost result = total_cost return result
If a car travels a distance of 320 km in 4 hours, what is its speed in kilometers per hour?
def solve() -> int: distance = 320 time = 4 speed = distance / time result = speed return result
Liam took a 2-day trip, driving an average of 375 miles per day. Maya drove a total of 600 miles in 3 days. How many miles farther did Maya drive?
def solve() -> int: liam_average_miles_per_day = 375 liam_total_miles = liam_average_miles_per_day * 2 maya_total_miles = 600 maya_average_miles_per_day = maya_total_miles / 3 miles_farther = maya_total_miles - liam_total_miles result = miles_farther return result
Nana had 75 oranges but gave away 5 to her neighbour and then sold 2/5 of the remaining oranges, how many oranges did she sell?
def solve() -> int: orange = 75 orange -= 5 orange_sold = int(orange*2/5) result = f'<<<{orange_sold}>>>' result = orange_sold return result
Two toy stores G and H, are selling action figures. Toy store G sells an action figure for $10 and toy store H sells an action figure for $9. Toy store G was able to sell 600 and toy store H 700 action figures. How much more money did one toy store make from the other?
def solve() -> int: g_price = 10 h_price = 9 g_sold = 600 h_sold = 700 g_money = g_price * g_sold h_money = h_price * h_sold difference = abs(g_money - h_money) result = difference return result
Kevin collects stickers and wants to make a collage on his bedroom wall. He has 17 sheets of stickers, and each sheet has 12 stickers on it. He also buys 8 more stickers from a store. How many stickers does he have in total?
def solve() -> int: sheets_stickers = 17 * 12 store_stickers = 8 total_stickers = sheets_stickers + store_stickers result = total_stickers return result
A teacher is organizing a field trip for her students. Each student needs 8 dollars to attend. On the day of the field trip, 2 students have lost 3 dollars each and another student had to return home early, getting a refund for 5 dollars. If there was a total of 92 dollars left, how many students went on the trip?
def solve() -> int: students = (92 + 2*3 + 5) / 8 result = int(students) return result
Maria has 56 crayons and she gives away 25% of them to her friend. She then buys 15 more crayons and uses 40% of the total crayons for her art project. How many crayons does Maria have left?
def solve() -> int: crayons = 56 given = crayons * 0.25 remaining = crayons - given bought = 15 total = remaining + bought project = total * 0.40 leftover = total - project result = leftover return result
In a concert, there are 100 seats for the audience. If 35 seats are taken by VIPs and sponsors, and 12 seats are taken by journalists, how many seats are left for the public?
def solve() -> int: total_seats = 100 vip_seats = 35 journalist_seats = 12 public_seats = total_seats - vip_seats - journalist_seats result = public_seats return result
A lemonade stand sells lemonade for $0.75 per cup and cookies for $0.5 per cookie. They have 100 cups of lemonade and 80 cookies in stock. They sold 75% of the lemonade and 60% of the cookies. How much money did they make and how much inventory did they have left?
def solve() -> int: sold_lemonade = 75/100 * 100 sold_cookies = 60/100 * 80 money_lemonade = 0.75 * sold_lemonade money_cookies = 0.5 * sold_cookies money = money_lemonade + money_cookies left_lemonade = 100 - sold_lemonade left_cookies = 80 - sold_cookies r...
Hannah is trying to save up to buy a new car. She currently has saved $2,000 and wants to save $10,000 in total. If she can save $500 per month, how long will it take her to save enough money to buy the car?
def solve() -> int: current_savings = 2000 total_savings = 10000 monthly_savings = 500 months_needed = (total_savings - current_savings) / monthly_savings result = months_needed return result
Mary drives from point A to point B. She drives the first 40 miles at 50 miles per hour and the next 60 miles at 30 miles per hour. What is Mary's average speed (in miles per hour) for the entire trip?
def solve() -> int: time1 = 40/50 time2 = 60/30 total_time = time1 + time2 total_distance = 40 + 60 avg_speed = total_distance / total_time result = avg_speed return result
Lila has 18 cupcakes that she wants to share equally among her 4 friends and herself. She also has 12 candles that she wants to put on the cupcakes. How many candles will each cupcake have if she distributes them evenly?
def solve() -> int: cupcakes_per_person = 18 / 5 candled_cupcakes = 4 * cupcakes_per_person candles_per_cupcake = 12 / candled_cupcakes result = candles_per_cupcake return result
A bike that normally costs $450 is now sold at a 15% discount. If there is also a tax of 8%, how much will you pay for the bike?
def solve() -> int: price = 450 discount = 0.15 tax = 0.08 discounted_price = price * (1 - discount) final_price = discounted_price * (1 + tax) result = final_price return result
Student: A local pizza shop sells pizzas in three sizes: small, medium, and large. A customer orders 12 pizzas in total and the total cost is $72. If the cost of each pizza is the same, what is the cost of each pizza?
def solve() -> int: pizzas = 12 total_cost = 72 cost_per_pizza = total_cost / pizzas result = cost_per_pizza return result
He charges $12 for a large pizza and $8 for a small pizza. He also sells toppings for $1.50 each. This week, he sold 15 large pizzas and 20 small pizzas. He also sold a total of 45 toppings. How much money did he make this week, in dollars?
def solve() -> int: large_pizza_price = 12 small_pizza_price = 8 topping_price = 1.50 large_pizza_sold = 15 small_pizza_sold = 20 topping_sold = 45 pizza_revenue = large_pizza_price * large_pizza_sold + small_pizza_price * small_pizza_sold topping_revenue = topping_price * topping...
Emma has her own pet grooming business. She charges $25 per pet plus $0.50 per minute. If she grooms 4 pets for 12 minutes, 3 pets for 17 minutes and 6 pets for 18 minutes, how much money, in dollars, does she earn?
def solve() -> int: pets = [4, 3, 6] minutes = [12, 17, 18] price_per_pet = 25 price_per_minute = 0.5 total_payment_list = [] for i in range(len(pets)): total_payment_list.append(pets[i]*(price_per_pet+(minutes[i]*price_per_minute))) total_payment = 0 for item in tota...
A grocery store has 200 apples. If they sell 20% of the apples, how many apples are left?
def solve() -> int: apples = 200 apples_sold = apples * 0.2 apples_left = apples - apples_sold result = apples_left return result
In 13 years, Alice will be twice as old as Kate is now. Kate is currently 3 years less than four times as old as Lucy is now. Lucy is currently the same age as Ben. If Ben is currently 5 years old, how old will Alice be in 13 years?
def solve() -> int: ben_age = 5 lucy_age = ben_age kate_age = 4 * lucy_age - 3 alice_age = 2 * (kate_age + 13) result = alice_age + 13 return result
Emma bought 6 ice creams at $3 each, 8 pies at $2 each, and 4 donuts at $1 each. How much did she spend in total?
def solve() -> int: price_icecream = 3 num_icecream = 6 price_pie = 2 num_pie = 8 price_donuts = 1 num_donuts = 4 total_icecream_price = price_icecream * num_icecream total_pie_price = price_pie * num_pie total_donuts_price = price_donuts * num_donuts result =...
Kelly rides her bike at 18 mph for 3 hours. She then stops to rest for an hour and rides again at 15 mph for 2 hours. Jack rides his bike at 20 mph for 4 hours without stopping. How many more miles does Jack ride than Kelly?
def solve() -> int: kelly_distance_1 = 18 * 3 kelly_distance_2 = 15 * 2 kelly_distance = kelly_distance_1 + kelly_distance_2 jack_distance = 20 * 4 difference = jack_distance - kelly_distance result = difference return result