question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A recipe for cookies calls for a ratio of 1 cup of sugar to 3 cups of flour. If you want to make 24 cookies, how much sugar do you need?
def solve() -> int: sugar_ratio = 1/3 cookies = 24 sugar_needed = sugar_ratio * cookies result = sugar_needed return result
Student: A machine at a factory can produce 300 units in 4 hours. How many units can it produce in 7 hours?
def solve() -> int: units_produced = 300 time_in_hours = 4 time_in_hours_2 = 7 units_produced_2 = units_produced * (time_in_hours_2 / time_in_hours) result = units_produced_2 return result
Max has $450. He wants to buy books at $8 each and give 1/2 of the books to his sister and 1/3 of the books to his nephew. How many books does Max give to his family?
def solve() -> int: max_money = 450 book_price = 8 total_books = max_money // book_price books_to_sister = total_books // 2 books_to_nephew = total_books // 3 books_to_family = books_to_sister + books_to_nephew result = books_to_family return result
5. Alicia bought two shirts that cost $35.90 each. How much will she have to pay after a 15% discount?
def solve() -> int: num_shirt = 2 cost_shirt = 35.90 discount = 0.15 cost = num_shirt * cost_shirt total = cost - discount*cost result = total return result
Student: Maria sold 60% of her cupcakes at a bake sale for $2 each. She then reduced the price of the remaining cupcakes by 50% and sold them for $1 each. How much money did Maria make in total from selling the cupcakes?
def solve() -> int: total_cupcakes = 100 sold_cupcakes = 0.6 * total_cupcakes remaining_cupcakes = total_cupcakes - sold_cupcakes original_price = 2 discounted_price = 0.5 * original_price money_from_original_price = sold_cupcakes * original_price money_from_discounted_price = remaining...
A car dealer sold a car for $15,000. The cost of the car was $12,000. What was the percentage of profit that the dealer made?
def solve() -> int: sale_price = 15000 cost_price = 12000 profit = sale_price - cost_price profit_percentage = (profit / cost_price) * 100 result = profit_percentage return result
Student: The average weight of an apple is 125 grams. If a bucket holds 20 kg of apples, how many apples are in the bucket?
def solve() -> int: apple_weight = 125 bucket_weight = 20 bucket_weight_grams = bucket_weight * 1000 num_apples = bucket_weight_grams / apple_weight result = num_apples return result
A team of cyclists consisting of 9 individuals embarked on a 60-mile long-distance race. Adam cycles at 15 miles per hour, Beth cycles at 18 miles per hour, Carl cycles at 20 miles per hour, Denise cycles at 24 miles per hour, Evan cycles at 25 miles per hour, Fran cycles at 17 miles per hour, Greg cycles at 16 miles p...
def solve() -> int: adam_speed = 15 beth_speed = 18 carl_speed = 20 denise_speed = 24 evan_speed = 25 fran_speed = 17 greg_speed = 16 heidi_speed = 22 ian_speed = 19 total_distance = 60 total_time = total_distance / ((1/adam_speed) + (1/beth_speed) + (1/carl_speed) + (1/...
A pizza costs $12.50. If the customer wants to add extra cheese for $2.50, and extra toppings for $1.75 each, how much money will they have to pay if they order two pizzas with extra cheese and two extra toppings?
def solve() -> int: pizza_price = 12.50 extra_cheese = 2.50 extra_toppings = 1.75 * 2 total_price = (pizza_price + extra_cheese + extra_toppings) * 2 result = total_price return result
A grocery store sold 10 watermelons for a total of $60. They sold 20 cantaloupes for a total of $40. They sold 15 honeydew melons for a total of $30. Assuming that each type of melon costs the same, how much money would they make selling 5 of each type of melon?
def solve() -> int: watermelon_price = 60/10 cantaloupe_price = 40/20 honeydew_price = 30/15 melons_sold = 5*3 total_sales = watermelon_price*5 + cantaloupe_price*5 + honeydew_price*5 result = total_sales return result
Lauren is trying to organize her bookshelf. If she has 3 bookshelves with 7 shelves on each one, how many books does she need to fill all of them up?
def solve() -> int: num_bookshelves = 3 num_shelves_per_bookshelf = 7 total_books = num_bookshelves * num_shelves_per_bookshelf result = total_books return result
Joana has 8 books. She borrowed 5 books from her friend. How many books does Joana have now?
def solve() -> int: books = 8 borrowed = 5 remaining = books - borrowed result = remaining return result
Joanne bought a bag of chips for $2.75. If she ate half of the bag, how much did she spend?
def solve() -> int: cost_of_whole_bag = 2.75 amount_of_bag_eaten = 0.5 cost_of_bag_eaten = cost_of_whole_bag * amount_of_bag_eaten result = cost_of_bag_eaten return result
In a basket full of fruits, 1/3 are oranges, 1/6 are bananas, and the rest are apples. If there are 36 oranges and bananas, how many apples are in the basket?
def solve() -> int: fraction_of_oranges = 1/3 fraction_of_bananas = 1/6 fraction_of_apples = 1 - fraction_of_oranges - fraction_of_bananas number_of_oranges_and_bananas = 36 total_number_of_fruits = number_of_oranges_and_bananas / (fraction_of_oranges + fraction_of_bananas) number_of_apples = to...
If a person has an hourly wage of $20 and works 8 hours a day, how much will they earn in a 5-day workweek?
def solve() -> int: wage = 20 hours = 8 days = 5 earnings = wage * hours * days result = earnings return result
Alex and 2 other family members sign up for a horseback riding class. The cost of the class is $700 per person. In addition, they have to pay $100 per day for the horses. They attend the class for a week. Alex pays one-third of the total cost. How much does Alex pay for the horseback riding class?
def solve() -> int: class_cost = 700 num_people = 3 num_days = 7 horse_cost_per_day = 100 total_cost = class_cost * num_people + horse_cost_per_day * num_days alex_payment = total_cost / 3 result = alex_payment return result
John ran for 2 miles, then walked for 1 mile and finally jogged for another 3 miles. What was the total distance that John covered?
def solve() -> int: distance1 = 2 distance2 = 1 distance3 = 3 total_distance = distance1 + distance2 + distance3 result = total_distance return result
A class of 24 students is divided into 4 groups for a project. The first group has 5 students, the second group has 6 students, and the third group has 4 students. How many students are in the fourth group?
def solve() -> int: total_students = 24 group_1 = 5 group_2 = 6 group_3 = 4 group_4 = total_students - group_1 - group_2 - group_3 result = group_4 return result
The ratio of boys to girls in a class is 3:4. If there are 28 students in the class, how many boys and girls are there?
def solve() -> int: boys_ratio = 3/7 students = 28 boys = boys_ratio*students girls = students - boys result = (int(boys), int(girls)) return result
A recipe calls for 2 cups of flour and 1 cup of sugar. If you want to make enough for 8 people (4 servings of 2), how much flour and sugar will you need?
def solve() -> int: flour_per_servings = 2/4 sugar_per_servings = 1/4 servings_needed = 8 flour_needed = flour_per_servings * servings_needed sugar_needed = sugar_per_servings * servings_needed result = (flour_needed, sugar_needed) return result
Student: Henry bought a total of 72 books. He decided to give away half of the books he bought. He then gave 3/4 of the remainder of his books to his sister. How many books did his sister receive?
def solve() -> int: total_books = 72 books_given_away = total_books / 2 books_left = total_books - books_given_away books_given_to_sister = books_left * 3 / 4 result = books_given_to_sister return result
A recipe calls for 3/4 cups of sugar to make 12 cookies. How much sugar is needed to make 30 cookies?
def solve() -> int: sugar_for_12_cookies = 3/4 sugar_for_30_cookies = (sugar_for_12_cookies / 12) * 30 result = sugar_for_30_cookies return result
There are 3 more dogs than cats in a pet store. There are 7 cats. How many animals are there in the pet store?
def solve() -> int: cats = 7 diff = 3 dogs = cats + diff total = cats + dogs result = total return result
Student: Aaron had 3 times as many apples as Lily. Together, they had 72 apples. How many apples did Aaron have?
def solve() -> int: aaron_apples = 0 lily_apples = 0 total_apples = 72 aaron_apples = total_apples - lily_apples lily_apples = aaron_apples / 3 aaron_apples = total_apples - lily_apples result = aaron_apples return result
Lisa works at a store and earns $12 per hour. She wants to earn $100 in one week, how many hours does she need to work?
def solve() -> int: hourly_rate = 12 weekly_earning_goal = 100 hours_worked = weekly_earning_goal / hourly_rate result = hours_worked return result
Student: There are 75 students in a classroom. 7/10 of them received a reward. How many students received a reward?
def solve() -> int: students = 75 reward_fraction = 7/10 rewarded_students = students * reward_fraction result = rewarded_students return result
Student: There are 50 fewer pigs than horses in a farm, and there are 280 pigs in total. How many horses are in the farm?
def solve() -> int: pigs = 280 difference = 50 horses = 0 horses = pigs + difference result = horses return result
3. Harry is cleaning his garage and finds a bag of marbles. He counts the marbles and finds that the bag has 270 marbles. He wants to divide the marbles evenly between himself and 6 of his friends. How many marbles will each person get?
def solve() -> int: num_marbles = 270 num_people = 7 each_person = num_marbles / num_people result = each_person return result
Derek can type 60 words per minute. If he types for 3.5 hours straight, how many words can he type?
def solve() -> int: typing_speed = 60 time_in_hours = 3.5 time_in_minutes = time_in_hours * 60 words_typed = typing_speed * time_in_minutes result = words_typed return result
John bikes 5 miles to his friend's house every evening and then bikes 3 miles back home. He repeats this for 3 days. How many miles does John bike in total after 3 days? Ms. Meadows has 24 rabbits, 16 cats, and some dogs. She has 3 times as many rabbits as cats and twice as many rabbits as dogs. How many dogs does she ...
def solve() -> int: to_friend = 5 to_home = 3 days = 3 total_distance = (to_friend + to_home) * 2 * days rabbits = 24 cats = 16 dogs = (rabbits / 3) / 2 result = total_distance, dogs return result
A bakery sold 200 cupcakes on Monday, 90 on Tuesday and 125 on Wednesday. If each box contains 12 cupcakes, how many boxes of cupcakes did they sell in total?
def solve() -> int: total_cupcakes = 200 total_cupcakes += 90 total_cupcakes += 125 boxes = total_cupcakes // 12 result = boxes return result
The length of a rectangle is 12 cm and the width is 6 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 12 width = 6 perimeter = 2 * (length + width) result = perimeter return result
Tim has 24 pencils in total between blue, red, and green. He has 4 more blue pencils than red pencils, and 6 less green pencils than blue pencils. How many green pencils does he have?
def solve() -> int: r = (24 - 4 - 6) / 2 b = r + 4 g = b - 6 result = g return result
Tom has $100 in his bank account. If he withdraws $25 every week for 4 weeks, how much money will he have left?
def solve() -> int: starting_amount = 100 amount_withdrawn = 25 weeks_withdrawing = 4 result = starting_amount - (amount_withdrawn * weeks_withdrawing) return result
The price of one computer is $1,200. If a customer buys 4 computers, they get a 10% discount. What is the total cost of 4 computers after the discount?
def solve() -> int: computer_price = 1200 num_computers = 4 discount_percentage = 0.1 subtotal = computer_price * num_computers discount_amount = subtotal * discount_percentage total_cost = subtotal - discount_amount result = total_cost return result
Diane wants to save at least $500 this month. On the first day, she saves $50. On the second day, she saves 3 times as much as on the first day. On the third day, she saves half as much as on the second day. On the fourth day, she saves 4 times as much as on the third. On the last day, she saves $20. How much more mone...
def solve() -> int: day1 = 50 day2 = day1 * 3 day3 = day2 / 2 day4 = day3 * 4 day5 = 20 total_saved = day1 + day2 + day3 + day4 + day5 remaining_goal = 500 - total_saved result = remaining_goal return result
A fisherman caught 60 fishes yesterday and twice as many today. All of these should be sold tomorrow. How many fishes should be sold tomorrow?
def solve() -> int: yesterday = 60 today = 2 * yesterday total = yesterday + today sold_tomorrow = total result = sold_tomorrow return result
A car rental agency has two types of cars. Type A costs $35 per day and Type B costs $50 per day. If the agency earns $3,675 in total for renting out 75 cars, how many cars of each type were rented?
def solve() -> int: total_earnings = 3675 total_cars_rented = 75 price_of_car_a = 35 price_of_car_b = 50 number_of_car_a_rented = ((2 * total_cars_rented * price_of_car_a) - total_earnings) / (2 * (price_of_car_a - price_of_car_b)) number_of_car_b_rented = total_cars_rented - number_of_car_a_ren...
Jane bought a 6-pack of apples and a 3-pack of oranges from the grocery store. How many pieces of fruit did she buy in total?
def solve() -> int: apples = 6 oranges = 3 total_pieces = apples + oranges result = total_pieces return result
A concert ticket costs $75. If 500 tickets are sold, what is the total revenue from ticket sales after subtracting a 10% processing fee?
def solve() -> int: ticket_price = 75 number_of_tickets = 500 processing_fee_percent = 10 processing_fee_amount = number_of_tickets * ticket_price * (processing_fee_percent / 100) total_revenue = (number_of_tickets * ticket_price) - processing_fee_amount result = total_revenue return result
Student: James goes to the store and buys one handbag for $20 and two scarves for 2/3rds of the price of the handbag. How much does she pay in total?
def solve() -> int: handbag_price = 20 scarves_price = (2/3) * handbag_price total_price = handbag_price + (2 * scarves_price) result = total_price return result
Tom has a jar of 120 marbles. He knows that 20% of the marbles are red, 30% are blue, and the rest are green. He wants to give away some of his marbles to his friends so that he will have an equal number of each color left in the jar. How many marbles does he need to give away?
def solve() -> int: result = abs(-16) + abs(-4) + abs(20) return result
A family of 4 went to a movie theater. The tickets cost $8 for adults and $6 for children. The theater also charged a $2 fee for online booking. How much did the family spend in total for the tickets and the booking fee?
def solve() -> int: adults = 2 children = 2 adult_price = 8 child_price = 6 fee = 2 ticket_cost = (adults * adult_price) + (children * child_price) total_cost = ticket_cost + fee result = total_cost return result
Isabel adds 6 tablespoons of chocolate powder and 48 tablespoons of milk to a blender to make a chocolate milkshake. After blending, 5 tablespoons of the milkshake spills out. Then she adds 10 times the amount of milk to the remaining milkshake. What percentage of the liquid in the blender is chocolate powder?
def solve() -> int: chocolate_powder = 6 milk = 48 total_liquid = chocolate_powder + milk spilled_liquid = 5 remaining_liquid = total_liquid - spilled_liquid new_milk = milk * 10 final_liquid = remaining_liquid + new_milk percentage_chocolate = (chocolate_powder / final_liquid) * 100 ...
A rectangular plot has a length of 30 meters and a width of 22 meters. What is the total area of the plot in square meters?
def solve() -> int: length = 30 width = 22 area = length * width result = area return result
Student: Sara can swim 100 meters in 2 minutes. How far can she swim in 10 minutes?
def solve() -> int: distance = 100 time = 2 rate = distance / time distance_10min = rate * 10 result = distance_10min return result
A can of paint falls off a ladder and spills onto the ground. The paint spreads out in a diameter fifteen times as wide as the height the can fell from. If the paint can fell five feet from the ground, what was the radius of the paint spill in feet?
def solve() -> int: height = 5 diameter = height * 15 radius = diameter / 2 result = radius return result
Buds Elementary School has 105 students. On the first day of school, 70 students were wearing a uniform. 15 students were wearing a dress. What fraction of the students were not wearing a uniform?
def solve() -> int: number_of_students = 105 number_in_uniform = 70 number_in_dress = 15 not_in_uniform = number_of_students - (number_in_uniform + number_in_dress) total = number_of_students result = not_in_uniform / total print (result) return result
Juan wants enough socks to last him two weeks without doing laundry. He wears one pair of socks to school for each of the five weekdays. Four days a week, he wears a different pair of socks for soccer practice after school. On the weekends, he wears one pair of socks per day. How many socks does Juan need to go two wee...
def solve() -> int: weekday_socks = 5 * 2 soccer_practice_socks = 4 * 2 weekend_socks = (1 + 1) * 2 total_socks = weekday_socks + soccer_practice_socks + weekend_socks result = total_socks result return result
Emily is working as a nurse and due to a shortage of staff, she's been working longer hours. As a result, she's earned some overtime (where every hour after 50 she earns 1.75 times her normal wage. ) Her paycheck (before taxes are taken out) came out to $1,402. If she normally earns $20 per hour, how many hours did she...
def solve() -> int: normal_wage = 20 overtime_wage = normal_wage * 1.75 overtime_hours = (1402 - (normal_wage * 50)) / overtime_wage total_hours = 50 + overtime_hours result = total_hours return result
Arthur ran 6.5 kilometers in the morning and 4.1 kilometers in the evening. Philip ran twice as far as Arthur in the morning, followed by running three-quarters as far in the evening. How much further did Philip run than Arthur?
def solve() -> int: distance_a = 6.5 + 4.1 distance_p = 2 * 6.5 + 3/4 * 4.1 result = distance_p - distance_a return result
A school has 960 students, of which 40% are girls. Each girl has 2 more pens than each boy, and each boy has 3 pencils fewer than each girl. If the total number of writing tools the girls have is 3 times the total number of writing tools the boys have, how many pens does each girl have?
def solve() -> int: total_students = 960 girls = 0.4 * total_students boys = total_students - girls total_tools_girls = 3 * (2 * boys + girls) total_tools_boys = boys * (girls - 3) pens_girls = total_tools_girls // 5 result = f'Each girl has {pens_girls} pens.' result = pens_girls re...
Mary gave away 1/4 of her marbles to her sister and kept 36. How many marbles did she have at first?
def solve() -> int: marbles_after_gift = 36 marbles_before_gift = marbles_after_gift / 0.75 result = marbles_before_gift return result
Mark hikes 11 miles on Monday, 19 miles on Wednesday, and 28 miles on Friday. How many miles does he hike in total in three weeks?
def solve() -> int: miles_monday = 11 miles_wednesday = 19 miles_friday = 28 weeks = 3 total_miles = miles_monday + miles_wednesday + miles_friday*weeks result = total_miles return result
Toby has a total of $700 in his bank account. He needs to pay $75 for book rentals. How much money does Toby have left in his bank account?
def solve() -> int: total = 700 total = total - 75 result = total return result
Susan, Mark, and Luke were given a total of 50 candies. Susan got 3 times as many candies as Mark. Luke got 5 more candies than Mark. How many candies did each of them get?
def solve() -> int: total_candies = 50 mark_candies = total_candies // 7 susan_candies = 3 * mark_candies luke_candies = mark_candies + 5 result = (susan_candies, mark_candies, luke_candies) return result
Maya has 40 stickers for her album. She gives away 10 stickers to her friends and then receives 8 more stickers from her sister. Her brother Leo, who has twice as many stickers as Maya after these exchanges, also gives away some stickers to his friends. How many stickers does Leo have left if he gives away 16 stickers?
def solve() -> int: maya = 40 leo = 0 maya = maya - 10 + 8 leo = 2 * maya leo = leo - 16 result = leo return result
A rectangular field has a width of 80 meters and a length that is 3 times the width. What is the perimeter of the field?
def solve() -> int: width = 80 length = 3*width perimeter = 2*(length+width) result = perimeter return result
A rectangle has a length of 10 cm and a perimeter of 32 cm. What is its width?
def solve() -> int: perimeter = 32 length = 10 width = (perimeter - 2*length) / 2 result = width return result
Jack has a lemonade stand that sells lemonade for 50 cents per cup and brownies for 75 cents each. He uses 6 lemons and 4 cups of sugar to make a pitcher of lemonade, which fills 12 cups. He uses 2 eggs, 1 cup of sugar, and 1/4 cup of cocoa to make a batch of brownies, which cuts into 16 pieces. For a sunny day, he exp...
def solve() -> int: cost_per_lemon = 0.25 cost_per_cup_of_sugar = 0.5 cost_per_egg = 0.1 cost_per_cup_of_cocoa = 0.75 cost_for_lemonade = (6 * cost_per_lemon + 4 * cost_per_cup_of_sugar) * 10 cost_for_brownies = (2 * cost_per_egg + 1 * cost_per_cup_of_sugar + 0.25 * cost_per_cup_of_cocoa) *...
Jim received his monthly salary of $2400. If he spends $1000 on rent, $250 on groceries, $200 on bills, and $500 on miscellaneous items, how much money does he have left as savings?
def solve() -> int: salary = 2400 rent = 1000 groceries = 250 bills = 200 misc = 500 total_expenses = rent + groceries + bills + misc savings = salary - total_expenses result = savings return result
Carlos wants to paint his room. He needs to paint 4 walls and a ceiling. Each wall has a length of 12 feet and a height of 8 feet. The ceiling has the same length and width as the walls. He can buy paint in cans of 0.5 gallons or 1 gallon. Each can of 0.5 gallon costs $8.00 and each can of 1 gallon costs $15.00. One ga...
def solve() -> int: wall_length = 12 wall_height = 8 ceiling_length = wall_length ceiling_width = wall_length can_small = 0.5 can_large = 1 can_small_cost = 8 can_large_cost = 15 coverage = 100 wall_area = wall_length * wall_height * 4 ceiling_area = ceiling_length * ceiling_...
ome possible questions and programs are: A bakery sold 1200 muffins per day before the pandemic, but had to reduce its sales by 40% due to lockdown restrictions. How many muffins did the bakery sell in April of 2020, which had 30 days?
def solve() -> int: new_sales_rate = 0.6 new_daily_sales = new_sales_rate * 1200 total_sales = new_daily_sales * 30 result = total_sales return result
Possible additional questions and programs: Ellie read 34 pages of a book on Monday and 58 pages on Tuesday. She read 15 more pages than half of the total pages on Wednesday. How many pages did Ellie read in total?
def solve() -> int: total_pages = 34 + 58 wednesday_pages = 15 + (total_pages / 2) total_read = total_pages + wednesday_pages result = total_read return result
Luis has 9 balls more than 4 times the number of cups. If he has 37 items, how many cups does Luis have?
def solve() -> int: items_num = 37 balls_num = 9 multiplier = 4 cups_num = (items_num - balls_num) // multiplier result = cups_num return result
There are 24 students in a classroom. If the teacher divides them into groups of 3, how many groups are there?
def solve() -> int: students = 24 students_per_group = 3 groups = students // students_per_group result = groups return result
Student: On a four-day trip, Juan drove 140 miles on the first day, and 175 miles on the second day. On the third day, he drove four times as much as he drove on the first day. If the total miles that Juan drove for the trip is 977 miles, how many miles did he drive on the fourth day?
def solve() -> int: first_day = 140 second_day = 175 third_day = 4 * first_day total_miles = 977 fourth_day = total_miles - first_day - second_day - third_day result = fourth_day return result
If Tom can assemble 3 cell phones in 4 hours and Jane can assemble the same cell phone in 5 hours, how many hours will it take them to complete a batch of 6 phones working together?
def solve() -> int: tom_rate = 3 / 4 jane_rate = 1 / 5 combined_rate = tom_rate + jane_rate total_phones = 6 total_time = total_phones / combined_rate result = total_time return result
Student: A tray contains 360 odd numbers, distributed between 12 children. What is the maximum number of odd numbers each child can get, without any remainders?
def solve() -> int: total_odd_numbers = 360 number_of_children = 12 maximum_odd_numbers_per_child = total_odd_numbers // number_of_children result = maximum_odd_numbers_per_child return result
A restaurant is offering a 20% discount to attract customers. If the original price of a meal is $30, what is the discounted price per meal?
def solve() -> int: discount = 0.2 original_price = 30 discounted_price = original_price * (1-discount) result = discounted_price return result
The large pizza has 6 more slices than the medium pizza, and the medium pizza has 4 more slices than the small pizza. If the large pizza has 18 slices, how many slices does the small pizza have?
def solve() -> int: large_pizza_slices = 18 medium_pizza_slices = large_pizza_slices - 6 small_pizza_slices = medium_pizza_slices - 4 result = small_pizza_slices return result
10. Tara's cake shop has 73 cupcakes and 45 cookies in its inventory. Each cupcake costs $3 and each cookie costs $2. How much money will Tara's shop need to buy these cupcakes and cookies?
def solve() -> int: cupcakes_cost = 73 * 3 cookies_cost = 45 * 2 total_cost = cupcakes_cost + cookies_cost result = total_cost return result
Prue is planning to buy some new furniture for her living room. She has a budget of €1400 and finds a couch for €650, a chair for €220, and a small table for €120. If she wants to have €10 left for some additional items, how much more money should she save up?
def solve() -> int: couch = 650 chair = 220 table = 120 budget = 1400 extra = 10 total_items_price = couch + chair + table missing_funds = budget - total_items_price - extra result = missing_funds return result
During an excursion to a wildlife park, Mr. Green takes 1/3 more boys than girls. If there are a total of 90 girls on the trip, and a driver and bus assistant are present, find the total number of people on the bus.
def solve() -> int: girls = 90 boys = girls * (4/3) total = girls + boys + 2 result = total return result
A phone costs $320 and you want to buy it on a payment plan of 12 months with 5% interest. What will be the monthly payment to pay off this phone?
def solve() -> int: phone_cost = 320 interest = 1.05 months = 12 monthly_payment = phone_cost * interest / months result = monthly_payment return result
Rachel, Sarah, and Tyler collect stamps. Rachel has six times as many stamps as Sarah, and Sarah has four times as many stamps as Tyler. If Tyler has 16 stamps, how many stamps does Rachel need to give to Sarah for them to have an equal number of stamps?
def solve() -> int: tyler_stamps = 16 sarah_stamps = tyler_stamps * 4 rachel_stamps = sarah_stamps * 6 difference = rachel_stamps - sarah_stamps stamps_to_give = difference / 2 result = stamps_to_give return result
A store bought 275 toys for a total of $1235. If the store made a profit of $7 per toy, what was the original cost per toy to the store?
def solve() -> int: total_toys = 275 total_profit = 275*7 total_cost = 1235 original_cost = (total_cost - total_profit)/total_toys result = original_cost return result
Leo is going to a bike rental shop and wants to rent a bike for a day. He knows the shop charges $10 for the first hour and $5 for each additional hour. He also knows he has to pay a $20 deposit that will be refunded if he returns the bike in good condition. If he rents the bike for 8 hours, how much will he pay in tot...
def solve() -> int: first_hour_cost = 10 additional_hour_cost = 5 deposit = 20 hours = 8 rental_cost = first_hour_cost + (hours - 1) * additional_hour_cost total_cost = rental_cost + deposit final_cost = total_cost - deposit result = final_cost return result
Student: There are 15 planets in the solar system. If 5 are gas giants, how many planets are not gas giants?
def solve() -> int: total_planets = 15 gas_giants = 5 not_gas_giants = total_planets - gas_giants result = not_gas_giants return result
Jasmine has a jar of jelly beans. She counts that there are 120 red, 80 green, and 60 yellow jelly beans in the jar. She takes out 20 red, 10 green, and 5 yellow jelly beans and puts them in a bag. She then adds 15 blue jelly beans to the jar. How many jelly beans are in the jar now?
def solve() -> int: red = 120 green = 80 yellow = 60 red = red - 20 green = green - 10 yellow = yellow - 5 total = red + green + yellow total = total + 15 result = total return result
Eva sold 17 bowling balls, each weighing 5.5kg. How much did she sell in total?
def solve() -> int: number_of_bowling_balls = 17 weight_of_each_ball = 5.5 total_amount_sold = number_of_bowling_balls * weight_of_each_ball result = total_amount_sold return result
Farmer Tom has 5 sheep: Lucy, Dolly, Molly, Polly, and Wolly. Lucy produces 2 pounds of wool each year, which is half of what Dolly produces. Molly produces 50% more wool than Dolly, while Polly produces twice the amount of wool that Lucy produces. Wolly, the largest sheep, produces three times as much wool as all the ...
def solve() -> int: lucy_wool = 2 dolly_wool = lucy_wool * 2 molly_wool = dolly_wool * 1.5 polly_wool = lucy_wool * 2 wolly_wool = (lucy_wool + dolly_wool + molly_wool + polly_wool) * 3 total_wool = (lucy_wool + dolly_wool + molly_wool + polly_wool + wolly_wool) * 5 result = total_wool r...
In a box of 24 pencils, every 3rd pencil is blue. How many blue pencils are there in the box?
def solve() -> int: num_pencils = 24 every_nth_pencil = 3 blue_pencils = num_pencils // every_nth_pencil result = blue_pencils return result
- A cake costs $8 and a cupcake costs $1.5. A bakery sells 10 cakes and 24 cupcakes in a day. How much revenue does the bakery make in a day?
def solve() -> int: cake_price = 8 cupcake_price = 1.5 cake_revenue = cake_price * 10 cupcake_revenue = cupcake_price * 24 total_revenue = cake_revenue + cupcake_revenue result = total_revenue return result
Anna and Sam run at different speeds. Anna runs at 7mph while Sam runs at 11mph. How long will it take them to run a distance of 20 miles if they start at the same time from the same place?
def solve() -> int: distance = 20 speed1 = 7 speed2 = 11 time_to_meet = distance / (speed1 + speed2) result = time_to_meet return result
Alexander had 87 marbles. He used 1/4 of them to give to his neighbors, used 1/2 of the remaining to make a necklace and kept the remaining marbles. How many marbles did he keep?
def solve() -> int: total_marbles = 87 marbles_used_cumulative = total_marbles // 4 marbles_left = total_marbles - marbles_used_cumulative marbles_left = marbles_left - marbles_left // 2 result = marbles_left return result
Student: Emily went on a road trip and drove for 6 hours at 50 miles per hour and then for 3 hours at 70 miles per hour. What was her average speed during the entire trip?
def solve() -> int: time_1 = 6 speed_1 = 50 time_2 = 3 speed_2 = 70 distance_1 = time_1 * speed_1 distance_2 = time_2 * speed_2 total_distance = distance_1 + distance_2 total_time = time_1 + time_2 average_speed = total_distance / total_time result = average_speed return...
Tyler injured himself while snowboarding. The pain subsided after 8 hours, but he knew that the injury would take at least 9 times that long to fully heal. After that, he wanted to wait another 12 hours before he started practicing again. If he wants to wait 4 days after that to start competing again, how long until he...
def solve() -> int: hours_pain_subside = 8 hours_to_fully_heal = 9 * hours_pain_subside hours_to_start_practicing = hours_to_fully_heal + 12 hours_to_start_competing = hours_to_start_practicing + 4 * 24 result = hours_to_start_competing return result
For every 6 cupcakes baked, a baker uses 2 eggs. If the baker wants to bake 48 cupcakes, how many eggs does he need to use in total?
def solve() -> int: cupcakes = 48 eggs_per_cupcake = 2 / 6 eggs = cupcakes * eggs_per_cupcake result = eggs return result
Kayla has $100 in her bank. She deposited $20 for 3 weeks, and then withdrew $10 for 5 weeks. How much money does she have now?
def solve() -> int: balance = 100 balance += 20 * 3 balance -= 10 * 5 result = balance return result
A recipe calls for 2 cups of sugar for every 3 cups of flour. If the recipe requires 6 cups of flour, how much sugar does it require?
def solve() -> int: flour = 6 sugar_per_flour = 2 / 3 sugar = flour * sugar_per_flour result = sugar return result
``` A pet store has 400 fish tanks in stock. 90 tanks are sold on the first day, and then 25 more are sold the second day. How many tanks are left in stock?
def solve() -> int: num_tanks = 400 num_sold_first = 90 num_sold_second = 25 num_left = num_tanks - num_sold_first - num_sold_second result = num_left return result
David purchases a watch for $150 and a necklace for $75. He gives the cashier $300. If the cashier has only 2 quarters and 9 pennies in the till, how many dimes will David receive in his change?
def solve() -> int: watch_price = 150 necklace_price = 75 total_price = watch_price + necklace_price cash_given = 300 change = cash_given - total_price quarters_in_till = 2 pennies_in_till = 9 dimes = change // 10 result = dimes return result
A coffee shop initially had 50 cups of coffee. They sold 25 cups and then brewed 30 more cups. After that, they sold 35 cups. How many cups of coffee do they have left now?
def solve() -> int: initial_cups = 50 sold_cups1 = 25 new_cups = 30 sold_cups2 = 35 result = initial_cups - sold_cups1 + new_cups - sold_cups2 return result
Leo had 27 cookies. He baked 15 more cookies with his mom. He ate 9 cookies for dessert. He shared 12 cookies with his friends. How many cookies are Leo left with?
def solve() -> int: cookies = 27 + 15 cookies = cookies - 9 - 12 result = cookies return result
Student: A bakery made 50 donuts today. They sold 30 donuts and gave 10 donuts to their employees. How many donuts are left?
def solve() -> int: total_donuts = 50 sold_donuts = 30 employee_donuts = 10 remaining_donuts = total_donuts - sold_donuts - employee_donuts result = remaining_donuts return result
A rectangular prism has a length of 6 meters, a width of 4 meters, and a height of 3 meters. What is the total surface area of the prism in square meters?
def solve() -> int: length = 6 width = 4 height = 3 surface_area = 2*(length*width + length*height + width*height) result = surface_area return result
If 15 people use 3 rolls of toilet paper each day, how many rolls will they use in 5 days?
def solve() -> int: num_people = 15 rolls_per_person_per_day = 3 num_days = 5 total_rolls_used = num_people * rolls_per_person_per_day * num_days result = total_rolls_used return result
David is monitoring the weight of his five pets. His cat weighs 3.5 kg, his dog weighs 6.2 kg, his hamster weighs 0.07 kg, his rabbit weighs 1.8 kg, and his guinea pig weighs 0.9 kg. On average, how many kilograms does each of his pets weigh?
def solve() -> int: cat_weight = 3.5 dog_weight = 6.2 hamster_weight = 0.07 rabbit_weight = 1.8 guinea_pig_weight = 0.9 total_weight = cat_weight + dog_weight + hamster_weight + rabbit_weight + guinea_pig_weight average_weight = total_weight / 5 result = average_weight retu...
acy picked 5 dozen oranges, 4 dozen apples and 6 dozen bananas. What fraction of the total number of fruit picked is the number of bananas?
def solve() -> int: a = 5 b = 4 c = 6 total = a + b + c fraction = c/total result = fraction return result