question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A restaurant has 30 tables. If each table seats 4 people, how many people can the restaurant accommodate at once?
def solve() -> int: num_of_people = 30 * 4 result = num_of_people return result
A store has a promotion where if you spend $50 or more, you get a 15% discount. If Tina spends $70 on clothes, how much did she save?
def solve() -> int: total_spent = 70 discount_threshold = 50 discounted_price = total_spent if total_spent >= discount_threshold: discounted_price *= 0.85 saved_amount = total_spent - discounted_price result = saved_amount return result
Student: A family of four wants to split a pizza. The pizza has 10 slices. If each person eats 2 slices, how many slices will be left?
def solve() -> int: pizza_slices = 10 slices_per_person = 2 family_size = 4 family_eaten = slices_per_person * family_size slices_left = pizza_slices - family_eaten result = slices_left return result
After being charged for 20 minutes, John's Fitbit has gone from a drained battery to a 40% charge. How much longer must it be charged to reach a full charge of 100%?
def solve() -> int: charge_percentage = 40 time_charged = 20 remaining_percentage = 100 - charge_percentage time_required = (remaining_percentage / charge_percentage) * time_charged result = time_required return result
A factory can produce 240 units of a product in 8 hours. How many units can the factory produce in 5 hours?
def solve() -> int: units_per_hour = 240/8 units_in_5_hours = units_per_hour*5 result = units_in_5_hours return result
A shopkeeper buys y number of toys for $50 each. She sells each toy for $70 making a profit of $20 per toy. If she earns a total profit of $800, how many toys did she buy?
def solve() -> int: toys_bought = 800/20 y = toys_bought result = y return result
Student: Susan decides to give 25% of her allowance to saving. Her allowance is $20 per week. If she saves for 5 weeks, how much money did she save?
def solve() -> int: percentage = 0.25 allowance = 20 weeks = 5 result = percentage * allowance * weeks return result
At the beginning of the day, a shop had 20 boxes of chocolates. Someone bought 5 boxes and then the shop received 6 more boxes. How many boxes of chocolates does the shop have now?
def solve() -> int: boxesOfChocolates = 20 leftBoxesOfChocolates = boxesOfChocolates - 5 + 6 result = leftBoxesOfChocolates return result
In a park, there are an equal number of dogs and cats. 16 dogs are leashed, and the remaining dogs run free. An equal number of cats join the dogs, but then a third of those cats are leashed as well. If there are a total of 80 animals in the park, how many animals are leashed?
def solve() -> int: dogs_leashed = 16 total_animals = 80 dogs = total_animals // 2 cats = total_animals // 2 cats_leashed = (cats + dogs) // 3 animals_leashed = dogs_leashed + cats_leashed result = animals_leashed return result
The cost of a shirt is $30. If the sales tax is 8%, what is the total cost of the shirt with tax?
def solve() -> int: shirt_cost = 30 sales_tax_percentage = 8 sales_tax_amount = shirt_cost * (sales_tax_percentage / 100) total_cost = shirt_cost + sales_tax_amount result = total_cost return result
Leo reads books for 4 hours. The first hour he reads 24 pages. The second hour he reads 10% more pages than the first hour. The third hour he reads 5 pages less than the second hour. The fourth hour he reads twice as many pages as the third hour. How many pages did Leo read total?
def solve() -> int: total = 0 first_hour = 24 second_hour = first_hour * 1.1 third_hour = second_hour - 5 fourth_hour = third_hour * 2 total = total + first_hour total = total + second_hour total = total + third_hour total = total + fourth_hour result = total ...
A basketball team scored 80 points in a game. If the team made 32 baskets, how many points were scored by free throws?
def solve() -> int: total_points = 80 num_baskets = 32 points_per_basket = 2 free_throw_points = total_points - (num_baskets * points_per_basket) result = free_throw_points return result
Rachel has 5 less than half as many candy bars as Sarah has. If Sarah has 54 candy bars, how many candy bars does Rachel have?
def solve() -> int: sarah_bars = 54 rachel_bars = (0.5 * sarah_bars) - 5 result = rachel_bars return result
A rectangle has a length of 15 cm and a width of 10 cm. What is its perimeter in cm?
def solve() -> int: length = 15 width = 10 perimeter = 2 * length + 2 * width result = perimeter return result
A zoo charges $10 for an adult ticket and $6 for a child ticket. An adult also has to pay $2 for a parking fee. A family of 2 adults and 3 children goes to the zoo and parks one car; while a family of 3 adults and 2 children goes to the zoo and parks two cars. How much does the zoo earn?
def solve() -> int: adult = 10 child = 6 parking = 2 family1_a = 2 family1_c = 3 family1_p = 1 family2_a = 3 family2_c = 2 family2_p = 2 family1_amount = family1_a * (adult + parking) + family1_c * child family2_amount = family2_a * (adult + parking) + family2_c * c...
A classroom has a ratio of boys to girls of 7:3. If there are 50 students in the class, how many boys are there?
def solve() -> int: boys_ratio = 7 total_ratio = 10 result = (boys_ratio / total_ratio) * 50 return result
Student: If Jack ate 12 pieces of candy and Bob ate 4 times as much as Jack, how many pieces of candy did Bob eat?
def solve() -> int: jack_candy = 12 bob_candy = jack_candy * 4 result = bob_candy return result
Carlos is making a smoothie and needs 1/4 cup of honey but he wants to triple it. Each container of honey is 16 ounces. How many containers of honey does Carlos need?
def solve() -> int: honey_needed = 1/4 honey_tripled = honey_needed * 3 container_size = 16 containers_needed = honey_tripled / container_size result = containers_needed return result
Bob has 8 tanks for pregnant fish, and in each tank there are 6 pregnant fish and each fish gives birth to 4 young. How many young fishes does Bob have at the end?
def solve() -> int: pregnant_fish_count = 8 tank_per_fish_count = 6 young_per_fish_count = 4 result = pregnant_fish_count*tank_per_fish_count*young_per_fish_count return result
A car travels at a speed of 60 km/hr for the first 4 hours and then at a speed of 80 km/hr for the next 6 hours. What is the total distance covered?
def solve() -> int: distance_covered_in_4_hours = 60 * 4 distance_covered_in_6_hours = 80 * 6 total_distance = distance_covered_in_4_hours + distance_covered_in_6_hours result = total_distance return result
A car rental company charges $40 per day plus $0.25 per mile driven. If a customer rents a car for 3 days and drives 100 miles, how much is their total cost?
def solve() -> int: rental_cost = 40*3 mileage_cost = 0.25*100 total_cost = rental_cost + mileage_cost result = total_cost return result
Carol has two brothers and two sisters. Her oldest brother is 4 years older than Carol, and her younger brother is 2 years younger than Carol. Her older sister is the same age as her older brother, and her younger sister is 3 years younger than her younger brother. If Carol is 12 years old, what is their combined age?
def solve() -> int: carol = 12 older_brother = carol + 4 younger_brother = carol - 2 older_sister = older_brother younger_sister = younger_brother - 3 total = carol + older_brother + younger_brother + older_sister + younger_sister result = total return result
Marie wants to buy a shirt that costs $35, but she only has $25. How much money does Marie need to borrow in order to buy the shirt?
def solve() -> int: cost_of_shirt = 35 amount_of_money = 25 money_to_borrow = cost_of_shirt - amount_of_money result = money_to_borrow return result
At his music gig, David is anticipating a crowd of 150 people. He is optimistic that another 30 people may drop in. David has designed 20 high-end goodie bags for his supporters. If David wants to give everyone a goodie bag, how many more bags does he need to make?
def solve() -> int: crowd = 150 additional_people = 30 goodie_bags = 20 total_people = crowd + additional_people remaining_people = total_people - goodie_bags if remaining_people > 0: more_bags = remaining_people else: more_bags = 0 result = more_bags r...
Sophia is a babysitter with a bag of 120 snacks. In the morning, six children each take five snacks. In the evening, they each take one more snack. How many snacks are left in Sophia's bag?
def solve() -> int: morning_snacks = 6 * 5 evening_snacks = 6 * 1 total_snacks = morning_snacks + evening_snacks leftover_snacks = 120 - total_snacks result = leftover_snacks return result
Possible example questions and programs: Oscar has three fish tanks. The first tank has 12 fish and 25% are goldfish. The second tank has 8 fish and half of them are goldfish. The third tank has 10 fish and 4 of them are goldfish. What fraction of all the fish in his three tanks are goldfish?
def solve() -> int: tank1_fish = 12 tank1_goldfish = 0.25 * tank1_fish tank2_fish = 8 tank2_goldfish = 0.5 * tank2_fish tank3_fish = 10 tank3_goldfish = 4 total_fish = tank1_fish + tank2_fish + tank3_fish total_goldfish = tank1_goldfish + tank2_goldfish + tank3_goldfish fraction_go...
Henry needs to buy three loaves of bread each costing 2 schillings. He has 8 shillings. How much money does Henry have left?
def solve() -> int: total_money = 8 cost_per_loaves = 2 no_of_loaves = 3 amount_available = total_money - (cost_per_loaves * no_of_loaves) result = amount_available return result
If Rachel drinks 2 cups of coffee on Monday, then drinks 3 more than the previous amount on Tuesday, and then drinks half the previous amount on Wednesday, and then finally drinks 5 cups of coffee on Thursday, how many cups of coffee did she drink in those four days?
def solve() -> int: cups_of_coffee_monday = 2 cups_of_coffee_tuesday = cups_of_coffee_monday + 3 cups_of_coffee_wednesday = cups_of_coffee_tuesday / 2 cups_of_coffee_thursday = 5 total_cups_of_coffee = cups_of_coffee_monday + cups_of_coffee_tuesday + cups_of_coffee_wednesday + cups_of_coffee_thursda...
A bag has 30 pieces of candy. If Lara takes 1/3 of the candy and then gives the bag to her friend who takes half of what's left, how many pieces of candy does Lara's friend have?
def solve() -> int: lara_candy = 30 * 1/3 friend_candy = (30 - lara_candy) * 1/2 result = friend_candy return result
Lucas has 6 more crayons than Nathan does. If Nathan has 24 crayons, how many more crayons will Lucas have than Nathan if their mom gives him 12 crayons?
def solve() -> int: nathan_crayons = 24 lucas_crayons = nathan_crayons + 6 mom_crayons = 12 lucas_crayons += mom_crayons difference = lucas_crayons - nathan_crayons result = difference return result
If a book costs $25, what is the price of 15 books?
def solve() -> int: price_per_book = 25 num_books = 15 total_price = price_per_book * num_books result = total_price return result
The price of a shirt is $20. If you have $150, how many shirts can you buy and how much money will you have left?
def solve() -> int: price = 20 money = 150 num_shirts = money // price money_left = money % (num_shirts*price) result = (num_shirts, money_left) return result
A car travels 300 km in 4.5 hours. What is its average speed in km/h?
def solve() -> int: distance = 300 time = 4.5 average_speed = distance / time result = average_speed return result
Michael could originally do 10 pull-ups. After training for a few weeks, he was able to double his strength. If he then rested for 15%, how many pull-ups can he do in a row?
def solve() -> int: original_pull_ups = 10 doubled_pull_ups = original_pull_ups * 2 rested_pull_ups = doubled_pull_ups * 0.85 result = rested_pull_ups return result
A shoe store sells sneakers for $50 per pair. On Monday it sold 25 pairs, on Tuesday it sold 30 pairs, on Wednesday it sold 40 pairs, on Thursday it sold 55 pairs, on Friday it sold 50 pairs. How much money did it make overall in a week?
def solve() -> int: price_sneakers = 50 sneakers_monday = 25 sneakers_tuesday = 30 sneakers_wednesday = 40 sneakers_thursday = 55 sneakers_friday = 50 total_sneakers = sneakers_monday + sneakers_tuesday + sneakers_wednesday + sneakers_thursday + sneakers_friday total_money = total_s...
Alice is planning a road trip. On the first day, she drives for 5 hours and then stops for the night. The next day, she drives for 3 hours less than the previous day. On the third day, she doubles the amount of time she drove on the first day. How many hours in total did Alice drive during these three days?
def solve() -> int: hours_day_1 = 5 hours_day_2 = hours_day_1 - 3 hours_day_3 = 2 * hours_day_1 total_hours = hours_day_1 + hours_day_2 + hours_day_3 result = total_hours return result
A bag of candy contains 20 pieces. If a person eats 5 pieces, how many pieces are left in the bag?
def solve() -> int: num_total_candy = 20 num_eaten_candy = 5 num_left_candy = num_total_candy - num_eaten_candy result = num_left_candy return result
For a party, Ben asked his friends how many slices of cake they wanted. Both Lisa and Jack agreed they wanted 3 slices each. Olivia said she could eat four times the amount of cake as Jack while Peter said he could eat only 1/4th of the total amount of cake. How many slices of cake did Ben need to order?
def solve() -> int: lisa_slices = 3 jack_slices = 3 olivia_slices = 4 * jack_slices peter_slices = (lisa_slices + jack_slices + olivia_slices) / 4 total_slices = lisa_slices + jack_slices + olivia_slices + peter_slices result = total_slices return result
Student: A family orders a new car for $25000. The down payment is 30% of the total cost, and the annual interest rate on the loan is 4%. After 4 years, the full loan has been paid off. How much money did the family pay in total?
def solve() -> int: car_cost = 25000 down_payment = car_cost * 0.3 interest_rate = 0.04 years = 4 total_paid = down_payment + (car_cost - down_payment) * (1 + interest_rate) ** years result = total_paid return result
Student: A box of oranges weighs 15 kg. The oranges inside weigh 12 kg more than the box itself. How much do the oranges weigh?
def solve() -> int: box_weight = 15 orange_weight = box_weight + 12 result = orange_weight return result
Yesterday, Sophia had 2 slices of toast, a bowl of oatmeal, and 4 strawberries for breakfast. Today, she plans to have three times as many slices of toast as yesterday, half as much oatmeal as yesterday, and twice as many strawberries as total number of toast slices and oatmeal bowls. How many slices of toast, oatmeal ...
def solve() -> int: toast_yesterday = 2 oatmeal_yesterday = 1 strawberries_yesterday = 4 toast_today = 3 * toast_yesterday oatmeal_today = 0.5 * oatmeal_yesterday strawberries_today = 2 * (toast_today + oatmeal_today) total_toast = toast_yesterday + toast_today total_oatmeal = ...
Student: A school has three classes of different sizes. Class A has 25 students, class B has 30 students, and class C has 35 students. The school organizes a field trip and charges $15 per student. However, the school also gives a $5 discount per student for every class that has more than 30 students. How much money, i...
def solve() -> int: class_a_size = 25 class_b_size = 30 class_c_size = 35 class_a_cost = class_a_size * 15 class_b_cost = (class_b_size * 15) - ((class_b_size - 30) * 5) class_c_cost = (class_c_size * 15) - ((class_c_size - 30) * 5) total_cost = class_a_cost + class_b_cost + class_c_cost ...
Taylor the fisherman caught 20 fish and sold 16 to a market, but when he tries to sell the remaining 4 to a restaurant owner, he is fined $10 and is not allowed to sell there again. If Taylor earned $5 for every fish he sold, how much money is he left with?
def solve() -> int: fish_caught = 20 fish_sold = 16 fish_remaining = fish_caught - fish_sold fish_price = 5 if fish_remaining >= 4: money_earned = fish_sold * fish_price money_left = money_earned - 10 else: money_earned = fish_sold * fish_price money_left = m...
Mark is learning to play the piano. On Monday, he practices for 20 minutes. Each day, he doubles the amount of practice time from the previous day. On what day will he practice more than 12 times longer than he did on Monday?
def solve() -> int: day = 1 practice_time = 20 while practice_time <= 12 * 20: practice_time *= 2 day += 1 result = day return result
Student: A school has 8 classes with 25 students each. The school organizes a field trip to a museum and rents 4 buses. Each bus can fit 50 students and 2 teachers. How many teachers go on the field trip?
def solve() -> int: students_per_class = 25 number_of_classes = 8 number_of_buses = 4 students_per_bus = 50 teachers_per_bus = 2 total_students = students_per_class * number_of_classes total_teachers = teachers_per_bus * number_of_buses result = total_teachers return result
Brett can paint a bedroom in 8 hours and put up curtains in 2 hours. How long will it take him to paint the bedroom and put up the curtains?
def solve() -> int: time_to_paint_bedroom = 8 time_to_put_up_curtains = 2 time_total = time_to_paint_bedroom + time_to_put_up_curtains result = time_total return result
A student made 80% on their math test. They scored 90% on their next test and then got 100% on their third test. What is their average score?
def solve() -> int: math = 80 test2 = 90 test3 = 100 average = (math + test2 + test3) / 3 result = average return result
amantha has saved up $800 to buy a new phone. The phone she wants costs $1000. How much more money does she need to save to buy the phone?
def solve() -> int: phone_cost = 1000 savings = 800 difference = phone_cost - savings result = difference return result
Mr. Davis bought nine apples and a basket for $27, and all nine apples are of equal price but the basket was five times as expensive as any one apple. How much did one apple cost?
def solve() -> int: apples = 9 basket = 1 total_cost = 27 x = total_cost / 14 result = x return result
Kelly ran a 5 km race in 25 minutes. She wanted to improve her speed by 10% for the next race. How long would it take her to run the same distance at the faster speed?
def solve() -> int: time = 25 * 60 speed = 5 / time speed = speed * 1.1 time = 5 / speed time = time / 60 time = round(time, 2) result = "It would take Kelly " + str(time) + " minutes to run 5 km at the faster speed." return result
A pizza has 8 slices. If 5/8 of the pizza is eaten, how many slices are left?
def solve() -> int: total_slices = 8 slices_eaten = 5 slices_left = total_slices - (total_slices * (slices_eaten/8)) result = slices_left return result
ome possible new questions and programs are: Jenna loves to ride her bike around the park. She rode 3 miles on the east side of the park, then 2 more than half of that distance on the north side. Then, she rode 1 mile less than the distance she rode on the east side on the west side, and finally 3 miles on the south si...
def solve() -> int: east = 3 north = 2 + east / 2 west = east - 1 south = 3 total = east + north + west + south result = total return result
The sum of three consecutive integers is 63. What is the smallest of these integers?
def solve() -> int: total = 63 n = (total - 3)/3 smallest = n - 1 result = smallest return result
A bag of candy has 30 pieces. If you eat 4 pieces of candy, what is the percentage of candy remaining?
def solve() -> int: total_candy = 30 candy_eaten = 4 candy_remaining = total_candy - candy_eaten percentage_remaining = candy_remaining / total_candy * 100 result = percentage_remaining return result
A jewelry store is creating a custom necklace that spells out a customer's name using diamond letters. If each diamond letter costs $50 and the customer also wants to add a diamond heart charm for $75, how much will the necklace cost in total if the customer's name is "LISA"?
def solve() -> int: num_letters = 4 letter_cost = 50 heart_cost = 75 total_letter_cost = num_letters * letter_cost total_cost = total_letter_cost + heart_cost result = total_cost return result
A baseball team has won 60% of their games so far this season. If they have played 40 games, how many games have they won?
def solve() -> int: games_won = 0.6 * 40 result = games_won return result
am sells 15 books for $8 each and 20 magazines for $4 each. He pays a 25% commission to the store and a 10% tax. How much does he earn?
def solve() -> int: books = 15 book_price = 8 magazines = 20 magazine_price = 4 commission = 0.25 tax = 0.1 revenue = books * book_price + magazines * magazine_price commission_amount = revenue * commission tax_amount = revenue * tax net_income = revenue ...
Cindy buys 60 bags of flour for $3 each. Each bag weighs 10 pounds and she sells the flour for $0.25 per pound. What is her profit?
def solve() -> int: bags_of_flour = 60 cost_per_bag = 3 weight_per_bag = 10 selling_price_per_pound = 0.25 total_cost = bags_of_flour * cost_per_bag total_weight = bags_of_flour * weight_per_bag total_revenue = total_weight * selling_price_per_pound profit = total_revenue - tot...
Ella is 7 years old. Her older sister is 5 times as old as she is. Her brother is 3 years younger than her sister. What is the age difference between Ella and her brother?
def solve() -> int: age_sister = 7 * 5 age_brother = age_sister - 3 result = age_sister - age_brother return result
Q10: After measuring ingredients, Kaleigh had 8 sticks of butter. Lorraine had 9 sticks of butter less than Kaleigh. How many more sticks of butter did Kaleigh have than Lorraine?
def solve() -> int: kaleigh = 8 lorraine = kaleigh - 9 difference = kaleigh - lorraine result = difference return result
A pizza has a diameter of 10 inches. What is the circumference of the pizza?
def solve() -> int: pi = 3.14 radius = 10 / 2 circumference = 2 * pi * radius result = circumference return result
If a laptop is on sale for 20% off, how much does it cost if the original price was $400?
def solve() -> int: original_price = 400 discount_percentage = 20 discount_amount = original_price*(discount_percentage/100) sale_price = original_price - discount_amount result = sale_price return result
Anne bought 10 boxes of chocolates, with each box having 18 chocolates. How many chocolates did Anne buy in all?
def solve() -> int: boxes = 10 chocolates_per_box = 18 total_chocolates = boxes * chocolates_per_box result = total_chocolates return result
Student: Leo is mowing lawns to save money for a new bike. The bike costs $450 and he earns $15 per lawn plus a 10% tip. He also has to pay $5 per lawn for gas and maintenance. If he mows 30 lawns, how much money does he have left after buying the bike?
def solve() -> int: bike_cost = 450 earnings_per_lawn = 15 tip_percentage = 0.1 gas_maintenance_cost_per_lawn = 5 number_of_lawns = 30 total_earnings = earnings_per_lawn * number_of_lawns + earnings_per_lawn * number_of_lawns * tip_percentage total_costs = gas_maintenance_cost_per_lawn * num...
Rachel had 120 pencils. She packed the pencils with 6 pencils in each pack, and she gave 12 packs to her brother, and 1/4 of the rest to her sister. How many packs of pencils did Rachel keep for herself?
def solve() -> int: pencils = 120 packs = pencils // 6 brother_packs = 12 sister_packs = (packs - brother_packs) // 4 rachel_packs = packs - brother_packs - sister_packs result = rachel_packs return result
In a box of 200 coins; quarters, dimes, and nickels are present. If the ratio of quarters to dimes is 5:4 and the ratio of dimes to nickels is 5:2, then find the number of dimes in the box.
def solve() -> int: total_number_of_coins = 200 quarter_to_dime_ratio = 5/4 dime_to_nickel_ratio = 5/2 x = 5 y = 4 z = 2 dimes_present = (x * y * total_number_of_coins)/((x * y) + (y * z) + (z * x)) result = dimes_present return result
Michael is currently 15 years old and his older brother is 29 years old. How old will Michael be when his older brother is three times as old as Michael is now?
def solve() -> int: michael_age = 15 brother_age = 29 difference = brother_age - michael_age future_age = difference * 2 + michael_age result = future_age - michael_age return result
Olivia Rodriguez wants to save $500 by the end of the month. She has already saved $350. How much does she need to save per day for the remaining 10 days to meet her goal?
def solve() -> int: goal = 500 saved = 350 remaining_days = 10 amount_needed = goal - saved amount_per_day = amount_needed / remaining_days result = amount_per_day return result
A survey at the supermarket found out of 75 customers, 35 prefer plastic bags and 40 prefer reusable bags. What percentage of customers prefer plastic bags?
def solve() -> int: total_customers = 75 plastic_bag_customers = 35 reusable_bag_customers = 40 total_prefer_plastic_bags = plastic_bag_customers / total_customers percent_prefer_plastic_bags = total_prefer_plastic_bags * 100 result = percent_prefer_plastic_bags return result
Rachel is trying to grow her own vegetables. She starts by planting 5 seeds per week. The second week, she plants twice as many seeds as she did the first week plus an additional 3 seeds. The third week, she plants 2/3 as many seeds as she did the second week. The week after that, she has to replant some failed seeds a...
def solve() -> int: week1 = 5 week2 = week1 * 2 + 3 week3 = week2 * 2/3 week4 = week3 * 1/2 result = week4 return result
David goes for a run every day. On the first day he runs 2 miles. Each following day he runs 1.5 times the distance as the day before. How many miles did David run in total after a week?
def solve() -> int: day_1 = 2 day_2 = day_1 * 1.5 day_3 = day_2 * 1.5 day_4 = day_3 * 1.5 day_5 = day_4 * 1.5 day_6 = day_5 * 1.5 day_7 = day_6 * 1.5 total_distance = day_1 + day_2 + day_3 + day_4 + day_5 + day_6 + day_7 result = total_distance return result
A coffee shop sells 100 cups of coffee per day for $5 each. If they sold 2 weeks' worth of production, how much money did the shop earn?
def solve() -> int: cups_per_day = 100 price_per_cup = 5 days_in_week = 7 weeks = 2 cups_sold = cups_per_day * days_in_week * weeks total_earnings = cups_sold * price_per_cup result = total_earnings return result
Student: A fruit stand sold 147 apples and 64 oranges in a day. The next day, they predict they'll sell 20% more apples and 35% more oranges. How many fruits will they sell the next day?
def solve() -> int: apples_day1 = 147 oranges_day1 = 64 apples_day2 = apples_day1 * 1.2 oranges_day2 = oranges_day1 * 1.35 result = apples_day2 + oranges_day2 return result
The price of movie tickets increased by 8% due to the pandemic. If a ticket originally cost $15, what is the new price?
def solve() -> int: ticket_price = 15 increase = 0.08 new_price = ticket_price + (ticket_price * increase) result = new_price return result
The length of a diagonal of a square is 10 cm. What is the area of the square?
def solve() -> int: diagonal = 10 side = diagonal / ((2)**0.5) area = side ** 2 result = area return result
Thomas has 12 marbles and Robert has 6 marbles. If Thomas gave half of his marbles to Robert, how many marbles would Robert have?
def solve() -> int: Thomas_marbles = 12 Robert_marbles = 6 result = Thomas_marbles / 2 + Robert_marbles return result
Lucas caught 30 fish on his fishing trip last year, but this year he only caught 1/3 of that number. If Lucas wants to double the number of fish he caught last year and his fish market sells one fish for $5, how much would Lucas have to spend?
def solve() -> int: last_year_fish = 30 this_year_fish = last_year_fish / 3 double_last_year_fish = last_year_fish * 2 fish_price = 5 total_cost = double_last_year_fish * fish_price result = total_cost return result
Aiden bought 7 items, each for $39.95. The store has a 20% discount for purchases of 5 or more items. How much did Aiden pay for all the items?
def solve() -> int: item_price = 39.95 discount = 0.20 number_of_items = 7 original_cost = item_price * number_of_items discounted_cost = original_cost - (original_cost * discount) result = discounted_cost return result
Rachel counted 7 seashells and twice as many starfish as seashells while exploring the beach. She also spotted three times as many hermit crabs as seashells and 5 less than four times as many sand dollars as seashells. How many ocean creatures did Rachel see?
def solve() -> int: seashells = 7 starfish = 2 * seashells hermit_crabs = 3 * seashells sand_dollars = (4 * seashells) - 5 ocean_creatures = seashells + starfish + hermit_crabs + sand_dollars result = ocean_creatures return result
Bryan, Dot, and Jeff went to the hardware store. Bryan bought 7 hammers and 4 saws, Dot bought 9 hammers and 6 saws, and Jeff bought 15 hammers and 10 saws. How many tools did they buy together?
def solve() -> int: num_hammers_bryan = 7 num_saws_bryan = 4 num_hammers_dot = 9 num_saws_dot = 6 num_hammers_jeff = 15 num_saws_jeff = 10 total_bryan = num_hammers_bryan + num_saws_bryan total_dot = num_hammers_dot + num_saws_dot total_jeff = num_hammers_jeff + num_saws_jeff ...
Ryan has fed his fish fifteen pellets of food. If he feeds them three more pellets each day and he had already fed them two before he started, how many days has he been feeding his fish?
def solve() -> int: initial_pellets = 2 total_pellets = 15 daily_pellets = 3 days = (total_pellets - initial_pellets) / daily_pellets result = days return result
There are 5 empty bottles of water with the same capacity. Max fills 40% of the first bottle, one-third of the second bottle, and one-fourth of the third bottle. What part of the remaining two bottles needs to be filled for all five bottles to contain the same amount of water?
def solve() -> int: bottle1_capacity = 1 filled_in_1 = 0.4 bottle2_capacity = 1 filled_in_2 = 1/3 bottle3_capacity = 1 filled_in_3 = 1/4 total_filled = filled_in_1 + filled_in_2 + filled_in_3 remaining_two_bottles = 5 - total_filled remaining_percentage = remaining_tw...
A recipe for cookies requires 2 cups of flour for every 1 cup of sugar. If you want to make 24 cookies and already have 3 cups of sugar, how many cups of flour do you need?
def solve() -> int: flour_needed = (24/6)*2 - 3 result = flour_needed return result
Royalty's salary increased by 10% in the second year as compared to the first year and again increased by 20% in the third year compared to the second year and then his final salary became 3960 dollars. Find the salary in the first year.
def solve() -> int: final_salary = 3960 salary_second_year = final_salary/1.2 salary_first_year = salary_second_year/1.1 result = salary_first_year return result
Maya wants to learn a new language fluently, so she starts studying each day. On the first day, she studies for 10 minutes. On the second day, she studies for 20 minutes. On the third day, she studies for 30 minutes. After realizing that she can study an extra 10 minutes each day, she realizes she can calculate how man...
def solve() -> int: day1 = 10 day2 = 20 day3 = 30 extra_time = 10 total_time = day1 + day2 + day3 days = 3 while total_time < 120: days += 1 total_time += (day3 + extra_time) day3 += extra_time result = days return result
If a daycare center has 12 toddlers and each one eats 2 times a day, using 1 plate per meal, how many plates are used in a week?
def solve() -> int: toddlers = 12 meals_per_day = 2 plates_per_meal = 1 meals_per_week = meals_per_day * 7 plates_per_week = toddlers * meals_per_week * plates_per_meal result = plates_per_week return result
Karen buys 4 bottles of water for the family every day. Each bottle costs $1.50 and each bottle is 16 ounces. If she buys water every day of the week, how much does she spend on water per week?
def solve() -> int: water_per_bottle = 16 cost_per_bottle = 1.5 bottles_per_day = 4 days_per_week = 7 total_ounces = water_per_bottle * bottles_per_day * days_per_week total_cost = total_ounces / 128 * cost_per_bottle result = total_cost return result
2. Two apples cost $1.25, how much would five apples cost in dollars?
def solve() -> int: cost_per_apple = 1.25 apple_number = 5 total_cost = cost_per_apple * apple_number result = total_cost return result
Mark's teacher buys a package of 80 pencils. Mark's class has 20 students. Each student changes one pencil every day. How many days will it take to finish the pack of pencils?
def solve() -> int: pencils_in_package = 80 students = 20 pencils_per_day = students * 1 days_to_finish = pencils_in_package / pencils_per_day result = days_to_finish return result
In a swimming race, Michael and James are neck-to-neck at the beginning of the race, until Michael leads by 250 meters. Then, James overtakes him and is now ahead by 100 meters. Michael speeds up and is ahead by 300 meters. If the pool is 3500 meters long, what is the distance between James and Michael when they both f...
def solve() -> int: michael_lead = 250 james_lead = 100 michael_speed = 300 pool_length = 3500 michael_distance_left = pool_length - michael_lead james_distance_left = pool_length - james_lead michael_time = michael_distance_left / michael_speed james_time = james_distance_left...
David brought 240 pencils to the classroom to share equally among his 20 classmates. The next day he realized that there were only 200 pencils left. If everyone took only one pencil, how many pencils did the classmate who took extra ones take?
def solve() -> int: pencils_brought = 240 classmates = 20 pencils_left = 200 pencils_per_classmate = pencils_brought / classmates pencils_taken = pencils_brought - pencils_left extra_pencils_taken = pencils_taken - classmates result = extra_pencils_taken return r...
Student: If Deb has 8 pencils and gives away 3 pencils, how many pencils does she have left?
def solve() -> int: deb_pencils = 8 deb_gives = 3 deb_left = deb_pencils - deb_gives result = deb_left return result
A goldsmith buys a rectangular prism of pure gold with the dimensions of 10 cm x 2 cm x 1 cm. The density of gold is 19 grams per cubic centimeter and the goldsmith pays $0.90 per gram for the gold. How much did the goldsmith pay for the gold?
def solve() -> int: volume = 10 * 2 * 1 weight_in_grams = volume * 19 cost_of_the_gold = weight_in_grams * 0.90 result = cost_of_the_gold return result
A plumber works for 8 hours a day for 5 days. He charges $80 per hour. How much does he charge in total?
def solve() -> int: hours_per_day = 8 days = 5 hourly_charge = 80 total_hours = hours_per_day * days total_charge = total_hours * hourly_charge result = f'<<<${total_charge}>>>' result = total_charge return result
Tyler has $50 in his wallet. He spent one-third of his money on a new video game and then found a $20 bill on the street. How much money did Tyler have before he found the $20 bill?
def solve() -> int: money_in_wallet = 50 spent_on_video_game = money_in_wallet / 3 money_after_spending = money_in_wallet - spent_on_video_game money_after_finding_bill = money_after_spending + 20 result = money_after_finding_bill return result
Karen’s age is 4 years less than Lisa’s age. If Lisa is 20 years old, how old will Karen be after 3 years?
def solve() -> int: lisa_age = 20 karen_age = lisa_age - 4 karen_age_after_3_years = karen_age + 3 result = karen_age_after_3_years return result
Jamille needs to go to the store that is 6 kilometers away from her house and it takes 17 minutes to get there. How fast is she driving to get to the store?
def solve() -> int: distance = 6 time_minutes = 17 time_hour = time_minutes/60 speed = distance/time_hour result = speed return result
A store has shirts on sale for 25% off the original price. If a shirt is originally $20, how much is it on sale for?
def solve() -> int: original_price = 20 discount_percentage = 0.25 discount_amount = original_price * discount_percentage sale_price = original_price - discount_amount result = sale_price return result
John paints walls and ceilings. He charges $10 per square meter for walls and $15 per square meter for ceilings. If he painted a room with dimensions of 5 m x 7 m x 3 m (lenght x width x height), where one of the walls is a ceiling, how much will John charge?
def solve() -> int: Wall_area = (5 * 3) + (7 * 3) Ceiling_area = 5 * 7 Total_area = Wall_area + Ceiling_area Total_charge = (Wall_area * 10) + (Ceiling_area * 15) result = Total_charge return result
John ordered two pizzas and paid a total of $33. If one pizza was $14, what was the price of the other pizza?
def solve() -> int: pizza1 = 14 total = 33 pizza2 = (total - pizza1)/2 result = pizza2 return result