question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: Ben needs to buy paper for an art project. He spends $30 for 3 packs of 140 sheets each and $25 for 2 packs of 156 sheets each. If each pack costs the same amount, how much did each pack cost?
def solve() -> int: cost_30 = 30 cost_25 = 25 packs_30 = 3 packs_25 = 2 sheets_30 = 140 sheets_25 = 156 total_sheets = (packs_30 * sheets_30) + (packs_25 * sheets_25) total_cost = cost_30 + cost_25 cost_per_pack = total_cost / total_sheets result = cost_per_pack return resul...
-Avoid repeating numbers or scenarios. Try to use different numbers and contexts in each question. Possible questions and programs: There are 16 cupcakes on Lisa's tray, each with 4 sprinkles. On Tim's tray, there are 12 cupcakes, each with 3 times as many sprinkles as on Lisa's tray. What is the combined total number ...
def solve() -> int: lisa_cupcakes = 16 lisa_sprinkles = 4 total_lisa = lisa_cupcakes + lisa_cupcakes * lisa_sprinkles tim_cupcakes = 12 tim_sprinkles = 3 * lisa_sprinkles total_tim = tim_cupcakes + tim_cupcakes * tim_sprinkles total = total_lisa + total_tim result = total ret...
A football team has 21 players. 3 players get injured and have to leave the field. How many players are left on the field?
def solve() -> int: team_players = 21 team_players = team_players - 3 result = team_players return result
A car can travel 35 miles per gallon (mpg). If the car has a 15-gallon gas tank, how far can the car travel without refueling?
def solve() -> int: mpg = 35 gas_tank = 15 distance = mpg * gas_tank result = distance return result
A bus travels 240 km in 6 hours. What is its average speed in km/hr?
def solve() -> int: distance = 240 time = 6 average_speed = distance / time result = average_speed return result
Ben had 36 crayons. He broke 6 crayons and threw them away. He lost 5 crayons on his way to school. He found 3 crayons in his backpack. He borrowed 4 crayons from his teacher. How many crayons does Ben have at the end of the day?
def solve() -> int: crayons = 36 - 6 - 5 crayons = crayons + 3 + 4 result = crayons return result
Emily is planning a trip and wants to book a hotel room for $120 per night. She also wants to rent a car for $30 a day. She sees an advertisement for 20% off rooms and 15% off car rentals. How much money can Emily save on her trip if she books her hotel and car rental during the promotional period?
def solve() -> int: hotel_price = 120 car_rental_price = 30 hotel_discount = 0.2 car_rental_discount = 0.15 hotel_savings = hotel_price * hotel_discount car_rental_savings = car_rental_price * car_rental_discount total_savings = hotel_savings + car_rental_savings resu...
David rents a car for $40 per day plus $0.25 per mile. He drives the car for 5 days and travels 300 miles. He also pays a $20 deposit that is refunded if the car is returned in good condition. He returns the car with a scratch that costs $50 to fix. How much does he pay for the car rental?
def solve() -> int: daily_charge = 40 * 5 mileage_charge = 0.25 * 300 total_charge = daily_charge + mileage_charge final_charge = total_charge - 20 + 50 result = final_charge return result
Three friends decided to split a pizza that they ordered. If the pizza has 12 slices, how many slices will each person get?
def solve() -> int: pizza_slices = 12 people = 3 slices_per_person = pizza_slices / people result = slices_per_person return result
Student: A company needs to manufacture 7500 pencils. Each box can only hold 50 pencils. How many boxes are needed to store the pencils?
def solve() -> int: pencils = 7500 box_capacity = 50 from math import ceil boxes = ceil(pencils / box_capacity) result = boxes return result
Anna works as a cashier and earns $9 per hour. She works for 5 hours on Monday, 4 hours on Tuesday, 6 hours on Wednesday, 3 hours on Thursday, and 5 hours on Friday. She also gets a $50 bonus for working more than 20 hours in a week. How much money does she earn in a week?
def solve() -> int: hours = 5 + 4 + 6 + 3 + 5 wage = 9 * hours if hours > 20: bonus = 50 else: bonus = 0 income = wage + bonus result = income return result
Ms. Davis's shoe store has 200 pairs of shoes remaining after the previous day's sales. Thirteen customers came into the store, and each bought 7 pairs of shoes. How many pairs of shoes remain in the store?
def solve() -> int: remaining_shoes = 200 customers = 13 shoes_bought_per_customer = 7 total_shoes_bought = customers * shoes_bought_per_customer remaining_shoes -= total_shoes_bought result = remaining_shoes return result
A hotel has 120 rooms. If each room has a maximum capacity of 4 people, how many people can the hotel accommodate at full capacity?
def solve() -> int: rooms = 120 capacity = 4 max_people = rooms * capacity result = max_people return result
There are 200 flowers in a garden, and three-fourths of them are roses. How many flowers are not roses?
def solve() -> int: total_flowers = 200 roses = total_flowers * (3/4) not_roses = total_flowers - roses result = not_roses return result
Will is a plumber who has a rate of 6 cents per minute for his services. If he works for 2 hours on each job, how much will he make after fixing 25 plumbing problems a week?
def solve() -> int: rate_per_minute = 0.06 hours_per_job = 2 minutes_per_hour = 60 problems_per_week = 25 minutes_per_job = hours_per_job * minutes_per_hour total_minutes = minutes_per_job * problems_per_week total_earnings = rate_per_minute * total_minutes result = total_earni...
A group of friends went to a restaurant and the bill cost $127. If they decide to split the bill evenly between 7 people and leave a 20% tip, how much does each person have to pay?
def solve() -> int: bill_total = 127 people = 7 tip_percentage = 0.2 tip = bill_total * tip_percentage total_bill = bill_total + tip per_person = total_bill / people result = per_person return result
A pizza is cut into 10 slices. If 3 people eat the pizza and each person eats 2 slices, how many slices are left?
def solve() -> int: slices = 10 people = 3 eaten = people * 2 left = slices - eaten result = left return result
If Daniel can ride his bike at 6 mph for 3 miles, and then at 9 mph for 4 miles, how many total minutes will it take him to complete the journey?
def solve() -> int: slow_speed = 6 fast_speed = 9 distance_slow = 3 distance_fast = 4 time_slow = distance_slow/slow_speed time_fast = distance_fast/fast_speed total_time = time_slow + time_fast result = total_time * 60 return result
A group of 30 tourists are sharing a box of chocolates. Each of them had 2 pieces, but there was still a quarter of the original amount left. How many chocolates were in the box?
def solve() -> int: total_tourists = 30 pieces_per_tourist = 2 remaining_pieces = pieces_per_tourist * total_tourists - (pieces_per_tourist * total_tourists) / 4 result = remaining_pieces / (1 - 1/4) return result
Student: John is planning to renovate his bedroom and decides to buy a designer dresser that costs $700. To complement the dresser he also buys a rug costing $350 and a lamp that costs $150. The store is offering a 30% discount on the total bill. How much money will John save in the end?
def solve() -> int: dresser_cost = 700 rug_cost = 350 lamp_cost = 150 discount_percentage = 0.3 total_cost = dresser_cost + rug_cost + lamp_cost discount_amount = total_cost * discount_percentage final_cost = total_cost - discount_amount result = total_cost - final_cost return resul...
Ginny bought a shirt that costs $20.99 with a discount of 15%. How much did she save?
def solve() -> int: original_price = 20.99/(1-0.15) discounted_price = 20.99 savings = original_price - discounted_price result = savings return result
If the movie theater is open from 1 pm to 10 pm on weekdays and 11 am to 11 pm on weekends, how many hours per week is the theater open? Sarah and Tom are playing a board game. They must roll 2 dice at the same time and move the number of spaces equal to the sum of the two dice. Sarah started and rolled a 3 and a 6. On...
def solve() -> int: weekday_hours = 10 - 1 weekend_hours = 11 - 11 + 12 total_hours = weekday_hours * 5 + weekend_hours * 2 sarah_spaces = 3 + 6 tom_spaces = 2 + 5 spaces_ahead = sarah_spaces - tom_spaces + 1 result = spaces_ahead return result
Isabella likes to read. She asks for one book for every birthday and two for every Christmas. If Isabella has been doing this for 12 years and already has 60 books, how many books will she have at the end of the 12th year?
def solve() -> int: years = 12 books_per_birthday = 1 books_per_christmas = 2 total_books = 60 books_per_year = books_per_birthday + (books_per_christmas * 2) books_at_end = total_books + (books_per_year * years) result = books_at_end return result
Aidan, Ava and Amelia collected a total of 1500 seashells. Aidan has twice as many seashells as Ava, and Ava has three times the number of seashells Amelia has. How many seashells does Aidan have?
def solve() -> int: amelia_seashells = 0 ava_seashells = 0 aidan_seashells = 0 amelia_seashells = 1/7 * 1500 ava_seashells = 3 * amelia_seashells aidan_seashells = 2 * ava_seashells result = aidan_seashells return result
David was collecting books to donate to the library. He had already gathered 25 books and his sister gave him 14 more. His friend came over and gave him half the number of books that his sister gave him. When his cousin came over, they gave David 3 more than three times the number of books he started with. How many boo...
def solve() -> int: books_start = 25 books_sister = 14 books_friend = books_sister / 2 books_cousin = 3 * books_start + 3 total_books = books_start + books_sister + books_friend + books_cousin result = total_books return result
A recipe calls for 2 3/4 cups of flour. If the cook only has 4/5 of the flour, how many cups does the cook still need to obtain?
def solve() -> int: needed_flour = 2 + 3/4 available_flour = needed_flour * 4/5 needed_flour = needed_flour - available_flour result = needed_flour return result
Zoe prepared a salad that serves eight people. She added one-half cup of ranch dressing. Ranch dressing has 145 calories per two tablespoons. How many calories were added to each serving of salad?
def solve() -> int: num_people = 8 ranch_dressing = 0.5 calories_per_2tbsp = 145 ranch_tbsp = ranch_dressing * 16 total_calories = (ranch_tbsp / 2) * calories_per_2tbsp calories_per_serving = total_calories / num_people result = calories_per_serving ...
**** On the farm, there are 4 rows of animals: 6 donkeys, 5 cows, 7 pigs, and 3 horses. How many animals are there in total?
def solve() -> int: donkeys = 6 cows = 5 pigs = 7 horses = 3 total_animals = donkeys + cows + pigs + horses result = total_animals return result
The cost of a product is $40. If the price of the product is increased by 25%, what would be the new price?
def solve() -> int: current_price = 40 increase = 25 new_price = current_price + (current_price*(increase/100)) result = new_price return result
A square room measures 12 feet by 12 feet. If each square foot is covered by a 2 inch tile, how many tiles are needed to cover the entire floor?
def solve() -> int: length_of_room = 12 width_of_room = 12 area_of_room = length_of_room * width_of_room length_of_tile = 2 / 12 width_of_tile = 2 / 12 area_of_tile = length_of_tile * width_of_tile number_of_tiles = area_of_room / area_of_tile result = number_of_tiles ...
Student: If a bottle containing 2 liters of water is filled with sugar syrup, the total volume becomes 2.5 liters. What fraction of the mixture is sugar syrup?
def solve() -> int: water = 2 syrup = 0.5 mixture = 2.5 fraction = syrup / mixture result = fraction return result
John bikes 20 miles in 2 hours. What is his speed in miles per minute?
def solve() -> int: distance = 20 time = 2 * 60 speed = distance / time result = speed return result
Student: A wood board is 14 feet long. How many 3-inch pieces can be cut from the board without any waste?
def solve() -> int: board_length = 14 * 12 piece_length = 3 num_pieces = board_length // piece_length result = num_pieces return result
If a store offers their employees a $100 bonus for every 50 items sold in a week, and an employee sold 250 items this week, how much extra money will they make?
def solve() -> int: bonus_per_items = 100/50 num_items_sold = 250 total_bonus = bonus_per_items * (num_items_sold//50) result = total_bonus return result
Isaac needs to pay $400 for his language course. He is working a part-time job that pays him $50 per week. If he can save 20% of his income every week after paying for his personal expenses, how much does Isaac still need to earn assuming he only has 8 weeks to save up?
def solve() -> int: course_cost = 400 weekly_income = 50 num_weeks = 8 savings_rate = 0.2 total_income = weekly_income * num_weeks total_savings = total_income * savings_rate amount_left = course_cost - total_savings result = amount_left return resu...
Uncle Jacob has 5 sons and 4 daughters. If each son has 4 sons and each daughter has 3 daughters, how many grandchildren does he have in total?
def solve() -> int: num_sons = 5 num_daughters = 4 num_grandsons = num_sons * 4 num_granddaughters = num_daughters * 3 result = num_grandsons + num_granddaughters return result
How many oranges are there in a bowl that contains 17 oranges for every 3 apples?
def solve() -> int: num_oranges = 0 num_apples = 3 oranges_per_apple = 17 num_oranges = num_apples * oranges_per_apple result = num_oranges return result
Maria ran 3 miles every day for 5 days last week. This week, she increased her running distance by 50% and ran for 4 days. What is the total distance she ran this week compared to last week?
def solve() -> int: miles_per_day_last_week = 3 days_last_week = 5 miles_per_day_this_week = miles_per_day_last_week * 1.5 days_this_week = 4 total_distance_last_week = miles_per_day_last_week * days_last_week total_distance_this_week = miles_per_day_this_week * days_this_week dist...
A mail business charges $0.50 for the first 4 ounces and $0.20 for each additional ounce in the package. If a package weighs 12.5 ounces, what will be the cost?
def solve() -> int: cost = 0.50 + (12.5 - 4) * 0.20 if 12.5 > 4 else 0.50 result = f'<<<{cost}>>>' result = cost return result
Amy has 5 fewer guitars than Nick, if Amy has 19 guitars, how many guitars does Nick have?
def solve() -> int: guitars_Nick = 0 guitars_Nick = guitars_Nick + 19 guitars_Nick = guitars_Nick + 5 result = guitars_Nick return result
If Rachel invests $3000 in the stock market where 40% of the stocks are for technology, 20% are energy stocks, and 2/5 of the remaining in consumer goods stock, how much is left for healthcare stocks?
def solve() -> int: investment = 3000 technology_stocks = investment * 0.4 energy_stocks = investment * 0.2 remaining_stocks = investment - technology_stocks - energy_stocks consumer_goods_stocks = remaining_stocks * (2/5) healthcare_stocks = remaining_stocks - consumer_goods_stocks res...
Student: Mrs. Rodriguez has a budget of $200 to spend on books. If each book costs $10, how many books can she purchase with her budget?
def solve() -> int: budget = 200 book_price = 10 result = budget // book_price return result
A block of wood is 6 inches long, 2 inches wide, and 1 inch high. If you slice it into 24 equal pieces, what is the volume of each piece?
def solve() -> int: piece_volume = (6*2*1)/24 result = piece_volume return result
Bernie was buying snacks for a party. At the store, she purchased 2 bags of potato chips that cost $5 each and then 4 boxes of crackers that cost $3 each. What was the average cost of the items Bernie purchased?
def solve() -> int: snack1_price = 5 snack1_num = 2 snack2_price = 3 snack2_num = 4 total_price = (snack1_price*snack1_num)+(snack2_price*snack2_num) total_items = snack1_num + snack2_num avg_price = total_price / total_items result = avg_price return result
A movie theater sells tickets for $10 each. If Sarah buys 4 tickets and there is a 15% off sale and a 9% sales tax, how much does she pay?
def solve() -> int: tickets = 4 ticket_cost = 10 discount = 0.15 tax = 0.09 tickets_total = tickets * ticket_cost discounted_total = tickets_total - (tickets_total * discount) total_with_tax = discounted_total + (discounted_total * tax) result = total_with_tax return ...
A pound of almonds costs $8 while a pound of walnuts is $2 more. How much will 2 pounds of walnuts and 4 pounds of almonds cost?
def solve() -> int: almond_cost = 8 walnut_cost = almond_cost + 2 walnut_total_cost = 2 * walnut_cost almond_total_cost = 4 * almond_cost total_cost = walnut_total_cost + almond_total_cost result = total_cost return result
Peter wants to fence in his backyard with a square fence. The dimensions of his backyard are 25 feet by 25 feet. How much fencing will Peter need to buy?
def solve() -> int: length = 25 width = 25 total_fence = 2*(length + width) result = total_fence return result
Ethan is collecting stickers for his album. He buys a pack of 25 stickers every week. He also gets 10 stickers from his friends every month. He uses 15 stickers for his album every week. He loses 5 stickers every month. If he has 140 stickers left after 3 months, how many stickers did he start with?
def solve() -> int: stickers_per_pack = 25 packs_per_week = 1 stickers_from_friends = 10 stickers_for_album = 15 stickers_lost = 5 stickers_left = 140 weeks = 3 * 4 stickers_bought = stickers_per_pack * packs_per_week * weeks stickers_friends = stickers_from_friends * ...
A book has 12 chapters. The first three chapters have 25 pages each. The next five chapters have 40 pages each. The last four chapters have 20 pages each. How many pages does the book have in total?
def solve() -> int: chapter_count = 12 first_chapter_page = 25 next_chapter_page = 40 last_chapter_page = 20 total_pages = (first_chapter_page*3) + (next_chapter_page*5) + (last_chapter_page*4) result = total_pages return result
A shopkeeper sells a T-Shirt for the same price as a Sweatshirt, but the prices of T-Shirts and Sweatshirts are not the same. A customer bought 4 T-Shirts and 5 Sweatshirts for $200, then the customer decided to return 1 Sweatshirt. What is the price of one T-Shirt at this shop if the customer was refunded 10% of what ...
def solve() -> int: price_of_T_shirt = (200/9) price_of_sweatshirt = (200/9) price_paid_for_T_shirts = (4 * price_of_T_shirt) price_paid_for_sweatshirts = (5 * price_of_sweatshirt) price_refunded_for_sweatshirt = (1 * price_of_sweatshirt) total_price_paid = (price_paid_for_T_shirts + p...
Landon walked 54 miles last week. If he plans to walk 3 miles every day for this week, how much less miles will Landon walk?
def solve() -> int: last_week_distance = 54 daily_distance = 3 days_this_week = 7 total_distance_this_week = daily_distance * days_this_week less_miles = last_week_distance - total_distance_this_week result = less_miles return result
Rachel bought 4 packs of 8 crayons. She opened one of the packs and used 3 crayons. How many crayons does Rachel have left?
def solve() -> int: packs = 4 crayons = 8 used = 3 left = packs * crayons - used result = left return result
Phoebe wants to make sure her 15 guests have enough food to eat. If each person eats 1.5 pounds of food, how much food should she buy in total?
def solve() -> int: people = 15 food_per_person = 1.5 total_food = people * food_per_person result = total_food return result
A store had 140 shirts in stock. They sold 13 shirts on Monday and 27 shirts on Tuesday. How many shirts were left in stock?
def solve() -> int: shirts = 140 shirts -= 13 shirts -= 27 result = shirts return result
In ten years, Sophia will be twice as old as Nathan. If Sophia is currently 28 years old, and Eli, Sophia's cousin, is 2/3 of Nathan's current age, how old is Eli now?
def solve() -> int: sophia_current_age = 28 nathan_current_age = (sophia_current_age + 10) / 2 eli_current_age = (2/3) * nathan_current_age result = eli_current_age return result
Rachel went to get her hair dyed for a party. The hair salon asked her to pay $100 for the first dyeing job. After three months, Rachel went back to the salon to get her hair dyed again, but the salon asked for $120 this time. If Rachel dyed her hair a total of four times that year, how much did she end up paying for t...
def solve() -> int: first_dyeing_job = 100 second_dyeing_job = 120 total_dyeing_jobs = 4 total_cost = first_dyeing_job + second_dyeing_job + (total_dyeing_jobs - 2) * second_dyeing_job result = total_cost return result
Adam had some notebooks. He gave 9 of them away and then bought the same amount of notebooks. If Adam has 72 notebooks in total, how many notebooks did he have originally?
def solve() -> int: notebooks_total = 72 notebooks_given = 9 notebooks_bought = notebooks_given result = notebooks_total - notebooks_bought return result
Student: Alice starts climbing up a hill which has 75 steps. On the first day, she climbs up 5 steps. On the second day, she climbs up 10 steps, and on the third day, she climbs up 15 steps. If she continues to climb 5 more steps than the previous day, how many steps will she climb on the fifth day?
def solve() -> int: steps = 75 day_1 = 5 day_2 = 10 day_3 = 15 day_4 = day_3 + 5 day_5 = day_4 + 5 result = day_5 return result
In a race between two friends, Sam and Alex, Sam finished the race in 28 seconds, and Alex finished in 32 seconds. If the distance of the race was 80 meters, how many meters ahead of Alex was Sam when he finished the race?
def solve() -> int: sam_time = 28 alex_time = 32 distance = 80 sam_speed = distance / sam_time alex_speed = distance / alex_time time_difference = alex_time - sam_time distance_difference = sam_speed * time_difference result = distance_difference return result
At the beginning of the week, there are 10 chairs in a room. If the number of chairs doubles each day, how many chairs are in the room at the end of the week?
def solve() -> int: chairs = 10 for i in range(7): chairs *= 2 result = chairs return result
Sarah walked 1,000 steps for her morning exercise, did some burpees, then added some 800 more steps to her count for the first day. The next day, she walked half the number of steps she walked on the first day. And on the third day, Sarah walked an additional 300 steps. What's the total number of steps Sarah walked dur...
def solve() -> int: steps_day1 = 1000 steps_day2 = steps_day1 / 2 steps_day3 = steps_day2 + 300 total_steps = steps_day1 + steps_day2 + steps_day3 result = total_steps return result
Roger bought 9 items at a thrift store: a gray sweatshirt, a blue jeans, a pair of shoes, and a big sign that read, "Live every day as if it were your last". The sweatshirt cost twice as much as the jeans, but exactly one quarter of the price of both shoes. If the jeans cost $8, how much, in dollars, did a single shoe ...
def solve() -> int: jeans_cost = 8 sweatshirt_cost = jeans_cost * 2 shoes_cost = sweatshirt_cost * 4 result = shoes_cost / 2 return result
Thomas is 15 and his father is 48, in how many years will Thomas be one-fifth of his father's age?
def solve() -> int: onefifth_Dad_age = 15 + (48*1/5) result = onefifth_Dad_age return result
Certain couriers had to deliver packages to 13 different buildings. The first 6 buildings got delivered one package each and the remaining 7 buildings got delivered two packages each. How many packages were delivered in total?
def solve() -> int: num_1_package = 6 num_2_packages = 7 result = num_1_package + (num_2_packages * 2) return result
Rachel had four times as many toys as Max who had 6 fewer toys than Ava. If Ava gave 2 toys to Max, and Rachel gave 8 toys to Ava, how many toys did Max have at the beginning?
def solve() -> int: ava_toys = 0 max_toys = 0 rachel_toys = 0 ava_toys -= 2 max_toys += 2 rachel_toys -= 8 ava_toys += 8 max_toys = ava_toys - 6 result = max_toys return result
Student: Ava buys a shirt that costs $20 and a skirt that costs $30. The sales tax is 8%. How much does she spend in total?
def solve() -> int: shirt = 20 skirt = 30 subtotal = shirt + skirt sales_tax = subtotal * 0.08 total = subtotal + sales_tax result = total return result
Olivia is baking a cake and notices that with each egg she adds, the cake becomes fluffier. She wants to make sure the cake is fluffy enough which requires an additional 3 eggs. She's already added 2 eggs, how many more eggs does she need to add to meet her goal?
def solve() -> int: eggs_added = 2 additional_eggs_needed = 3 eggs_to_add = additional_eggs_needed - eggs_added result = eggs_to_add return result
A rectangular box has dimensions of length 8 cm, width 6 cm and height 5 cm. What is the total surface area of the box?
def solve() -> int: length = 8 width = 6 height = 5 area_of_top_and_bottom = length*width area_of_left_and_right = width*height area_of_front_and_back = length*height total_surface_area = 2*area_of_top_and_bottom + 2*area_of_left_and_right + 2*area_of_front_and_back ...
Student: 10. Rachel bought 3 books for $10.75 each and 2 CDs for $15.00 each. She was charged 8% HST. How much did Rachel have to pay?
def solve() -> int: books = 3 price_books = 10.75 CDs = 2 price_CDs = 15.00 subtotal = books * price_books + CDs * price_CDs HST = subtotal * 0.08 total = subtotal + HST result = total return result
A rectangle has a length of 10 inches and a width that is 3 times smaller. What is the perimeter of the rectangle?
def solve() -> int: length = 10 width = length / 3 perimeter = 2 * length + 2 * width result = perimeter return result
Ethan's teacher buys a package of 50 red pencils. Ethan works with 4 classmates. All the students use one pencil every 3 days. How many days will it take to finish the pack of pencils?
def solve() -> int: red_pencils = 50 students = 5 pencils_per_day = students * (1/3) days_to_finish = red_pencils / pencils_per_day result = days_to_finish return result
A delivery van travels at a speed of 45 km/h. How long does it take for the van to cover a distance of 180 kilometers?
def solve() -> int: distance = 180 speed = 45 time = distance/speed result = time return result
Emma had $1200. She gave 3/7 of her money to her friend and then spent 1/3 of what she had left on a laptop. How much money did Emma have left in her account?
def solve() -> int: money = 1200 money_given = money * 3/7 money_remaining = money - money_given money_spent = money_remaining * 1/3 money_left = money_remaining - money_spent result = money_left return result
The price of a can of soda is $1.50. If there is a 5% sales tax, how much tax would you pay for 10 cans of soda?
def solve() -> int: price_per_can = 1.5 number_of_cans = 10 sales_tax_percentage = 0.05 total_price = price_per_can * number_of_cans sales_tax = total_price * sales_tax_percentage result = sales_tax return result
Hank is crafting a musical instrument with three parts. The first part is twice as long as the second part. The third part is very short with a length of only two inches. The second part is four times as long as the third part. How long is the first part in Hank's musical instrument? Samantha's blender can hold 2 cups ...
def solve() -> int: second_part = 0 first_part = 0 third_part = 2 strawberries = 5 blueberries = 10 strawberry_weight = 2 blueberry_weight = 3 blender_capacity = 2 second_part = third_part * 4 first_part = second_part * 2 total_weight = strawberries * strawberr...
A farmer has 100 cows in the barn. 2/5 of them are dairy cows and the rest are beef cows. How many beef cows are there in the barn?
def solve() -> int: cows = 100 dairy_cows = cows * 2/5 beef_cows = cows - dairy_cows result = beef_cows return result
The school is hosting a toy drive before Christmas. The Grade 1 students collected 30 toys in the first week and 40 toys in the second week. They need 50 more toys to reach their target. How many toys is their target?
def solve() -> int: week1_toys = 30 week2_toys = 40 target_toys = week1_toys + week2_toys + 50 result = target_toys return result
There are 12 girls and 8 boys in a class. If 2 students are chosen randomly, without replacement, what is the probability that both students are girls?
def solve() -> int: total_students = 20 total_girls = 12 prob_first_girl = total_girls/total_students prob_second_girl = (total_girls - 1)/(total_students - 1) prob_both_girls = prob_first_girl * prob_second_girl result = prob_both_girls return result
In a choir, there are five times as many soprano singers as bass singers. How many soprano singers are there if there are 18 bass singers in the choir?
def solve() -> int: bass = 18 soprano = 5 * bass result = soprano return result
A grocery store has 200 pounds of apples in stock and they want to sell them in 5-pound bags. How many bags of apples can they make and how many pounds of apples will be left over?
def solve() -> int: total_apples = 200 apples_per_bag = 5 total_bags = int(total_apples / apples_per_bag) leftover_apples = total_apples % apples_per_bag result = (total_bags, leftover_apples) return result
Nick is a marathon runner training for a big race. He believes it will take many miles to prepare for the race. Each mile he runs takes him 10 minutes. Nick's doctor tells him he can't run over 10 miles a day. Nick is disappointed about the 50 miles he didn't run. How many miles did Nick run in total?
def solve() -> int: miles_per_day = 10 days_not_run = 5 total_miles_not_run = miles_per_day * days_not_run total_miles_run = total_miles_not_run + 50 total_time = total_miles_run * 10 result = total_miles_run return result
When 15 is added to twice a number, the result is 61. What is the number?
def solve() -> int: total = 61 num_coeff = 2 num = (total - 15) / num_coeff result = num return result
Possible questions and programs: You are buying books at a bookstore that offers a buy-one-get-one-free deal for every two books you purchase. Each book costs $12. How much do you pay if you buy 5 books?
def solve() -> int: book_cost = 12 book_num = 5 pair_num = book_num // 2 total_cost = pair_num * book_cost + (book_num % 2) * book_cost result = total_cost return result
Bob has decided to save up for a trip in two years. He is going to put $12,000 in a bank account that earns 5% interest each year. How much money will he have after two years?
def solve() -> int: balance_per_year = 12000 * 1.05 total_balance_after_2_years = balance_per_year * 2 result = total_balance_after_2_years return result
Student: John makes his own trail mix. He adds 2 cups of nuts for every 3 cups of pretzels. If he adds 18 cups of pretzels, how many cups of nuts does he need?
def solve() -> int: nuts_per_pretzel = 2 / 3 pretzels = 18 nuts = nuts_per_pretzel * pretzels result = nuts return result
A school is buying supplies for an art project. One shop offers a pack of 50 colored pencils for $12. The other shop offers a pack of 80 colored pencils for $15. How much money, in dollars, can the school save by buying from the second shop instead of the first shop if they need 400 colored pencils?
def solve() -> int: packs_12 = 400 / 50 packs_15 = 400 / 80 cost_12 = packs_12 * 12 cost_15 = packs_15 * 15 savings = cost_12 - cost_15 result = savings return result
Tara is baking cupcakes for a school fundraiser. On Monday, she bakes 24 cupcakes. On Tuesday, she bakes 36 cupcakes. On Wednesday, she bakes 48 cupcakes. On Thursday, she bakes 60 cupcakes. On Friday, she bakes 24 cupcakes. Tara uses 3 eggs for every 12 cupcakes. How many eggs does Tara use from Monday to Friday?
def solve() -> int: total_cupcakes = 24 + 36 + 48 + 60 + 24 total_eggs = (total_cupcakes / 12) * 3 result = total_eggs return result
A triangular garden has an area of 120 square feet. If the base is 20 feet and the height is 12 feet, what is the length of the other two sides of the triangle?
def solve() -> int: base = 20 height = 12 area = 120 other_side_length = (2 * area) / base result = other_side_length return result
A rectangular prism has dimensions of 5 in, 7 in, and 10 in. What is the volume of the rectangular prism?
def solve() -> int: length = 5 width = 7 height = 10 volume = length * width * height result = volume return result
Lily counted a total of 35 cars in the parking lot. She saw 9 yellow cars, 4 white cars, 11 green cars and 10 blue cars. How many of the cars are not yellow?
def solve() -> int: car_amount = 0 car_amount = 35 - 9 result = car_amount return result
The dimensions of a rectangle are such that its length is thrice its breadth. If the perimeter of the rectangle is 64 cm, find its area.
def solve() -> int: perimeter = 64 l = 3*(perimeter/8) b = perimeter/8 area = l*b result = area return result
Student: Mike and Alex are going out for dinner. Mike had $50 and Alex had $25. The dinner cost $35. How much money do they have left?
def solve() -> int: mike_money = 50 alex_money = 25 dinner_cost = 35 total_money = mike_money + alex_money money_left = total_money - dinner_cost result = money_left return result
A garden is 6 meters longer than it is wide. If the perimeter of the garden is 72 meters, what is the width of the garden?
def solve() -> int: perimeter = 72 length = perimeter / 2 - 6 width = perimeter / 2 - length result = width return result
Student: Gina, Hal, and Ivy have 450 coins among them in the ratio 3:2:1. If Gina gives Hal 15 coins and Ivy gives Hal 10 coins, what's the difference between the number of coins that Gina has and the number of coins that Ivy has?
def solve() -> int: gina_coins = 3 hal_coins = 2 ivy_coins = 1 total_coins = gina_coins + hal_coins + ivy_coins total_coins_value = 450 gina_coins = gina_coins / total_coins * total_coins_value hal_coins = hal_coins / total_coins * total_coins_value ivy_coins = ivy_coins / total_coins * ...
Mason and Lily were playing chess. On the first day, Mason won 3 games, which was two fewer than Lily. On the second day, Mason won half the games Lily won, who won 10 games. How many games did Mason and Lily win during these two days?
def solve() -> int: mason_first_day = 3 lily_first_day = mason_first_day + 2 lily_second_day = 10 mason_second_day = lily_second_day / 2 total_mason = mason_first_day + mason_second_day total_lily = lily_first_day + lily_second_day result = total_mason + total_lily return ...
Jacob has 4 packs of crayons. The first pack has 8 crayons. The second and third packs have 25% less crayons and the last pack has 50% more crayons than the first. How many crayons does Jacob have in total?
def solve() -> int: pack1 = 8 pack2 = pack1 - (pack1 * 0.25) pack3 = pack1 - (pack1 * 0.25) pack4 = pack1 + (pack1 * 0.5) total_crayons = pack1 + pack2 + pack3 + pack4 result = total_crayons return result
A car travels 360 miles on 15 gallons of gas. How many miles can the car travel on 8 gallons of gas?
def solve() -> int: miles_per_gallon = 360 / 15 num_gallons = 8 total_miles = miles_per_gallon * num_gallons result = total_miles return result
Tom, Sue, and Lee are friends who share a cake every Monday. Tom ate 2/5 of a 20-slice cake on one Monday. Sue ate 4/5 of the amount that Tom ate, and Lee ate 3/4 of the amount that Sue ate. How many more slices should Lee eat to have the same amount as Tom?
def solve() -> int: tom = 2/5 sue = 4/5 * tom lee = 3/4 * sue total_slices = 20 tom_slices = tom * total_slices sue_slices = sue * total_slices lee_slices = lee * total_slices difference = tom_slices - lee_slices result = difference return result
At a local college, 30% of the students are taking math courses and 20% of the students are taking English courses. If there are 800 students at the college, how many are taking BOTH math and English courses?
def solve() -> int: students_taking_math = 800 * 0.3 students_taking_math = 800 * 0.2 students_taking_both = students_taking_math * students_taking_math result = students_taking_both return result
At an aquarium, there are 2 fish tanks side by side. The first tank has 15 fish until 3 die. 7 fish from the second tank, which originally had 25, are moved to the first tank. The third tank has 20 fish. How many fish are left in the aquarium?
def solve() -> int: first_tank_fish = 15 second_tank_fish = 25 third_tank_fish = 20 first_tank_fish -= 3 second_tank_fish -= 7 first_tank_fish += 7 total_fish = first_tank_fish + second_tank_fish + third_tank_fish result = total_fish return result