question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Some possible questions and programs are: Kate bakes cupcakes for a school fair. She needs 2 eggs, 1 cup of flour and 1/4 cup of sugar for 12 cupcakes. If an egg costs $0.20, a cup of flour costs $0.50 and a cup of sugar costs $0.75, how many cents does it cost Kate to make one cupcake?
def solve() -> int: egg_cost = 20 flour_cost = 50 sugar_cost = 75 total_cost = 2 * egg_cost + 1 * flour_cost + 0.25 * sugar_cost cupcake_cost = total_cost / 12 result = round(cupcake_cost) return result
Ten workers are assembling a machine. Each worker makes 8 trips to bring parts to the assembly line. If the parts are stored 200 meters away from the line, what is the total distance the workers covered in the trips?
def solve() -> int: num_workers = 10 num_trips = 8 distance_per_trip = 200 total_distance = num_workers * num_trips * distance_per_trip result = total_distance return result
A book club is meeting for snacks. Each member needs 1 cookie, and will sit at a table with 7 other members. There are a total of 8 tables. How many cookies will the club need to make enough snacks for all the members?
def solve() -> int: num_members = 8 * 8 num_cookies = num_members * 1 result = num_cookies return result
A store sells apples for 2 dollars each and oranges for 3 dollars each. If Mary buys 3 apples and 2 oranges, how much money will she spend?
def solve() -> int: apple_price = 2 orange_price = 3 apples = 3 oranges = 2 total_spent = apple_price*apples+orange_price*oranges result = total_spent return result
Mr. Brown sold 60 items in a day. 50% of the items were sold at $10 each and the rest were sold at $20 each. How much did he make in total that day?
def solve() -> int: num_items_at_10 = 0.5*60 num_items_at_20 = 60 - num_items_at_10 total_sales = num_items_at_10*10 + num_items_at_20*20 result = total_sales return result
A school has 450 students, of which 60% are boys. How many boys are in the school?
def solve() -> int: total_students = 450 boys_percentage = 60 boys = (boys_percentage / 100) * total_students result = boys return result
A coupon gives 15% off any purchase at a store. If a customer buys two pairs of shoes for $50 each, how much does the customer save with the coupon?
def solve() -> int: original_price = 50 * 2 discounted_price = original_price * 0.85 savings = original_price - discounted_price result = savings return result
John eats 2 slices of bread in the morning and 3 slices of bread in the afternoon every day. If a loaf of bread has 15 slices, how many loaves of bread does John need for a month (30 days)?
def solve() -> int: breadMorning = 2 breadAfternoon = 3 slicesPerLoaf = 15 slicesPerDay = breadMorning + breadAfternoon totalSlices = slicesPerDay * 30 totalLoaves = totalSlices // slicesPerLoaf +1 result = totalLoaves return result
During a weekend trip, a family of 6 went to a theme park. They paid $25 each for entry and $10 for parking. If they each bought a $12 souvenir, what was the total cost for the family?
def solve() -> int: num_people = 6 entry_cost = 25 parking_cost = 10 souvenir_cost = 12 total_entry_cost = num_people * entry_cost total_parking_cost = parking_cost total_souvenir_cost = num_people * souvenir_cost total_cost = total_entry_cost + total_parking_cost + total_souve...
Remy bought a shirt, a pair of jeans, and a belt. The shirt cost $20, the jeans cost twice as much as the shirt, and the belt cost 10% of the jeans. Remy also had to pay a 5% sales tax on his purchases. How much did Remy pay in total, including the tax?
def solve() -> int: shirt = 20 jeans = shirt * 2 belt = jeans * 0.1 subtotal = shirt + jeans + belt tax = subtotal * 0.05 total = subtotal + tax result = total return result
If the ratio of boys to girls in a class is 5:3, and there are a total of 64 students, how many boys are there in the class?
def solve() -> int: boys = 5 girls = 3 total_students = 64 boys_ratio = boys / (boys + girls) boys_count = boys_ratio * total_students result = boys_count return result
Rebecca has 4 more than three times as many lollipops as Jake. If Jake has 5 lollipops, how many lollipops does Rebecca have?
def solve() -> int: jake_lollipops = 5 rebecca_lollipops = 3 * jake_lollipops + 4 result = rebecca_lollipops return result
Lily wants to buy a new bike for $250. She saved up $120, and her mother agreed to pay half of the remaining cost. If the bike costs sales tax is 7%, how much money will Lily's mother pay for the bike?
def solve() -> int: bike_price = 250 lily_savings = 120 sales_tax_rate = 0.07 remaining_cost = bike_price - lily_savings half_remaining_cost = remaining_cost / 2 total_cost_with_tax = (remaining_cost - half_remaining_cost) * (1 + sales_tax_rate) mother_payment = half_remaining_cost + total_c...
Sarah is making smoothies for her coworkers. Each smoothie has 250 calories from mixed berries, 150 calories from bananas, and 75 calories from almond milk. Sarah wants each coworker to consume a total of 500 calories. How many smoothies can each coworker have? Erica went to the pet store to buy fish food. Afterwards, ...
def solve() -> int: calories_per_smoothie = 250 + 150 + 75 total_calories = 500 smoothies_per_coworker = total_calories / calories_per_smoothie haircut_cost = 120 pet_store_expenses = (haircut_cost + 30) / 2 total_expenses = haircut_cost + pet_store_expenses result = smoothies_per_...
If a 5% tax is added to a $100 purchase, what is the total cost of the purchase after tax?
def solve() -> int: purchase_price = 100 tax_percentage = 0.05 total_cost = purchase_price + (purchase_price * tax_percentage) result = total_cost return result
A train is traveling from station A to station B. Station B is 300 miles away from Station A. The train departs station A at 1:00 PM and arrives at station B at 4:00 PM. What is the average speed of the train?
def solve() -> int: distance = 300 departure = 13 arrival = 16 time = arrival - departure speed = distance / time result = speed return result
Three days ago, Henry charged his tablet for 16 hours. Assuming each hour of charge lasts the tablet for 7 hours of use, calculate the total time Henry would be able to use his tablet if he charges it for 2/5 of the time he charged it three days ago.
def solve() -> int: hours_charged = 16 hours_use_per_hour_charge = 7 fraction_of_charge = 2/5 total_use = hours_charged * hours_use_per_hour_charge partial_charge = hours_charged * fraction_of_charge partial_use = partial_charge * hours_use_per_hour_charge result = partial_use ...
In a swimming race, there are 8 swimmers competing for the award. If half of the racers give up, how many swimmers remain?
def solve() -> int: swimmers_original = 8 racers_giveup = 8/2 swimmers_remaining = swimmers_original - racers_giveup result = swimmers_remaining return result
Liam is a skier. He traveled downhill 500 meters straight toward the finish line, and on his second turn, he traveled half as far as his first turn, but he finished 20 meters over the finish line. On his third turn, he skied to the finish line and crossed it. What is the distance, in meters, from the starting point to ...
def solve() -> int: first_turn = 500 second_turn = first_turn / 2 third_turn = 20 total_distance = first_turn + second_turn + third_turn result = total_distance return result
A bank offers 5% interest per year on savings accounts. How much interest will you earn on a $5000 savings account after 3 years?
def solve() -> int: interest_rate = 0.05 principal = 5000 time_in_years = 3 interest_earned = principal * (1 + interest_rate) ** time_in_years - principal result = interest_earned return result
Student: The length of a rectangle is 4 centimeters more than twice its width. If the perimeter of the rectangle is 24 centimeters, what is the length of the rectangle?
def solve() -> int: length = 0 width = 0 perimeter = 24 length = 2*width + 4 width = 5 length = 2*width + 4 length = 14 result = length return result
Liam went to a bakery that offered a deal to buy two cakes. The store offered to sell one cake at full price and give the second cake for half off the full price. If Liam bought two cakes for a full price of $30 each, what was the total price he paid?
def solve() -> int: cake_price = 30 discounted_cake_price = cake_price / 2 total_price = cake_price + discounted_cake_price result = total_price return result
If a machine can fill 30 eight gallon water tanks (each tank to full capacity) in 4 hours, how long, in hours, will it take to fill 35 tanks?
def solve() -> int: x = 30/4 result = 35/x return result
A rectangular field is 50 meters long and 30 meters wide. If a sack of seeds can be used for 60 square meters of land, how many sacks of seeds does the farmer need to use for the field?
def solve() -> int: field_length = 50 field_width = 30 field_area = field_length * field_width seed_coverage = 60 num_of_sacks = field_area / seed_coverage result = num_of_sacks return result
The average height of a class of 30 students is 160 cm. Later on, it was found that the height of one of the student was wrongly written as 170 cm instead of 140 cm. Find the correct average height.
def solve() -> int: total_students = 30 original_sum = total_students * 160 correct_sum = original_sum - 170 + 140 correct_avg = correct_sum / total_students result = correct_avg return result
ome possible questions and programs are: Jacob earned $40 from mowing lawns in July, $25 from selling lemonade in August, and $15 from babysitting in September. Jacob's dad said that if Jacob earned more than $60 in total, he would match his earnings. Then Jacob spent $55 on a skateboard. How much money did Jacob have ...
def solve() -> int: earnings = 40 + 25 + 15 if earnings > 60: earnings = earnings + earnings else: earnings = earnings result = earnings - 55 return result
In a marathon, the first runner finished in 2 hours 35 minutes and 10 seconds. The second runner finished in 3 hours 20 minutes and 15 seconds. What was the time difference between the two runners?
def solve() -> int: first_runner_time = (2*60 + 35)*60 + 10 second_runner_time = (3*60 + 20)*60 + 15 time_diff = second_runner_time - first_runner_time result = time_diff return result
Ashley wants to go for a hike in the morning. It takes her 30 minutes to drive to the trailhead and the hike takes 4 hours to complete. After the hike, it takes her 20 minutes to drive to her favorite coffee shop. If she wants to be at work by 1 pm and it’s a 45 minute commute, what time does she need to start the hike...
def solve() -> int: commute_time = 0.75 drive_to_trailhead_time = 0.5 hike_time = 4 drive_to_coffee_shop_time = 0.33 finish_time = 13 total_time = commute_time + drive_to_trailhead_time + hike_time + drive_to_coffee_shop_time start_time = finish_time - total_time ...
Zeke has 8 pencils, each pencil costing 45 cents. If he buys 4 more pencils, calculate the total cost for the pencils Zeke has?
def solve() -> int: pencils_initial = 8 pencils_bought = 4 cost_unit =.45 cost_initial = pencils_initial * cost_unit cost_bought = pencils_bought * cost_unit cost_total = cost_initial + cost_bought result = cost_total return result
Jamie saved $72 from her allowance. If Sarah saved $30 more than three times Jamie's savings, how much did Sarah save?
def solve() -> int: jamie_savings = 72 sarah_savings = 3 * jamie_savings + 30 result = sarah_savings return result
Student: Matthew runs a store and sells bananas. On the first day, he bought 10 bananas. After selling 5 bananas for the subsequent 9 days, how many bananas are left with Matthew?
def solve() -> int: bananas_bought = 10 bananas_sold = 5 days = 9 total_bananas_sold = bananas_sold * days bananas_left = bananas_bought - total_bananas_sold result = bananas_left return result
-Maria is baking a cake that needs 4 eggs, 2 cups of flour, and 1 cup of sugar. She has 6 eggs, 3 cups of flour, and 2 cups of sugar. How many cakes can she make with the ingredients she has?
def solve() -> int: cakes_with_eggs = 6 // 4 cakes_with_flour = 3 // 2 cakes_with_sugar = 2 // 1 result = min(cakes_with_eggs, cakes_with_flour, cakes_with_sugar) return result
A pizza costs $10. If John and his friends share the cost equally and John paid for 3 pizzas, how much did each person pay?
def solve() -> int: total_pizza_cost = 10 * 3 number_of_people = 4 split_pizza_cost = total_pizza_cost/number_of_people result = split_pizza_cost return result
Student: Sharon has 6 cans of soda, 3/4 of which are for lemon-lime and the rest are for root-beer. How many cans of root-beer does Sharon have?
def solve() -> int: cans_of_soda = 6 lemon_lime_ratio = 3/4 root_beer_ratio = 1 - lemon_lime_ratio cans_of_root_beer = root_beer_ratio * cans_of_soda result = cans_of_root_beer return result
A box contains 14 red balls and 21 blue balls. If you pick one ball at random, then what is the probability that it will be a red ball?
def solve() -> int: num_red_balls = 14 num_blue_balls = 21 total_balls = num_red_balls + num_blue_balls probability_red = num_red_balls / total_balls result = probability_red return result
There were 1000 visitors to a store in October, the number of visitors increased by 12% in November and 21% in December. How many visitors did the store have in total for the three months?
def solve() -> int: visitors_oct = 1000 percent_increase_nov = 0.12 percent_increase_dec = 0.21 visitors_nov = visitors_oct * (1 + percent_increase_nov) visitors_dec = visitors_nov * (1 + percent_increase_dec) total_visitors = visitors_oct + visitors_nov + visitors_dec result ...
The product of two numbers is 24. The first number is 2 less than the second number. What are the two numbers?
def solve() -> int: product = 24 first_number = 0 second_number = 0 second_number = 6 first_number = second_number - 2 first_number = 4 second_number = 6 result = first_number, second_number return result
Joe was buying 7 items with a variety of prices. The original prices were $50, $100, $150, $170, $200, $250 and $280. If he received 15% discount on all the items, how much did he save?
def solve() -> int: original_price1 = 50 original_price2 = 100 original_price3 = 150 original_price4 = 170 original_price5 = 200 original_price6 = 250 original_price7 = 280 discount = 0.15 saved_amount = (original_price1 + original_price2 + original_price3 + original_price4 + origina...
Kevin's bike can travel twice as far as Maria's bike can travel, and Maria's bike can travel 30 kilometers. How far can Kevin's bike travel?
def solve() -> int: maria_distance = 30 kevin_distance = maria_distance * 2 result = kevin_distance return result
Student: A student has an average score of 78 in a class. If he scores 90 on the next test, what will be his new average?
def solve() -> int: old_average = 78 new_score = 90 total_score = old_average * 2 + new_score new_average = total_score / 3 result = new_average return result
Teresa took 8 apples and 5 oranges to school. She gives each of her 5 classmates 2 apples and 1 orange. How many apples and oranges does she have left?
def solve() -> int: apples = 8 oranges = 5 classmates = 5 apples_each = 2 oranges_each = 1 apples_used = apples_each*classmates oranges_used = oranges_each*classmates apples_left = apples - apples_used oranges_left = oranges - oranges_used result = (apples_lef...
Olivia is making earrings for her best friend's wedding. Each earring requires five times as many small beads as it does large beads. If each earring uses 14 large beads, and Olivia has 2240 beads with equal amounts of large and small beads, how many earrings can she make?
def solve() -> int: large_beads_per_earring = 14 small_beads_per_earring = 5 * large_beads_per_earring total_beads = 2240 total_large_beads = total_beads / 2 total_small_beads = total_beads / 2 earrings = total_large_beads / large_beads_per_earring result = earrings return...
A company has 200 employees. If 25% of them work from home, how many employees work from home?
def solve() -> int: total_employees = 200 work_from_home = total_employees * 0.25 result = work_from_home return result
Alice and Bob are making bracelets with beads. Alice has 120 red beads and 80 blue beads. Bob has 100 red beads and 60 blue beads. They want to make bracelets that have the same number of red and blue beads. How many bracelets can they make?
def solve() -> int: min_red = min(120, 100) min_blue = min(80, 60) beads_per_bracelet = min_red // 2 bracelets = (120 + 80 + 100 + 60) // beads_per_bracelet result = f'They can make {bracelets} bracelets.' return result
Adam had a coupon that was worth 10% off his purchase. He spent $45 at the store. How much money did he save?
def solve() -> int: discount_percent = float(10) cost = float(45) savings = (discount_percent/100) * cost result = savings return result
Student: John has a bag containing 5 blue marbles and 3 red marbles. He randomly picks one marble from the bag. What is the probability that he will pick a blue marble?
def solve() -> int: num_blue = 5 num_red = 3 total_marbles = num_blue + num_red prob_blue = num_blue / total_marbles result = prob_blue return result
Tim is ordering pizza for his friends. A large pizza costs $15 and a small pizza costs $10. He wants to order enough pizza so that each of his 10 friends can have 2 slices of pizza. A large pizza has 8 slices and a small pizza has 6 slices. How many pizzas should he order?
def solve() -> int: large_pizza_cost = 15 small_pizza_cost = 10 friends = 10 slices_per_friend = 2 large_slices = 8 small_slices = 6 total_slices_needed = friends * slices_per_friend large_slices_needed = total_slices_needed // large_slices small_slices_needed = (total_slices_needed ...
A circle has a radius of 4 cm. What is the circumference of the circle?
def solve() -> int: circumference = 2 * 3.14 * 4 result = circumference return result
``` If James can run 5 miles in 30 minutes, how many miles can he run in 1 hour?
def solve() -> int: speed = 5/0.5 distance = speed * 1 result = distance return result
The board is 60 inches in length. If Aria wants to extend it by 7 inches on each side, what is the new length of the board?
def solve() -> int: board_length = 60 extension_length = 7 new_length = board_length + (2 * extension_length) result = new_length return result
Justin and Angela want to watch a movie, they bought 6 bags of popcorn and 4 drinks. Each bag of popcorn contains 10 pieces and each drink contains 8 pieces. How many pieces do Justin and Angela have in total?
def solve() -> int: total_pieces = 6 * 10 + 4 * 8 result = total_pieces return result
A coffee shop sold 100 cups of coffee every day for the first week and 150 cups of coffee every day for the remaining weeks of the month. How many cups of coffee did the shop sell throughout the month?
def solve() -> int: cups_first_week = 100 * 7 cups_remaining_weeks = 150 * 3 * 7 total_cups_sold = cups_first_week + cups_remaining_weeks result = total_cups_sold return result
David needs to replace the roof on his house. The roof has a length of 20 feet by 15 feet, and the overhang is 2 feet. How many square feet of shingles does David need to buy?
def solve() -> int: length = 20 width = 15 overhang = 2 total_length = length + (2 * overhang) total_width = width + (2 * overhang) roof_area = total_length * total_width shingle_area = 1.5 * 1 num_shingles = roof_area / shingle_area result = num_shingles ...
A toy store needs to order batteries for the toys they are selling. Each toy requires 3 batteries and there are 45 toys. Batteries are sold in packs of 12. How many packs of batteries will the store need to order?
def solve() -> int: toys = 45 batteries_per_toy = 3 batteries_per_pack = 12 total_batteries_needed = toys * batteries_per_toy packs_needed = total_batteries_needed // batteries_per_pack if total_batteries_needed % batteries_per_pack!= 0: packs_needed += 1 result = packs_needed re...
Student: A flower bed measures 6 meters in length and 4 meters in width. If you want to plant 10 flowers per square meter, how many flowers will you need to fill the entire bed?
def solve() -> int: length = 6 width = 4 area = length * width flowers_per_sqm = 10 total_flowers = area * flowers_per_sqm result = total_flowers return result
Tyler scored 6 more points than Sarah did. Noah scored half as many points as Tyler did. If Sarah scored 9 points, how many points did Noah score?
def solve() -> int: sarah_score = 9 tyler_score = sarah_score + 6 noah_score = tyler_score / 2 result = noah_score return result
A car travels 60 miles per hour. If it travels for 2.5 hours, how far does it travel?
def solve() -> int: speed = 60 time = 2.5 distance = speed*time result = distance return result
The number of chess pieces in a standard game of chess is twice the number of a regular checkers game. There are 12 pieces in a regular checkers game. How many pieces are there in a chess game?
def solve() -> int: result = 0 pieces = 0 pieces = 12 * 2 result = pieces return result
Jacob has 5 times as many pencils as Emily. Emily has 3 pencils. How many pencils does Jacob have?
def solve() -> int: n_emily_pencils = 3 n_jacob_pencils = 5*n_emily_pencils result = n_jacob_pencils return result
John has 7 tanks. The first tank is 5/6 of its capacity full, the second tank is 4/5 full, the third tank is 6/7 full, the fourth tank is 7/15 full, the fifth tank is 4/9 full, the sixth tank is 8/11 full, and the seventh tank is 3/7 full. How many gallons in total are there in all the tanks?
def solve() -> int: tank_one = 0.83 tank_two = 0.8 tank_three = 0.86 tank_four = 0.467 tank_five = 0.444 tank_six = 0.727 tank_seven = 0.42 total_volume = tank_one + tank_two + tank_three + tank_four + tank_five + tank_six + tank_seven result = 4.411 retu...
Student: 7. Tom bought 20 cans of candy. Each can contained 15 candy. He distributed 40% of the candy to his kids and one-third of the remaining to his cousins. How much candy were left for Tom?
def solve() -> int: cans = 20 candies_per_can = 15 candies_to_kids = cans * candies_per_can * 0.4 candies_to_cousins = (cans * candies_per_can - candies_to_kids) * (1/3) result = cans * candies_per_can - candies_to_kids - candies_to_cousins return result
If Robert walks 3 kilometers in 30 minutes, how many minutes does he need to walk 10 kilometers?
def solve() -> int: kilometers_30_min = 3 total_kilometers = 10 minutes_needed = (total_kilometers/kilometers_30_min)*30 result = minutes_needed return result
Liz had 93 toys at the start of the week. She gave away 6 toys every day for five days. How many toys did Liz have at the end of the week?
def solve() -> int: start = 93 toys_taken_day_1 = 6 toys_taken_day_2= 6 toys_taken_day_3 = 6 toys_taken_day_4 = 6 toys_taken_day_5 = 6 total_taken = toys_taken_day_1 + toys_taken_day_2+toys_taken_day_3+toys_taken_day_4+toys_taken_day_5 result = start - total_taken return result
A truck can carry 800 kg of vegetables. It had 550 kg of corn on it. If 70% of the remaining weight is filled with tomatoes, how many kilograms of tomatoes can it carry?
def solve() -> int: weight_capacity = 800 current_weight = 550 remaining_weight = weight_capacity - current_weight tomato_weight = remaining_weight * 0.7 result = tomato_weight return result
A bike shop sells 3 types of bikes. A road bike costs $800, a mountain bike costs $550, and a hybrid bike costs $650. If the shop sells 10 road bikes, 8 mountain bikes, and 12 hybrid bikes in a week, what is the total revenue?
def solve() -> int: road_bike_price = 800 mountain_bike_price = 550 hybrid_bike_price = 650 num_of_road_bikes = 10 num_of_mountain_bikes = 8 num_of_hybrid_bikes = 12 total_revenue = road_bike_price*num_of_road_bikes + mountain_bike_price*num_of_mountain_bikes + hybrid_bike_price*num_of_hybri...
A school is collecting for a food drive and collected 100 cans of soup in a week. Each teacher is challenged to collect 10 times more the following week. How many cans of soup will the school as a whole collect at the end of two weeks?
def solve() -> int: cans_week1 = 100 cans_week2 = cans_week1 * 10 total_cans = cans_week1 + cans_week2 result = total_cans return result
A bakery sells cupcakes in boxes of 12. How many boxes do you need to buy to have 100 cupcakes?
def solve() -> int: cupcakes_needed = 100 cupcakes_per_box = 12 num_boxes = cupcakes_needed // cupcakes_per_box + int(cupcakes_needed % cupcakes_per_box!= 0) result = num_boxes return result
Possible questions and programs: Alice likes to bike to the park and swim in the lake. It takes her 15 minutes to bike to the park at a speed of 12 MPH. She swims for 30 minutes at a speed of 2 MPH. Then she bikes back home at the same speed. How far does she swim in miles? How far does she bike in total in miles? What...
def solve() -> int: swim_time = 30 / 60 swim_distance = swim_time * 2 bike_time = 15 / 60 bike_distance = bike_time * 12 total_bike_distance = bike_distance * 2 total_distance = swim_distance + total_bike_distance total_time = swim_time + bike_time * 2 average_speed = total_distanc...
Student: Millie, Monica, and Marius are each buying items for a party. Millie bought 5 more items than Monica, and Marius bought 3 times as many items as Monica. If Monica bought 11 items, how many items did they all buy together?
def solve() -> int: monica_items = 11 millie_items = monica_items + 5 marius_items = monica_items * 3 total_items = monica_items + millie_items + marius_items result = total_items return result
Joe has a 6 liter jug of juice. If he pours a half a liter into a 4 liter jug, how much juice is left in the 6 liter jug?
def solve() -> int: jug_6_liters = 6 jug_4_liters = 4 pour_amount = 0.5 jug_6_liters_remaining = jug_6_liters - pour_amount remaining_juice = jug_6_liters_remaining + jug_4_liters result = remaining_juice return result
John has seven pencils and four pens. If he buys three times as many markers as pens, then loses one pencil, how many writing instruments does he have left?
def solve() -> int: pencils = 7 pens = 4 markers = 3 * pens pencils -= 1 writing_instruments = pencils + pens + markers result = writing_instruments return result
Karen is baking cookies and can bake 18 cookies in one batch. If she has 4 batches, how many total cookies will she have?
def solve() -> int: batch1 = 18 batch2 = 18 batch3 = 18 batch4 = 18 total_cookies = batch1 + batch2 + batch3 + batch4 result = total_cookies return result
Karen had 698 pieces of candy, but she gave away 32. How many pieces of candy does Karen have now?
def solve() -> int: candy_orig = 698 candy_given_away = 32 candy_left = candy_orig - candy_given_away result = candy_left return result
Student: Amelia is buying ice cream for her classmates. She buys 6 tubs for the 5 classmates. How much ice cream does each classmate receive?
def solve() -> int: tubs = 6 classmates = 5 ice_cream = 4 total_ice_cream = tubs * ice_cream ice_cream_per_classmate = total_ice_cream / classmates result = ice_cream_per_classmate return result
A gym membership costs $40 a month, with a $50 initiation fee. If Joe pays $20 a month extra to take a yoga class, how much will he spend on his first year at the gym if he pays monthly?
def solve() -> int: total_cost = (40 + 20) * 12 + 50 result = total_cost return result
A box contains 55 apples and 36 oranges. If 15% of apples are rotten and 25% of oranges are rotten, how many fruits are still fresh?
def solve() -> int: apples = 55 oranges = 36 rotten_apples_percent = 15 rotten_oranges_percent = 25 rotten_apples = (rotten_apples_percent / 100) * apples rotten_oranges = (rotten_oranges_percent / 100) * oranges fresh_fruits = apples + oranges - (rotten_apples + rotten_oranges) ...
A box contains 250 candies. If 3/5 of them were eaten, how many candies are left?
def solve() -> int: initial_candies = 250 eaten_candies = initial_candies * 3/5 leftover_candies = initial_candies - eaten_candies result = leftover_candies return result
Student: Michael wants to invest his money. He invests $1000 at an annual interest rate of 5% for 5 years. How much money will he have after 5 years?
def solve() -> int: principal = 1000 interest_rate = 0.05 time = 5 amount = principal * (1 + interest_rate) ** time result = amount return result
Student: Jake had 24 marbles in his collection. He traded 6 marbles with his friend for 4 new marbles. He then lost 2 marbles while playing with them. He finally found 3 marbles that he had misplaced earlier. How many marbles did Jake have at the end?
def solve() -> int: marbles = 24 marbles = marbles - 6 + 4 marbles = marbles - 2 marbles = marbles + 3 result = marbles return result
Jake ran a kilometer in 4 minutes. Calculate the speed he was running in miles per hour.
def solve() -> int: rate_mpm = 16.67 distance_km = 1 time_min = 4 rate_mph = rate_mpm * time_min distance_mi = distance_km * 0.621371 speed_mph = distance_mi/time_min * rate_mpm result = speed_mph return result
A gym had 100 members two years ago. If the membership has doubled and is expected to increase by 20% after one year, how many members will the gym have in one year?
def solve() -> int: members_two_years_ago = 100 doubled_members = members_two_years_ago * 2 increased_members = doubled_members + (doubled_members * 0.2) result = increased_members return result
In a grocery bag of 90 vegetables, one-fourth were carrots. If 1/6 of the carrots were spoiled and 1/8 of the broccoli was spoiled, how many vegetables were not spoiled in total?
def solve() -> int: total_vegetables = 90 carrots = total_vegetables / 4 spoiled_carrots = carrots / 6 broccoli = total_vegetables - carrots spoiled_broccoli = broccoli / 8 not_spoiled_vegetables = total_vegetables - (spoiled_carrots + spoiled_broccoli) result = not_spoiled_vegetables re...
A family of four goes to a theme park where admission costs $35 per person. If they go to the park 4 times in a year, how much do they spend on admission in a year?
def solve() -> int: admission_cost = 35 people_in_group = 4 times_visited_per_year = 4 total_spent_on_admission = admission_cost * people_in_group * times_visited_per_year result = total_spent_on_admission return result
Clara has a jar of 120 candies. She gives away 20% of them to her friends and eats 10% of the remaining candies. How many candies does she have left in the jar?
def solve() -> int: given = 120 * 0.2 left = 120 - given eaten = left * 0.1 left = left - eaten result = int(left) return result
Alex deposited $1000 in a bank account that pays 5% simple interest per year. How much interest will he earn after 3 years?
def solve() -> int: interest = 1000*0.05*3 result = interest return result
In a bookstore, Chloe sold books worth $720 in four days. If one book costs $6, how many books on average did she sell per day?
def solve() -> int: books_sold = 720 / 6 average_books_sold_per_day = books_sold / 4 result = average_books_sold_per_day return result
Harold collects stamps. He wants to make sure his stamps are safe from damage. Each stamp album can hold 50 stamps. If he has 275 stamps, how many stamp albums does he need?
def solve() -> int: stamps_per_album = 50 total_stamps = 275 albums_needed = total_stamps // stamps_per_album result = albums_needed return result
Myron needs to purchase at least 10 potted plants for his garden. He spends $5 on the first plant and twice as much as he did on the prior plant for each consecutive plant he buys. How much did he spend in total?
def solve() -> int: initial_price = 5 total_cost = 0 for i in range(10): total_cost = total_cost + initial_price initial_price = initial_price * 2 result = total_cost return result
Fahad loves to run, he runs 5 km every Monday, Wednesday, and Friday. How many km does he run in one month?
def solve() -> int: distance_per_week = 5 * 3 distance_per_month = distance_per_week * 4 result = distance_per_month return result
A new restaurant makes $50,000 in revenue in its first week. It eventually makes 5 times that much over its lifetime. If the owners keep 80% of the revenue and the startup cost was $30,000, how much profit do they earn?
def solve() -> int: revenue_first_week = 50000 revenue_lifetime = revenue_first_week * 5 startup_cost = 30000 revenue_after_startup = revenue_lifetime - startup_cost profit = revenue_after_startup * 0.8 result = profit return result
At 25, Sarah is 3/2 the age of Emily. What would be their combined age in 10 years?
def solve() -> int: sarah_age = 25 emily_age = sarah_age * 2 / 3 combined_age = sarah_age + emily_age combined_age_in_10_years = combined_age + 20 result = combined_age_in_10_years return result
A store sells 45 apples every day. On Monday, they sold 20 more apples than on Tuesday. On Tuesday, they sold 15 fewer apples than on Wednesday. How many apples did they sell on Wednesday?
def solve() -> int: num_apples_Monday = 45 + 20 num_apples_Tuesday = num_apples_Monday - 15 num_apples_Wednesday = num_apples_Tuesday + 15 result = num_apples_Wednesday return result
If Rebecca runs 6 miles a day, how many miles will she run in 18 days?
def solve() -> int: miles_run_each_day = 6 total_days = 18 total_miles_run = miles_run_each_day * total_days result = total_miles_run return result
David bought a phone for $500, which is 25% less than what his sister bought the same phone for. How much did his sister pay for her phone?
def solve() -> int: price_of_david_phone = 500 discount_percentage = 25 price_of_sister_phone = price_of_david_phone / (1 - discount_percentage/100) result = price_of_sister_phone return result
Noah is making a soup. He takes a pot that holds 3 liters and fills it 2/9ths with broth, 1/9th with cream and 6/9ths with vegetables. The broth has 0.5 g of salt per 100 ml, the cream has 0.1 g of salt per 100 ml and the vegetables have no salt. How many grams of salt are in the soup?
def solve() -> int: broth = 3 * 0.22 * 1000 cream = 3 * 0.11 * 1000 vegetables = 3 * 0.67 * 1000 broth_salt = broth * 0.005 cream_salt = cream * 0.001 salt = broth_salt + cream_salt result = salt return result
Mark is making a cake that uses 4 cups of flour and 6 cups of sugar. How many cups of ingredients in total does he need?
def solve() -> int: flour_cups = 4 sugar_cups = 6 result = flour_cups + sugar_cups return result
Mr. Chen bought a new car for $25,000. After driving it for a few years, he wants to sell it. The car's value depreciates by 20% every year. How much would the car be worth after 3 years?
def solve() -> int: car_value = 25000 depreciation_rate = 0.2 number_of_years = 3 car_value_after_3_years = car_value * (1-depreciation_rate)**number_of_years result = car_value_after_3_years return result
A rectangular garden has a length of 20 meters and a perimeter of 60 meters. What is the width of the garden?
def solve() -> int: width = (60 - 20 * 2) / 2 result = width return result
Gina starts by saving 10 dollars this week and plans to increase her savings by 2 dollars every week. How much money will she have saved in a month?
def solve() -> int: initial_savings = 10 increase_per_week = 2 total_savings = initial_savings + (increase_per_week * 4) result = total_savings return result
Brian wants to buy a new television for $600. He also wants to purchase a soundbar that costs 1/5 the price of the television. Additionally, he wants to buy a TV stand for 1/10 the price of the television. How much will Brian spend in total?
def solve() -> int: television_cost = 600 soundbar_cost = 1/5 * television_cost stand_cost = 1/10 * television_cost total_cost = television_cost + soundbar_cost + stand_cost result = total_cost return result