question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A gas station offers a $0.10 discount per gallon of gas for every $20 purchase of snacks and drinks in the store. Jason spent $30 on snacks and drinks and bought 15 gallons of gas. Calculate the total amount of money he paid at the gas station. A bakery is selling cupcakes. The bakery has 50 cupcakes but 10 of them wer...
def solve() -> int: snacks_and_drinks_cost = 30 gas_gallons = 15 discount_per_gallon = 0.10 discounted_gallons = snacks_and_drinks_cost // 20 total_discount = discount_per_gallon * discounted_gallons total_cost = snacks_and_drinks_cost + (gas_gallons * (1 - discount_per_gallon)) ...
If a rectangle has a length of 12cm and a perimeter of 38cm, what is the width of the rectangle?
def solve() -> int: width = (38 - 2 * 12) / 2 result = width return result
Alex starts a new savings account and saves $15 in the first month. In the second and third months, he saves the same amount each month. If he has a total of $45 in his account by the end of the third month, how much did he save in the third month?
def solve() -> int: first_month_savings = 15 total_savings = 45 second_month_savings = (total_savings - first_month_savings) / 2 third_month_savings = total_savings - first_month_savings - second_month_savings result = third_month_savings return result
Student: Peter drove his car for 160 miles on Saturday and 120 miles on Sunday. If he fills up his gas tank for $30 and the car gets 25 miles per gallon, what is his gas mileage?
def solve() -> int: total_distance = 160 + 120 gas_price = 30 miles_per_gallon = 25 total_gas_used = total_distance / miles_per_gallon gas_mileage = total_distance / total_gas_used result = gas_mileage return result
A school has 8 classes and each class has 25 students. Each student pays 10 dollars for a field trip. How much money does the school collect for the field trip?
def solve() -> int: students_total = 8 * 25 money_total = students_total * 10 result = money_total return result
Student: A car uses 0.25 gallons of gasoline per mile. If James needs to drive 50 miles, how many gallons of gasoline does he need?
def solve() -> int: gas_per_mile = 0.25 distance = 50 gas_needed = gas_per_mile * distance result = gas_needed return result
Student: Danny can run around the track for 18 minutes before getting tired. Alice can run for two-thirds as long as Danny, while Bob can run for half as long as Alice. How many more minutes can Danny run than Bob?
def solve() -> int: danny_time = 18 alice_time = danny_time * 2/3 bob_time = alice_time / 2 result = danny_time - bob_time return result
It took Sally 6 hours to drive 400 miles to her vacation spot. What was her average speed?
def solve() -> int: distance = 400 time = 6 speed = distance/time result = speed return result
Rachel wants to buy a TV that costs $800. She can make a down payment of $100, and she has to pay the rest of the amount in 8 equal monthly payments with an interest rate of 2% per month. What will be her monthly payments?
def solve() -> int: price = 800 down_payment = 100 loan_amount = price - down_payment interest_rate = 0.02 months = 8 monthly_payment = (loan_amount*(interest_rate*(1+interest_rate)**months))/(((1+interest_rate)**months)-1) result = monthly_payment return result
Student: Jim has 2 horses, the first horse runs 2 kilometers per day, the second horse runs 3 kilometers every day more than the first one. If Jim runs every path with his horses for a month(30 days), how many kilometers does he travel?
def solve() -> int: horse1_distance = 2 horse2_distance = 3 days = 30 total_distance = (horse1_distance + horse2_distance) * days result = total_distance return result
A student scored 78, 90, 85, 92, and 100 marks in his five quizzes, what is his average score?
def solve() -> int: quiz1 = 78 quiz2 = 90 quiz3 = 85 quiz4 = 92 quiz5 = 100 total_score = quiz1 + quiz2 + quiz3 + quiz4 + quiz5 number_of_quizzes = 5 average_score = total_score/number_of_quizzes result = average_score return result
Student: A bakery sells cupcakes for $2.50 each. On a given day, they sell 30 cupcakes. If they had sold 10 more cupcakes they would have made an additional $10. How much money did they make that day?
def solve() -> int: price_per_cupcake = 2.50 num_cupcakes_sold = 30 additional_cupcakes_sold = 10 additional_revenue = 10 total_revenue = price_per_cupcake * (num_cupcakes_sold + additional_cupcakes_sold) + additional_revenue result = total_revenue return result
Eric planted 7 trees. After 6 weeks, all the trees grew 4 feet taller. How many feet tall are the trees now?
def solve() -> int: trees = 7 weeks = 6 growth = 4 total_growth = weeks * growth result = total_growth return result
In a farmers market, there are 400 vendors. A quarter of the vendors sell baked goods. Of the vendors who sell baked goods, 15% of them sell only gluten-free items. Of the gluten-free vendors, 30% of them also sell vegan items. How many vendors sell only gluten-free and vegan items?
def solve() -> int: total_vendors = 400 baked_goods_vendors = total_vendors / 4 gluten_free_vendors = baked_goods_vendors * 0.15 vegan_gluten_free_vendors = gluten_free_vendors * 0.3 only_gluten_free_and_vegan_vendors = vegan_gluten_free_vendors result = only_gluten_free_and_vegan_vendors ...
Student: Michelle sells hats. She charges $20 for a red hats and $30 for a blue hat. She sold 7 red hats and 6 blue hats last weekend. How much money did she make in all?
def solve() -> int: red_price = 20 blue_price = 30 red_sold = 7 blue_sold = 6 red_revenue = red_price * red_sold blue_revenue = blue_price * blue_sold total_revenue = red_revenue + blue_revenue result = total_revenue return result
The sum of 3 consecutive numbers is 138. What are the 3 numbers?
def solve() -> int: sum=138 first_NUM= (sum//2)-1 second_NUM=sum//2 third_NUM= (sum//2)+1 result = first_NUM, second_NUM, third_NUM return result
A shoe store sold 25 pairs of shoes on Wednesday. On Thursday, they sold twice as many shoes as they did on Wednesday. On Friday, they sold one-third of the number of shoes they sold on Thursday. How many pairs of shoes did the store sell by Friday?
def solve() -> int: wednesday_sales = 25 thursday_sales = wednesday_sales * 2 friday_sales = thursday_sales / 3 result = wednesday_sales + thursday_sales + friday_sales return result
Leo wants to buy a bike. The manufacturer makes the bike for $200, but the dealer charges 20% for overhead and profit. However, the bike is on promotion for 15% off the dealer's price. What is the price now?
def solve() -> int: dealer_price = 200 * 1.2 discount = dealer_price * 0.15 final_price = dealer_price - discount result = round(final_price, 2) return result
Maria is counting the total amount of money in her cash register at the end of her shift. She has 3 $50 bills, 5 $20 bills, 6 $10 bills, 4 $5 bills, 1 $2 bill, and a certain amount of coins. If the register total must be $332, how many coins does Maria leave in the register?
def solve() -> int: total_bills = 3*50 + 5*20+ 6*10 + 4*5 + 2 amount_coins = 332 - total_bills result = amount_coins return result
A florist has 30 red, 40 white, and 50 yellow roses. If the florist arranges 5 bouquets, each with an equal number of each color of rose, how many roses will be in each bouquet?
def solve() -> int: num_bouquets = 5 num_red_roses = 30 num_white_roses = 40 num_yellow_roses = 50 total_roses = num_red_roses + num_white_roses + num_yellow_roses roses_per_bouquet = total_roses / (num_bouquets * 3) result = roses_per_bouquet return result
Lucy is painting a fence. She can paint 5 meters of fence in 12 minutes. If she has 28 meters of fence left to paint, how long will it take her to finish the job?
def solve() -> int: rate = 5 / 12 time = 28 / rate time = round(time) result = time return result
Liam has a bag of 40 lollipops. He gives 1/4 of the lollipops to his little sister and then takes 8 lollipops to his friend's house. Later, Liam buys 20 more lollipops to replace the ones he gave away. How many lollipops does Liam have now?
def solve() -> int: lollipops = 40 lollipops_given_away = lollipops * (1/4) lollipops_left = lollipops - lollipops_given_away lollipops_friend = 8 lollipops_bought = 20 lollipops_total = lollipops_left + lollipops_bought - lollipops_friend result = lollipops_total return result
Maya loves to bake cookies. She has a recipe that makes 24 cookies with 3 cups of flour, 2 cups of sugar, and 1 cup of butter. She wants to make more cookies for her friends, so she doubles the amount of flour and sugar, but keeps the same amount of butter. How many cookies can she make with the new recipe?
def solve() -> int: from fractions import Fraction original_flour = 3 original_sugar = 2 original_butter = 1 original_cookies = 24 cookies_to_flour = Fraction(original_cookies, original_flour) cookies_to_sugar = Fraction(original_cookies, original_sugar) cookies_to_butter = Fraction(orig...
10. Kate is baking cake with 25% sugar. If the recipe requires 4 cups of sugar, calculate the number of cups of sugar needed to make the cake.
def solve() -> int: sugar_percentage = 25 recipe_sugar = 4 needed_sugar = recipe_sugar / (sugar_percentage/100) result = needed_sugar return result
15% of a class got a 90% on the math test, 35% got a 95%, and the remaining 50% got a 100%. What is the class average score?
def solve() -> int: total_students = 100 student_90 = 15 student_95 = 35 score_90 = 90 score_95 = 95 score_100 = 100 score_90_total = student_90/total_students * score_90 score_95_total = student_95/total_students * score_95 score_100_total = total_students - (student...
Michael has three children who play basketball on different teams. They each have 12 games this season. Each team practices for 2.5 hours before each game they play. If each game lasts for 1 hour and 45 minutes, how much time will Michael spend at the court watching his children play and practice altogether?
def solve() -> int: num_children = 3 num_games = 12 practice_time = 2.5 game_time = 1.75 total_practice_time = num_children * num_games * practice_time total_game_time = num_children * num_games * game_time total_time = total_practice_time + total_game_time result = t...
Ali buys 8 pencils for 5 cents each and 5 erasers for 10 cents each. He pays with a 1 dollar bill. How much change does he get back?
def solve() -> int: pencil_cost = 8 * 5 eraser_cost = 5 * 10 total_cost = pencil_cost + eraser_cost dollar = 100 change = dollar - total_cost result = change return result
Ethan's retirement party is next month. He will be 4 times older than he was when he was four. On his party, his colleagues give him $30 for every year old he is. How much money will they give him?
def solve() -> int: age_when_four = 4 current_age = age_when_four * 4 money_per_year = 30 total_money = current_age * money_per_year result = total_money return result
Jack earns $3000 per month and spends 40% on rent and utilities. If his rent is $900 and his utilities are $200 per month, how much money does he have left after paying for rent and utilities?
def solve() -> int: monthly_income = 3000 rent_percent = 40/100 rent = 900 utilities = 200 total_rent = monthly_income * rent_percent total_expenses = total_rent + utilities final_amount = monthly_income - total_expenses result = final_amount return result
Student: A bookstore has 450 books in total, of which 60% are fiction books. How many fiction books does the bookstore have?
def solve() -> int: total_books = 450 percent_fiction = 0.6 num_fiction = total_books * percent_fiction result = num_fiction return result
Maria has $12 more than what Dave has. And Dave has 3 times as much money as Andy. If Andy has $9, how much money they have together?
def solve() -> int: andy_money = 9 dave_money = andy_money * 3 maria_money = dave_money + 12 total_money = andy_money + dave_money + maria_money result = total_money return result
A car is traveling at a speed of 60 miles per hour. How far does it travel in 4 hours?
def solve() -> int: distance = 60 * 4 result = distance return result
Sarah drives 200 miles in 4 hours. If she drove at a constant speed, how many miles does she travel in 2 hours?
def solve() -> int: speed = 200/4 distance = speed*2 result = distance return result
Emily has $700 in her wallet and $1500 saved in her bank account. If she spends 40% of the money in her wallet and then saves her new total in her bank account, how much money will she have in her bank account?
def solve() -> int: wallet_money = 700 bank_account_money = 1500 spending_amount = wallet_money * 0.4 new_wallet_money = wallet_money - spending_amount new_bank_account_money = bank_account_money + new_wallet_money result = new_bank_account_money return result
Lucas and his two friends wanted to buy a video game for $60. They decided to split the cost evenly among themselves. However, Lucas had to pay an extra $5 for shipping because he lived far away from the store. How much did each of them pay for the game?
def solve() -> int: total = 60 shipping = 5 cost_without_shipping = (total - shipping) / 3 cost_for_lucas = cost_without_shipping + shipping result = cost_for_lucas return result
Student: A train travels 270 miles in 3 hours. If it continues at the same speed, how long will it take to travel 351 miles?
def solve() -> int: distance = 351 time_taken = 3 speed = distance / time_taken time_required = distance / speed result = time_required return result
Student: A carpenter can make 12 shelves an hour. How many shelves can he make in two days?
def solve() -> int: shelves_per_hour = 12 hours_per_day = 8 days = 2 shelves_per_day = shelves_per_hour * hours_per_day shelves = shelves_per_day * days result = shelves return result
Here are some possible questions and programs: A box of candles contains 24 red and 16 blue candles. Each day, two red and one blue candle are burned, but on the fifth day, four more red candles are added to the box. How many more blue candles than red candles are in the box after seven days?
def solve() -> int: red = 24 blue = 16 for day in range(1, 8): red = red - 2 blue = blue - 1 if day == 5: red = red + 4 difference = blue - red result = difference return result
Four friends share a bag of candies. If each person gets the same number of candies and there are 28 candies in total, how many candies do they each get?
def solve() -> int: total_candies = 28 total_people = 4 candies_per_person = total_candies / total_people result = candies_per_person return result
Student: A shopkeeper bought 110 packets of shampoo. Each packet contained 400 g of shampoo. If one ounce is equal to 28 g, how many ounces of shampoo did he buy?
def solve() -> int: total_weight_grams = 110 * 400 ounces_per_gram = 1 / 28 total_weight_ounces = total_weight_grams * ounces_per_gram result = total_weight_ounces return result
A television worth $750 is sold with a discount of 12%. What is the sale price of the television?
def solve() -> int: original_price = 750 discount = 0.12 discount_price = original_price * discount final_price = original_price - discount_price result = final_price return result
John and Peter are teachers. John has four less than twice as many students as Peter. If they have 74 students combined, how many students does John have?
def solve() -> int: peter_students = 0 john_students = 0 peter_students = 1 john_students = 2 * peter_students - 4 total_students = peter_students + john_students if total_students == 74: result = john_students else: result = "No solution" return ...
A store sells shirts for $25 each and pants for $40 each. If a customer buys 2 shirts and 3 pants, how much do they spend in total?
def solve() -> int: shirt_price = 25 pants_price = 40 total_shirts = 2 total_pants = 3 total_cost = (shirt_price * total_shirts) + (pants_price * total_pants) result = total_cost return result
A store sells t-shirts for $12 each. If you buy 5 t-shirts, the 6th one is sold for half the price. You buy 7 t-shirts. What is the total cost?
def solve() -> int: tshirt_cost = 12 num_tshirts = 7 bill = tshirt_cost * 5 + tshirt_cost/2 + tshirt_cost * (num_tshirts - 6) result = bill return result
At the farmer's market, Sarah buys 3 baskets of strawberries for $15. Each basket contains 2 pounds of strawberries. How much does each pound of strawberries cost?
def solve() -> int: baskets = 3 cost = 15 pounds = baskets * 2 price_per_pound = cost / pounds result = price_per_pound return result
David wants to make cookies. The recipe calls for 0.5 kg of sugar, 1 kg of flour, and 0.2 L of milk. If he wants to make 10 batches of cookies, how much of each ingredient will he need?
def solve() -> int: batches = 10 sugar = 0.5*batches flour = 1*batches milk = 0.2*batches result = sugar, flour, milk return result
A company has 100 employees. If 70% of them have laptops and then another 20% of them receive laptops, what percentage of the employees have laptops?
def solve() -> int: employees_start = 100 employees_with_laptop1 = employees_start * 0.7 employees_with_laptop2 = employees_with_laptop1 + (employees_start * 0.2) employees_percent = (employees_with_laptop2 / employees_start) * 100 result = employees_percent return result
A travel agency is planning tours for a group. They need to plan activities for a total of 150 people. If each activity has a maximum capacity of 25 people, how many activities will the agency need to plan?
def solve() -> int: total_people = 150 max_capacity = 25 activities_needed = total_people // max_capacity result = activities_needed return result
Lily is 13 years old. Her brother is 5 years older and their neighbor is 4 times their age difference. How old would their neighbor be in 3 years?
def solve() -> int: lily = 13 brother = lily + 5 difference = brother - lily neighbor = difference * 4 neighbor += 3 result = neighbor return result
A playground wants to get new play structures for the children. The first structure costs $1000 and each additional structure costs 10% more than the previous one. If the playground gets 10 new structures, how much will they cost in total?
def solve() -> int: total_cost = 0 cost = 1000 for i in range(10): total_cost = total_cost + cost cost = cost*1.1 result = total_cost return result
Emma saves 20% of her pocket money every week. She gets $10 a week. In 10 weeks, how much money does she have in her savings?
def solve() -> int: savings_per_week = 10 * 0.2 savings_in_10_weeks = savings_per_week * 10 result = savings_in_10_weeks return result
If a car cost $25000 and you put down a 20% deposit. How much did the deposit cost?
def solve() -> int: deposit = 25000 * 0.2 result = deposit return result
Student: A pizza cost $24 and John wants to split the cost among 4 friends. How much money will each friend be responsible for?
def solve() -> int: pizza_cost = 24 num_friends = 4 cost_per_friend = pizza_cost / num_friends result = cost_per_friend return result
Student: In a fruit stand, there are three kinds of fruits: apples, oranges, and bananas. Each fruit is sold by the piece, and there are 12 apples, 10 oranges, and 8 bananas in a basket. The prices are $0.4 for an apple, $0.6 for an orange, and $0.3 for a banana. Sue wanted to buy some for her lunch, and she decided to...
def solve() -> int: apples = 12 oranges = 10 bananas = 8 apple_price = 0.4 orange_price = 0.6 banana_price = 0.3 sue_apples = apples sue_oranges = sue_apples + 5 sue_bananas = sue_oranges // 2 sue_apple_cost = sue_apples * apple_price sue_orange_cost = sue_oranges *...
A car rental agency rents a car for $50 per day, plus $0.25 per mile driven. If Sarah rented the car for 3 days and drove 120 miles, how much does she owe?
def solve() -> int: car_rental_cost = 3*50 + 0.25*120 result = car_rental_cost return result
A pizza restaurant charges $12 for a large pizza and $8 for a small pizza. If a family of 5 ordered 2 large pizzas and 3 small pizzas, how much did they spend in total?
def solve() -> int: large_pizza_price = 12 small_pizza_price = 8 num_large_pizzas = 2 num_small_pizzas = 3 total_cost = (large_pizza_price * num_large_pizzas) + (small_pizza_price * num_small_pizzas) result = total_cost return result
A group of 60 people went camping, and 40 more people joined them later. 10 people left before they all came back. How many people are in the group now?
def solve() -> int: initial_group = 60 new_people = 40 people_left = 10 remaining_group = initial_group + new_people - people_left result = remaining_group return result
A jewelry store sells necklaces for $50 each and bracelets for $25 each. If the store sold 20 necklaces and 30 bracelets in one day, how much money did they earn in total that day?
def solve() -> int: necklace_price = 50 bracelet_price = 25 necklaces_sold = 20 bracelets_sold = 30 total_sales = (necklace_price * necklaces_sold) + (bracelet_price * bracelets_sold) result = total_sales return result
Ella is selling lemonade for a community project. She sold 120 cups on Saturday and 30% less on Sunday. How many cups did she sell, in total, over the two days?
def solve() -> int: cups_sunday = 120 * 0.7 cups_total = 120 + cups_sunday result = cups_total return result
Student: Tom wants to fence in his rectangular garden. The garden is 20 feet wide and 35 feet long. If he wants to put a fence that is 5 feet high around the perimeter of the garden, how much fencing material does he need to buy?
def solve() -> int: width = 20 length = 35 height = 5 perimeter = 2 * (width + length) result = perimeter * height return result
Richard owns a restaurant and his manager asked him to restock the restaurant's storage with dishes and cutlery. Each set of cutlery consists of 3 knives, 2 forks, and 1 spoon, and each dish weighs 8 ounces. If Richard needs to buy enough for 42 sets, how many ounces of dishes and cutlery will he need to buy in total?
def solve() -> int: number_sets = 42 weight_dish = 8 number_knives = 3 number_forks = 2 number_spoons = 1 total_dishes = number_sets * weight_dish total_knives = number_sets * number_knives total_forks = number_sets * number_forks total_spoons = number_sets * number_spoons ...
-Q2: Maya wants to make lemonade for a picnic. She has 8 lemons and can squeeze 6 tablespoons of juice from each lemon. She needs 3/4 cup of lemon juice for each pitcher of lemonade. How many pitchers of lemonade can she make with the lemons she has?
def solve() -> int: juice = 8 * 6 juice_in_cups = juice / 16 pitchers = juice_in_cups // (3/4) result = pitchers return result
In five years, Kayla will be three times as old as Max. If Max is currently seven years old, how old is Kayla?
def solve() -> int: max_age = 7 years_passed = 5 kayla_age = (max_age * 3) + years_passed result = kayla_age return result
Emily spent $1500 on a new laptop. She upgraded the RAM for $200 and refunded the old RAM for $50. How much did the laptop cost her after subtracting the money back for the old RAM?
def solve() -> int: laptop_cost = 1500 ram_upgrade = 200 ram_refund = 50 total_cost = laptop_cost + ram_upgrade - ram_refund result = total_cost return result
Student: A store has 420 candy bars and wants to sell them in packs of 6. How many packs can they make?
def solve() -> int: candy_bars = 420 pack_size = 6 packs = candy_bars // pack_size result = packs return result
Student: A bicycle wheel has a radius of 30 cm. What is its diameter in centimeters?
def solve() -> int: radius = 30 diameter = 2 * radius result = diameter return result
A chef needs 2 eggs and 200 grams of flour to bake one cake. If they have 24 eggs and 3 kg of flour, how many cakes can they bake?
def solve() -> int: eggs_available = 24 flour_available = 3000 eggs_per_cake = 2 flour_per_cake = 200 num_cakes_possible = min(eggs_available // eggs_per_cake, flour_available // flour_per_cake) result = num_cakes_possible return result
Possible questions and programs: A third-grade class has 24 students and they want to buy ice cream from a truck that sells 3 flavors: vanilla, chocolate, and strawberry. Each flavor costs $1.50 and the truck only accepts cash. The class has a total of $36 to spend on ice cream. How many students can buy ice cream if t...
def solve() -> int: ice_creams = 36 / 1.5 ice_creams_per_student = ice_creams / 24 ice_creams_per_student = int(ice_creams_per_student) result = ice_creams_per_student * 24 return result
Sarah baked 30 cookies and shared them equally among her three friends. How many cookies did each friend get?
def solve() -> int: cookies_baked = 30 num_friends = 3 cookies_per_friend = cookies_baked / num_friends result = cookies_per_friend return result
In a zoo, there are 7 more monkeys than gorillas. If there is a total of 60 monkeys and gorillas in the zoo, and the gorillas, whose number is 1/4 of the total number of monkeys and gorillas, eat 5 bananas every day, find the total number of bananas the gorillas eat in a week.
def solve() -> int: g = (60/5) * (1/5) m = 60 - g bg = 5 * g wg = 7 * bg result = wg return result
- Liam has six times as many pencils as there are continents. He breaks 2 pencils every day. How many pencils will he have left after 10 days?
def solve() -> int: p = 6 * 7 pencils_broken = 2 * 10 pencils_left = p - pencils_broken result = pencils_left return result
Louis gets two different discounts at the store. One is 15% and the other is $3. If he buys an item for $18, how much money is he going to save?
def solve() -> int: original_price = 18 discount_percentage = 15 discount_amount = 3 discount_by_percentage = original_price * discount_percentage/100 total_discount = discount_by_percentage + discount_amount result = total_discount return result
Student: A family had to buy 8 desks for their children's bedrooms. Each desk was priced at $90. How much did they spend in total?
def solve() -> int: number_of_desks = 8 price_per_desk = 90 total_cost = number_of_desks * price_per_desk result = total_cost return result
Aditya has 10 bars of chocolate, each bar containing 12 pieces of chocolate. His sister asked him for 15 pieces of chocolate. How many bars should Aditya give to his sister?
def solve() -> int: totalPieces = 10 * 12 piecesPerBar = 12 barsNeeded = 15 / piecesPerBar result = barsNeeded return result
Lisa works as a web developer and earns $80 per hour. If she codes for 4 clients in an hour, and each client pays her $150, and a 15% sales tax is applied, how much money does Lisa make in total?
def solve() -> int: hourly_rate = 80 clients_per_hour = 4 client_payment = 150 sales_tax = 0.15 earnings_before_tax = hourly_rate * clients_per_hour * client_payment tax_amount = earnings_before_tax * sales_tax total_earnings = earnings_before_tax + tax_amount result ...
A pencil and a pen together weigh 28 grams. The pen weighs twice as much as the pencil. What is the weight of the pencil?
def solve() -> int: total_weight = 28 pen_weight_percentage = 2/3 pencil_weight_percentage = 1 - pen_weight_percentage pencil_weight = total_weight * pencil_weight_percentage result = pencil_weight return result
Teacher Sarah has 25 students in her class. She needs to grade each student's homework by tomorrow. If she already graded 10 homework assignments and her TA graded 5, how many more homework assignments does she need to grade for the next 2 days?
def solve() -> int: total_students = 25 graded_by_sarah = 10 graded_by_TA = 5 homeworks_left = total_students - graded_by_sarah - graded_by_TA days_left = 2 homeworks_per_day = homeworks_left / days_left result = homeworks_per_day return result
When Zippy, the multi-legged monster, walks across the sticky ooze of his homeworld, it leaves 7 footprints for every 2 meters. But Fuzzy, the three-legged critter from the neighboring planet, leaves 3 tracks in the muck for every 6 meters it travels. If Zippy covers 500 meters and Fuzzy covers 800 meters, how many foo...
def solve() -> int: zippy_footprints = 7 * (500/2) fuzzy_tracks = 3 * (800/6) result = (zippy_footprints, fuzzy_tracks) return result
A party catering service has to prepare 7 different food items. They have prepared the first 6. The average cost of preparing the first 6 items is $30 each. If the total cost of all 7 items is $220, what was the cost of the seventh food item?
def solve() -> int: average_cost = 30 total_cost = 220 cost1_6 = average_cost * 6 cost7 = total_cost - cost1_6 result = cost7 return result
Mary has 4 different colored skirts and 5 different colored tops. She wants to create an outfit with one skirt and one top. How many different outfit combinations can be made with these options?
def solve() -> int: skirts = 4 tops = 5 outfit_combinations = skirts * tops result = outfit_combinations return result
John has a total of 5,000 baseball cards. After losing his job, his friends, Kevin and Mark, want to help him feel better by giving him more cards. Kevin gives John 15 more cards than twice the amount that Mark gives him. If Mark gave John 25 cards, how many cards does John have now?
def solve() -> int: mark_cards = 25 kevin_cards = 2 * mark_cards + 15 john_cards = 5000 + mark_cards + kevin_cards result = john_cards return result
Student: Isla and Jake both have a popcorn stand. Isla sells her popcorn at 75 cents per bag while Jake sells his at 80 cents per bag. If Isla sold 16 bags and Jake sold 14 bags, how much less money (in cents) did Isla earn than Jake?
def solve() -> int: price_isla = 75 price_jake = 80 bags_isla = 16 bags_jake = 14 total_isla = price_isla * bags_isla total_jake = price_jake * bags_jake difference = total_jake - total_isla result = difference return result
James and Sarah share the cost of hiring a private tutor for their child. It costs $50 per hour for the first 50 hours and twice that amount thereafter. If the total amount is $12,500, how many hours did they spend with the tutor?
def solve() -> int: hourly_rate = 50 additional_rate = 2 * hourly_rate total_amount = 12500 first_50_hours = 50 total_cost_first_50_hours = hourly_rate * first_50_hours remaining_amount = total_amount - total_cost_first_50_hours additional_hours = remaining_amount / additional...
Emily wants to exercise 12 hours a week. She chooses to exercise on Monday, Tuesday, Thursday, and Saturday. She spends 2 and a half hours each day on Monday and Thursday. If she spends the same amount of time on Tuesday and Saturday, how many hours is she at the gym on Tuesday?
def solve() -> int: mon_thu_time = 2.5 total_exercise_time = 12 tue_sat_time = (total_exercise_time - 2*mon_thu_time)/2 result = tue_sat_time return result
Emily has saved $2000 and asks her friend and cousin to help her raise the total amount of money she needs to buy a new camera that costs $3500. If her friend gives her half of what she saved and her cousin gives her 1/3 of what her friend gave her, how much money does Emily still need to buy the camera?
def solve() -> int: emily_savings = 2000 camera_cost = 3500 friend_contribution = emily_savings / 2 cousin_contribution = friend_contribution / 3 total_amount = emily_savings + friend_contribution + cousin_contribution amount_still_needed = camera_cost - total_amount ...
One candle can burn for 4 hours. If 3 more than 15 candles are lit at the same time, how long would they last before they all burn out?
def solve() -> int: candles_lit = 15 + 3 time_burn = candles_lit * 4 result = time_burn return result
Student: - Amy is a teacher. She gave 36 homework assignments to her students; 3 more assignments than the homework ones that she graded; and 4 times as many assignments as the graded ones that she returned. How many assignments did Amy deal with in all?
def solve() -> int: total_assignments = 36 graded_assignments = 0 returned_assignments = 0 graded_assignments = total_assignments + 3 returned_assignments = graded_assignments / 4 result = total_assignments + graded_assignments + returned_assignments return result
In a smaller container, 4 cups of water are poured into a larger container that already has 3 cups of water in it. If the larger container has a capacity of 12 cups, how many cups of water can the larger container hold?
def solve() -> int: current_water = 3 added_water = 4 total_water = current_water + added_water max_water = 12 available_space = max_water - current_water result = current_water + available_space return result
Student: Diego bought 15 pencils for $3 and 21 erasers for $7. He gave 6 pencils and 4 erasers to his friend. How much money did Diego spend on the items he kept for himself?
def solve() -> int: pencils = 15 pencil_price = 3 erasers = 21 eraser_price = 7 pencils_given = 6 erasers_given = 4 pencil_unit_price = pencil_price / pencils eraser_unit_price = eraser_price / erasers pencils_kept = pencils - pencils_given erasers_kept = erasers - erase...
Maria baked 36 cupcakes for a bake sale. She sold 2/3 of them for $1 each and the rest for $0.75 each. How much money did Maria make from the bake sale?
def solve() -> int: one_dollar = 36 * 2/3 seventy_five = 36 - one_dollar one_dollar_sale = one_dollar * 1 seventy_five_sale = seventy_five * 0.75 total_sale = one_dollar_sale + seventy_five_sale result = total_sale return result
Jennifer has to go shopping at the mall. She wants to buy shoes for $50, a dress shirt for $25, a leather jacket for $75 and a pair of jeans for $40. She has a coupon for 20% off her purchase, how much money will she save in total?
def solve() -> int: price1 = 50 price2 = 25 price3 = 75 price4 = 40 discount = 0.2 total_before_discount = price1 + price2 + price3 + price4 total_after_discount = total_before_discount - (total_before_discount * discount) total_saved = total_before_discount - total_after_discount...
A baker wants to make a cake that requires 5 eggs and 2 cups of flour. She has 24 eggs and 8 cups of flour. How many cakes can she make?
def solve() -> int: eggs_per_cake = 5 flour_per_cake = 2 total_eggs = 24 total_flour = 8 cakes_by_eggs = total_eggs // eggs_per_cake cakes_by_flour = total_flour // flour_per_cake total_cakes = min(cakes_by_eggs, cakes_by_flour) result = total_cakes return result
Sarah is now 30 years old. A year ago, she was twice the age of her niece who will be 10 in six years. If her nephew is five years older than her niece, how old is her nephew?
def solve() -> int: sarah_age = 30 niece_age = 10 - 1 - 6 sarah_a_year_ago = sarah_age - 1 niece_a_year_ago = niece_age - 1 sarah_a_year_ago = 2 * niece_a_year_ago nephew_age = niece_age + 5 result = nephew_age return result
A rectangular room is 6 meters long and 5 meters wide. If the cost of painting the walls is $10 per square meter, what is the cost of painting the walls?
def solve() -> int: area = 6 * 5 cost_of_painting = area * 10 result = cost_of_painting return result
Darcy is baking a cake and needs 200 grams of butter. She already has 70 grams in her fridge but needs more. How many more grams of butter does Darcy need?
def solve() -> int: Amount_initial = 70 Amount_needed = 200 Amount_left = Amount_needed - Amount_initial result = Amount_left return result
A pizza is cut into 8 equal slices. Three people are sharing the pizza equally. How many slices will each person get?
def solve() -> int: total_slices = 8 people = 3 slices_per_person = total_slices / people result = slices_per_person return result
herry has 5 blue pencils and 10 red pencils in her pencil case. What percentage of the pencils in her pencil case are blue?
def solve() -> int: total_pencils = 15 blue_pencils = 5 percentage_blue_pencils = (blue_pencils / total_pencils) * 100 result = percentage_blue_pencils return result
Mia wanted to buy some stickers from the craft store. She saw that they had a sale: buy 2 packs of stickers and get 1 pack free. Each pack of stickers had 12 stickers and cost $3. She also had a loyalty card that gave her 5% off the total price after the sale. How much did Mia pay for 9 packs of stickers?
def solve() -> int: free_packs = 9 // 3 paid_packs = 9 - free_packs price_before_card = paid_packs * 3 discount = 0.05 * price_before_card final_price = price_before_card - discount result = final_price return result
Student: Jenny runs 6 miles per hour, how long will it take her to run 24 miles?
def solve() -> int: speed = 6 distance = 24 time = distance / speed minutes = time * 60 result = minutes return result
Student: Sarah found 10 shells on the beach and counted 11 starfish. Then she went for a walk and found 8 shells and 6 starfish. How many seashells and starfish did Sarah find in total?
def solve() -> int: shells_1 = 10 starfish_1 = 11 shells_2 = 8 starfish_2 = 6 total_shells = shells_1 + shells_2 total_starfish = starfish_1 + starfish_2 result = total_shells + total_starfish return result