question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Dylan has 70 red apples, 45 green apples, and 15 yellow apples in his basket. If he wants to divide all the apples equally into 5 bags, how many green apples will be in each bag?
def solve() -> int: red_apples = 70 green_apples = 45 yellow_apples = 15 total_apples = red_apples + green_apples + yellow_apples bags = 5 green_apples_per_bag = green_apples // bags result = green_apples_per_bag return result
A rectangular lawn is 30 feet by 50 feet. If each square foot of the lawn needs to be watered with 2 ounces of water and there are 128 fluid ounces in 1 gallon, how many gallons of water does it take to water the lawn once?
def solve() -> int: length = 30 width = 50 square_footage = length*width water_per_square_foot = 2/128 total_water_needed = square_footage*water_per_square_foot result = total_water_needed return result
Caleb wants to go to a gym and use the pool, sauna, and weights section. He called three different gyms to compare prices: Gold's Gym, 24 Hour Fitness, and The Fitness Edge. Gold's Gym charges $40 for a monthly membership that includes all facilities, 24 Hour Fitness charges $45 for a monthly membership that includes a...
def solve() -> int: gold_gym_price = 40 hour_fitness_price = 45 fitness_edge_price = 60 if gold_gym_price < hour_fitness_price and gold_gym_price < fitness_edge_price: cheapest_gym = "Gold's Gym" elif hour_fitness_price < gold_gym_price and hour_fitness_price < fitness_edge_price: ...
Student: Alice has a jar of candy that is 5 times as heavy as Bob's jar. Bob's jar is 200 g lighter than Carol's jar. And Carol's jar weighs 1 kg. How heavy is Alice's jar?
def solve() -> int: alice_jar = 0 bob_jar = 0 carol_jar = 1 alice_jar = carol_jar * 5 bob_jar = alice_jar - 200 result = alice_jar return result
A TV is on sale for $420, which is 25% off the original price. What was the original price of the TV?
def solve() -> int: sale_price = 420 discount_percent = 0.25 original_price = sale_price / (1 - discount_percent) result = original_price return result
A family has 6 members and each member has 4 suitcases. In another family, there are 8 members, but only 2 suitcases each. How many suitcases are there in total between the two families?
def solve() -> int: family1_members = 6 family1_suitcases_per_member = 4 family2_members = 8 family2_suitcases_per_member = 2 total_suitcases = (family1_members * family1_suitcases_per_member) + (family2_members * family2_suitcases_per_member) result = total_suitcases return r...
A bakery can make 40 doughnuts in 2.5 hours or 60 croissants in 3 hours. If it makes 80 doughnuts and 60 croissants in 5 hours, how many doughnuts can it make in 1 hour?
def solve() -> int: doughnut_portion = 40 / (40 + 60) croissant_portion = 60 / (40 + 60) total_doughnut_hours = doughnut_portion * 2.5 total_croissant_hours = croissant_portion * 3 total_hours = total_doughnut_hours + total_croissant_hours doughnuts_in_hour = 80 / total_hours result = doughn...
Amanda runs 3 miles at a pace of 8 minutes per mile and 2 miles at a pace of 10 minutes per mile. What is her total time running?
def solve() -> int: mile1 = 3 mile2 = 2 pace1 = 8 pace2 = 10 time1 = mile1 * pace1 time2 = mile2 * pace2 total_time = time1 + time2 result = total_time return result
Student: A gym membership costs $25 per month, plus an initiation fee of $50. If Mary pays $215 for her first year of membership, how many months did she pay for?
def solve() -> int: initiation_fee = 50 monthly_fee = 25 total_paid = 215 total_months = (total_paid - initiation_fee) // monthly_fee result = total_months return result
Mike needs to buy 2 liters of milk for every 1 box of cereal. The milk is $2.00 per liter and the cereal is $3.50 per box. Mike has a coupon for $1.00 off each box of cereal. What is the total cost per liter of milk and box of cereal?
def solve() -> int: milk_price = 2.00 cereal_price = 3.50 coupon = 1.00 milk_quantity = 2 cereal_quantity = 1 total_cost = (milk_price * milk_quantity) + ((cereal_price - coupon) * cereal_quantity) cost_per_liter = total_cost / (milk_quantity + cereal_quantity) result = co...
A room is 20 feet by 15 feet. If it costs $5 per square foot for new carpet, what is the total cost of the new carpet?
def solve() -> int: length = 20 width = 15 area = length * width cost_per_square_foot = 5 total_cost = area * cost_per_square_foot result = total_cost return result
Emily can bike at a speed of 12 miles per hour on flat terrain and 10 mph on hilly terrain. This year, half of her races happen on flat terrain and half of the races happen on hilly terrain. If she bikes a total of 24 miles, how long did it take her to complete the races?
def solve() -> int: flat_speed = 12 hilly_speed = 10 total_distance = 24 flat_distance = total_distance / 2 hilly_distance = total_distance / 2 flat_time = flat_distance / flat_speed hilly_time = hilly_distance / hilly_speed total_time = flat_time + hilly_time res...
1. There are 480 people gathered at the auditorium with 24 rows of seats. How many seats are in each row?
def solve() -> int: num_rows = 24 num_people = 480 result = num_people // num_rows return result
If there are 126 cards in a box, and 3 cards were taken out each day consecutively for 5 days, how many cards are left in the box?
def solve() -> int: cards = 126 cards_taken = 3 days = 5 result = cards - cards_taken*days return result
James has 10 snakes. They consume an average of 20 grams of food per feeding time. One snake eats 15 grams per feeding time. The second eats 40% more than this. How much food does the third snake eat per feeding time?
def solve() -> int: snakes = 10 average_food_per_snake = 20 food_per_feeding_time = 15 food_per_feeding_time_second_snake = food_per_feeding_time * 1.4 food_per_feeding_time_third_snake = (snakes * average_food_per_snake - (food_per_feeding_time + food_per_feeding_time_second_snake * (snakes - 2))) ...
A store is having a 20% off sale on all items. If a shopper has a $50 budget, what is the most expensive item they can purchase?
def solve() -> int: discount_percent = 0.2 budget = 50 max_price = budget / (1 - discount_percent) result = max_price return result
Possible additional questions and programs: Micah, Tyrell, and Kiana share their stickers. Micah had 36 stickers before he gave Tyrell 4 stickers. Kiana had 28 stickers before giving Tyrell 6 stickers. After all the trades, Tyrell now has 3 more stickers than Micah, how many more stickers does Tyrell have now than Kian...
def solve() -> int: micah = 36 tyrell = 0 kiana = 28 micah = micah - 4 tyrell = tyrell + 4 kiana = kiana - 6 tyrell = tyrell + 6 diff_micah = tyrell - micah diff_kiana = tyrell - kiana result = diff_kiana return result
The concert hall sells $30 tickets for the balcony and $50 tickets for the orchestra. If they sold 150 balcony tickets and 75 orchestra tickets, how much money did they make in total?
def solve() -> int: balcony_tickets = 150 orchestra_tickets = 75 balcony_price = 30 orchestra_price = 50 balcony_sales = balcony_tickets * balcony_price orchestra_sales = orchestra_tickets * orchestra_price total_sales = balcony_sales + orchestra_sales result = total_...
Zoe's hamster, Peanut, was born on the same day that Sam turned 7 years old. Sam is exactly 2 years younger than his twin sisters Emma and Lily. On Emma and Lily's 11th birthday, how many years old was Zoe's hamster, Peanut?
def solve() -> int: peanut_birth = 7 sam_age = -2 emma_lily_age = 11 age_diff = emma_lily_age - (peanut_birth + sam_age) peanut_age = age_diff + peanut_birth result = peanut_age return result
Michael went to a restaurant that offered a deal for customers to order a main dish and get the second main dish for half off the full price. If he ordered two dishes that were each originally marked at a full price of $25, how much did he spend on the two dishes, in dollars?
def solve() -> int: price_per_dish = 25 total_cost_without_discount = price_per_dish * 2 discount_amount = price_per_dish / 2 total_cost_with_discount = total_cost_without_discount - discount_amount result = total_cost_with_discount return result
A grocery store has 300 apples. If they sell them in packs of 12, how many full packs can they make?
def solve() -> int: apples = 300 packs = apples//12 result = packs return result
A snail crawls 15 inches in 2 hours. How many inches will it crawl in 24 hours?
def solve() -> int: velocity = 15/2 distance = velocity*24 result = distance return result
Jonathan can solve 10 math problems in 20 minutes. But, he is suffering from a minor headache and as a result, he can only solve 6 problems in 20 minutes. If he has to solve 96 math problems, how long will it take him?
def solve() -> int: problems_solved_per_minute = 6 / 20 time_taken = 96 / problems_solved_per_minute result = time_taken return result
If a 6-pack of soda costs $5, how much would it cost to buy 15 cans of soda?
def solve() -> int: pack_size = 6 pack_price = 5 total_cans = 15 price_per_can = pack_price/pack_size total_price = price_per_can * total_cans result = total_price return result
Andrea is making a batch of cookies and the recipe calls for cups of butter instead of telling her the number. She needs 2 cups in total. She looks up online that a stick of butter weighs 1/2 a cup. If she needs 2 cups of butter, how many sticks of butter should she buy?
def solve() -> int: cups_of_butter = 2 cups_per_stick = 1/2 sticks_of_butter = cups_of_butter / cups_per_stick result = sticks_of_butter return result
Lisa's garden can fit up to 200 plants. If she plants 20 seeds every day, and it takes 10 seeds to grow 1 plant, how many days until her garden is full?
def solve() -> int: max_plants = 200 seeds_per_day = 20 seeds_per_plant = 10 plants_per_day = seeds_per_day // seeds_per_plant days_to_fill_garden = (max_plants // plants_per_day) result = days_to_fill_garden return result
If a meal at a restaurant costs $25 and there is a 7% tax, what is the final bill?
def solve() -> int: meal_cost = 25 tax_rate = 0.07 tax_amount = meal_cost * tax_rate total_cost = meal_cost + tax_amount result = total_cost return result
During the first week, Doctor Lee saw four times as many patients as Doctor Chen. Doctor Kim saw three more patients than Doctor Lee in the same amount of time. If Doctor Lee saw 12 patients, how many patients did the three of them see altogether?
def solve() -> int: lee_patients = 12 chen_patients = lee_patients / 4 kim_patients = lee_patients + 3 total_patients = lee_patients + chen_patients + kim_patients result = total_patients return result
Jason takes out a loan of $3600 and will repay it over the course of 3 years with an interest rate of 5%. How much total money will Jason have paid back to the bank after 3 years?
def solve() -> int: loan = 3600 interest = 0.05 time = 3 total_amount_paid = loan * (1 + interest) ** time result = round(total_amount_paid, 2) return result
Thomas decided to buy a new smartphone and his budget was no more than $700. The salesperson offered him the smartphone for $100 less and an additional 20% off. How much lower was the price of the smartphone than the amount Thomas decided to spend?
def solve() -> int: budget = 700 discounted_price = (budget - 100) * 0.8 difference = budget - discounted_price result = difference return result
Tom has a rectangular garden that is 12 meters long and 8 meters wide. He wants to plant flowers along the perimeter of the garden. Each flower needs 0.5 meters of space. How many flowers can he plant?
def solve() -> int: length = 12 width = 8 space = 0.5 perimeter = 2 * (length + width) flowers = perimeter / space result = flowers return result
A rectangle has a length of 12 inches and a width of 6 inches. What is the perimeter of the rectangle in feet?
def solve() -> int: perimeter_inches = 2 * (12 + 6) perimeter_feet = perimeter_inches / 12 result = perimeter_feet return result
ara works 40 hours a week. She gets paid $15 per hour for the first 30 hours she works, and $20 per hour for any additional hours. How much does she earn in a month where she works 160 hours?
def solve() -> int: hours_worked = 160 pay_regular = min(30, hours_worked) * 15 pay_overtime = max(0, hours_worked - 30) * 20 total_pay = pay_regular + pay_overtime result = total_pay * 4 return result
David worked for his old company for 12 months earning $4,500 per month. He then took a job at a new company where he makes 15% more than his old salary. If he has worked at the new company for 6 months longer than he worked at his old company, what is the total amount of money David has earned in both companies?
def solve() -> int: old_salary = 4500 old_months = 12 new_months = old_months + 6 new_salary = old_salary * 1.15 old_earnings = old_salary * old_months new_earnings = new_salary * new_months total_earnings = old_earnings + new_earnings result = total_earnings return result
Alex has 50 books. He gives away half of them and then receives 15 more books. How many books does he have now?
def solve() -> int: books = 50 books_give = books // 2 books_receive = 15 books_left = books - books_give books_total = books_left + books_receive result = books_total return result
A farmer has 16 chickens and 20 ducks. Each chicken lays 4 eggs per week and each duck lays 6 eggs per week. The farmer sells each egg for $0.5. How much money does the farmer make from selling eggs in 4 weeks?
def solve() -> int: eggs = 0 money = 0 eggs = (16 * 4 + 20 * 6) * 4 money = eggs * 0.5 result = money return result
Chris provides his garden with 4 shovels, 1 rake, and 2 gloves. If he has 6 gardeners, how many gardening tools does he need to purchase in total?
def solve() -> int: shovels = 4 rake = 1 gloves = 2 gardeners = 6 total_tools = (shovels + rake + gloves) * gardeners result = total_tools return result
Student: Taylor has a basketball collection with 10 basketballs, 9 soccerballs, and 11 volleyballs. How many combinations of 3 balls can be made from the collection?
def solve() -> int: basketballs = 10 soccerballs = 9 volleyballs = 11 total_balls = basketballs + soccerballs + volleyballs combinations = total_balls * (total_balls - 1) * (total_balls - 2) // 6 result = combinations return result
A car travels 40 miles per hour for 2 hours, and then 60 miles per hour for 1 hour. What is the average speed of the car in miles per hour?
def solve() -> int: distance_1 = 40 * 2 distance_2 = 60 * 1 total_distance = distance_1 + distance_2 total_time = 2 + 1 average_speed = total_distance / total_time result = average_speed return result
A company has 20 employees and each employee works an average of 8 hours per day. One employee works an average of 12 hours per day. If the rest of the employees maintain the same average daily working hours, what is the total number of hours they will work in a week?
def solve() -> int: employees = 20 average_hours_per_day = 8 one_employee_hours_per_day = 12 total_hours_per_day = employees * average_hours_per_day one_employee_total_hours_per_day = one_employee_hours_per_day - average_hours_per_day total_hours_per_week = total_hours_per_day * 7 ...
Student: If it takes 5 workers 15 days to build a house, but 10 workers can complete the same job in 10 days, how long would it take for 3 workers to build the same house?
def solve() -> int: workers = 3 days_5_workers = 15 days_10_workers = 10 days_3_workers = (days_5_workers * 5) / workers result = days_3_workers return result
The doctor saw 30 patients last week. This week, he saw 4 times as many patients. If he already had 10 patients before last week, how many patients has he seen now?
def solve() -> int: last_week_patients = 30 this_week_patients = 4 * last_week_patients initial_patients = 10 total_patients = initial_patients + last_week_patients + this_week_patients result = total_patients return result
If a company's revenue last year was $2,500,000 and this year it was $3,000,000, what was the percentage increase in revenue?
def solve() -> int: old_revenue = 2500000 new_revenue = 3000000 increase_percentage = (new_revenue - old_revenue) / old_revenue * 100 result = increase_percentage return result
Eliza and Isaac are playing a game. When Eliza is six years old, Isaac will be four times her age. How old is Eliza currently?
def solve() -> int: x = 6 y = x*4 result = y/4 return result
Harry needs to buy new fence panels for his garden, which is a rectangle-shaped shape with a length of 14 meters and a width of 6 meters. How many fence panels does he need to buy?
def solve() -> int: length = 14 width = 6 area = length * width num_panels = area/4 result = num_panels return result
There are 40 employees at a company. If each employee works for 7 hours a day and the company operates for 12 hours a day, how many shifts will be required to cover the entire day?
def solve() -> int: employees = 40 working_hours = 7 operating_hours = 12 total_hours = employees * working_hours shifts = total_hours // operating_hours + 1 result = shifts return result
Student: Anna has 20 marbles. She lost 5 marbles in a game and then won 8 marbles in another game. She then gave half of her marbles to her sister. How many marbles does Anna have left?
def solve() -> int: marbles = 20 marbles = marbles - 5 marbles = marbles + 8 marbles = marbles / 2 result = marbles return result
If the perimeter of a square is 40 cm, what is the length of each side of the square?
def solve() -> int: perimeter = 40 side_length = perimeter / 4 result = side_length return result
In a cookie jar, there are 145 chocolate chip cookies, 70 oatmeal raisin cookies, 40 double chocolate cookies, and an unknown number of sugar cookies. Each box of cookies costs $4.75 and has 12 cookies in it. If the family bought 4 boxes and has 3 cookies left over, how many sugar cookies were in the jar?
def solve() -> int: chocolate_chip_cookies = 145 oatmeal_raisin_cookies = 70 double_chocolate_cookies = 40 total_cookies = chocolate_chip_cookies + oatmeal_raisin_cookies + double_chocolate_cookies cookies_per_box = 12 boxes_bought = 4 cookies_left_over = 3 total_cookies_b...
Mr. and Mrs. Smith are planning to take their family to the zoo. Adult tickets are $20, children's tickets are $12, and senior citizen tickets are $15. They need to buy tickets for themselves, their three children (ages 4, 7, and 11), and Mr. Smith's parents (ages 68 and 72). How much will they spend on these tickets?
def solve() -> int: adult_ticket_price = 20 child_ticket_price = 12 senior_ticket_price = 15 num_adult_tickets = 2 num_child_tickets = 3 num_senior_tickets = 2 adult_tickets_cost = num_adult_tickets * adult_ticket_price child_tickets_cost = num_child_tickets * child_ticket_pric...
The ratio of white balls to red balls in a basket is 1:4. If there are a total of 45 balls, how many are white?
def solve() -> int: white_balls = 1 red_balls = 4 total_balls = 45 total_ratio = white_balls + red_balls white_ratio = white_balls / total_ratio white_count = white_ratio * total_balls result = white_count return result
A pizza shop sells pizzas for $15 each. On a busy day, the shop can sell 50 pizzas. However, the shop only has enough ingredients to make 75 pizzas every day. If the cost of making each pizza is $7, how much profit can the shop make on a busy day?
def solve() -> int: pizzas_sold = 50 cost_per_pizza = 7 ingredients_for_pizza = 1.5 pizzas_made = 75 price_per_pizza = 15 total_ingredients_cost = pizzas_made * ingredients_for_pizza * cost_per_pizza total_sales = pizzas_sold * price_per_pizza profit = total_sales - total_ingredient...
Jack and Ryan are neighbors. Jack is 12 years old and Ryan is 14 years old. In how many years will their combined age be 48 years old?
def solve() -> int: jack_age = 12 ryan_age = 14 combined_age = jack_age + ryan_age years_needed = (48 - combined_age) result = years_needed return result
At least two-thirds of the flowers in the garden are red. All of the rest are yellow, except for 7 that are purple. If there are 60 flowers in the garden, how many of them are yellow?
def solve() -> int: red_flowers = (2/3) * 60 purple_flowers = 7 yellow_flowers = 60 - red_flowers - purple_flowers result = yellow_flowers return result
After camping for 3 days, six friends go out for breakfast. Alex spends three-quarters of the amount that James did on breakfast. James and Emily paid the same amount for their meal. If Emily’s breakfast cost $36, what’s the total amount in dollars paid by all six friends?
def solve() -> int: james_breakfast = 4/3 * 36 alex_breakfast = 3/4 * james_breakfast total_breakfast_cost = james_breakfast + 36 + alex_breakfast total_cost_six_friends = total_breakfast_cost * 6 result = total_cost_six_friends return result
Terry bought 10 pencils for $2. If he buys 20 more pencils, how much will he spend in total?
def solve() -> int: price = 2 quantity = 20 total_price = (quantity + 10) * price result = total_price return result
A train is traveling at a speed of 60 mph. If the train traveled for 3 hours, how far did it go?
def solve() -> int: train_speed = 60 time_travelled = 3 distance_travelled = train_speed * time_travelled result = distance_travelled return result
A bag contains 50 candies. If 15 candies are taken out, how many candies are left in the bag?
def solve() -> int: total_candies = 50 taken_out = 15 remaining_candies = total_candies - taken_out result = remaining_candies return result
Jacob has 20 toy cars. His cousin gives him his collection of 30 toy cars. Over the summer, Jacob receives one-third that amount of toy cars from his grandparents. How many toy cars does Jacob now have?
def solve() -> int: toy_cars_jacob = 20 toy_cars_cousin = 30 toy_cars_grandparents = toy_cars_cousin / 3 total_toy_cars = toy_cars_jacob + toy_cars_cousin + toy_cars_grandparents result = total_toy_cars return result
Sally has $15000 to invest in stocks. She wants to invest 30% of this amount in company A and 70% in company B. The expected return of company A is 8% p.a. and company B is 12% p.a. What is the expected yearly profit of Sally?
def solve() -> int: total_investment = 15000 percentage_a = 0.3 percentage_b = 0.7 investment_in_a = total_investment * percentage_a investment_in_b = total_investment * percentage_b expected_profit_a = investment_in_a * 0.08 expected_profit_b = investment_in_b * 0.12 total_profit = expe...
A company borrowed $15000 from the bank at an interest rate of 12% per annum. After two years, what is the total amount they need to pay back to the bank?
def solve() -> int: borrowed_money = 15000 interest_rate = 0.12 current_year = 2021 year_borrowed = current_year - 2 years_passed = current_year - year_borrowed interest = borrowed_money * interest_rate * years_passed total_money = borrowed_money + interest result = total_money retu...
Michael's garden grows 2 inches every week. He trims the plants down to 6 inches every time they reach 12 inches. Trimming the plants costs $60 and he gives a 15% tip. How much does he spend on trimmings in a year?
def solve() -> int: growth_per_week = 2 trim_height = 12 trim_cost = 60 tip_percent = 15 weeks_per_year = 52 growth_per_year = growth_per_week * weeks_per_year trim_count = growth_per_year // (trim_height - growth_per_week) tip_amount = trim_cost * (tip_percent / 100) total...
Mark's grade was 88 out of 100. What percent did he score on the test?
def solve() -> int: mark_score = 88 out_of = 100 mark_percent = mark_score/out_of*100 result = mark_percent return result
Student: Adam walks 2 kilometers in 20 minutes. How many kilometers can he walk in 2 hours?
def solve() -> int: distance = 2 time = 20 total_time = 2 speed = distance / time total_distance = speed * total_time result = total_distance return result
In December 2021, there were 500 people who downloaded a new gaming app. The number of downloads was 50% less than the number of downloads in the previous month and 200 more than the number of downloads in the month before that. How many downloads were there in the previous two months in total?
def solve() -> int: december_downloads = 500 november_downloads = december_downloads / 0.5 october_downloads = november_downloads - 200 total_downloads = november_downloads + october_downloads result = total_downloads return result
Student: - There are seven times as many cookies as muffins at Theo's bake sale. Each cookie sold for half the price of each muffin. If there are 12 muffins at the bake sale and each muffin sold for $4, calculate the total revenue of the bake sale.
def solve() -> int: muffins = 12 price_muffin = 4 cookies = muffins * 7 price_cookie = price_muffin / 2 total_muffins = muffins * price_muffin total_cookies = cookies * price_cookie total_revenue = total_muffins + total_cookies result = total_revenue return result
Julie collects stickers and puts them in albums. Each album has 10 pages and each page has 12 stickers. She has 5 full albums and 3 pages of stickers in another album. How many albums would she need if she wants to store 720 stickers in total?
def solve() -> int: stickers_5 = 5 * 10 * 12 stickers_3 = 3 * 12 total_stickers = stickers_5 + stickers_3 stickers_to_add = 720 - total_stickers pages_to_add = stickers_to_add // 12 albums_to_add = pages_to_add // 10 result = albums_to_add return result
A store sells 5 packs of gum for $1. If you want to buy 25 packs, how much will it cost you?
def solve() -> int: packs = 25 cost_per_pack = 1/5 cost = packs / cost_per_pack result = cost return result
Kevin runs 3 kilometers every day for 5 days a week. He burns 60 calories per kilometer. He also consumes 2000 calories per day. How many calories does he lose in a week?
def solve() -> int: calories_burned = 3 * 60 * 5 calories_consumed = 2000 * 7 result = calories_consumed - calories_burned return result
Jake is making coffee for his friends and wants to make 6 cups of coffee. Each cup of coffee requires 30 milliliters of coffee grinds. How many milliliters of grinds does he need in total?
def solve() -> int: Cup_size = 30 Cups_needed = 6 Total_amount = Cup_size * Cups_needed result = Total_amount return result
If the typical store hours of Mark's supermarket are 10 am to 9 pm every day Monday to Sunday, how many hours is the supermarket open in a week?
def solve() -> int: opening_time = 10 closing_time = 9 hours_open_per_day = closing_time + (12 - opening_time) hours_open_per_week = hours_open_per_day * 7 result = hours_open_per_week return result
Sarah is planning to bake cakes for her family. She has to make 7 chocolate cakes and 3 vanilla cakes. If each cake takes 30 minutes to bake, how many hours will Sarah need to spend baking all the cakes?
def solve() -> int: chocolate_cakes = 7 vanilla_cakes = 3 total_cakes = chocolate_cakes + vanilla_cakes time_per_cake = 30 total_time = total_cakes * time_per_cake hours = total_time / 60 result = hours return result
A department store is having a sale where all items are 25% off. If the original price of a shirt was $30, what is the sale price?
def solve() -> int: originalPrice = 30 discount = 0.25 discountAmount = originalPrice * discount salePrice = originalPrice - discountAmount result = salePrice return result
Jake drives a car for 240 miles in 4 hours while Sarah takes 1/5 times longer to drive the same distance. What is the average time the two take to drive 240 miles?
def solve() -> int: distance = 240 jake_time = 4 sarah_time = jake_time * (1 + 1/5) average_time = (jake_time + sarah_time) / 2 result = average_time return result
Juan is walking in a park, going uphill and downhill. On a slope, he walks at a speed of 2 miles per hour, and on a flat surface, he walks at 3 miles per hour. If he walks uphill for 1 mile, downhill for 2 miles, and flat for 3 miles, how long will it take him to finish his walk?
def solve() -> int: uphill_distance = 1 downhill_distance = 2 flat_distance = 3 uphill_speed = 2 flat_speed = 3 time_uphill = uphill_distance / uphill_speed time_downhill = downhill_distance / uphill_speed time_flat = flat_distance / flat_speed total_time = time_uphill + ti...
Student: John wants to buy a new TV for $1000 but only has $750. He takes out a loan with 6% interest and pays it off in 2 years. How much money does John owe at the end of 2 years?
def solve() -> int: principal = 750 interest_rate = 0.06 time = 2 total_amount = principal * (1 + interest_rate) ** time interest = total_amount - principal result = total_amount return result
Jack likes to buy a bouquet of flowers for his wife on their anniversary, Valentine's Day, and on her birthday. He has been married for 5 years. How many bouquets has he bought total?
def solve() -> int: years_married = 5 anniversary_bouquets = 1 valentines_bouquets = 1 birthday_bouquets = 1 total_bouquets = (anniversary_bouquets + valentines_bouquets + birthday_bouquets) * years_married result = total_bouquets return result
Student: Jane has a glass jar with 80 candies. She gives 2/5 of the candies to her sister and then shares the remaining candies equally with her friends. If she has 5 friends, how many candies does each friend get?
def solve() -> int: candies = 80 sister_candies = 2/5 * candies remaining_candies = candies - sister_candies friend_candies = remaining_candies / 5 result = friend_candies return result
Emma has learned to type much faster than before. Her typing speed has increased by 80 words per minute. How many words can she type in 2 minutes now, if her typing speed was originally 120 words per minute?
def solve() -> int: original_speed = 120 increased_speed = original_speed + 80 time = 2 words_typed = increased_speed * time result = words_typed return result
Charlie has 4 loaves of bread that are each sliced into 10 pieces. He uses 2 pieces of bread for each sandwich. He makes 8 sandwiches for lunch and 6 sandwiches for dinner. How many pieces of bread are left?
def solve() -> int: total_pieces = 4 * 10 used_pieces = 2 * (8 + 6) left_pieces = total_pieces - used_pieces result = left_pieces return result
Student: Engy bought a pair of shoes for $80. She received a 15% discount on the shoes and had to pay an additional 6% sales tax. How much did Engy pay for the shoes, in total?
def solve() -> int: shoes_price = 80 discount_percentage = 15 discount_amount = shoes_price * (discount_percentage/100) tax_percentage = 6 tax_amount = shoes_price * (tax_percentage/100) result = shoes_price - discount_amount + tax_amount return result
The sum of two numbers is 10 and their difference is 2. What are the two numbers?
def solve() -> int: x = 6 y = 4 result = x, y return result
A bakery uses 2.5 pounds of sugar to make 20 cupcakes. How many pounds of sugar will they need to make 30 cupcakes?
def solve() -> int: cupcakes = 30 sugar_per_cupcake = 2.5 / 20 sugar_needed = cupcakes * sugar_per_cupcake result = sugar_needed return result
Amy went to the store to buy a pair of shoes that were on sale for 20% off the regular price of $80. The store also charged an additional 8% sales tax. How much did Amy end up paying for the shoes?
def solve() -> int: discounted_price = 80 * 0.8 price_with_tax = discounted_price * 1.08 result = f'<<<{price_with_tax}>>>' result = price_with_tax return result
A rectangle has a length of 20 cm and a width of 15 cm. What is the perimeter of the rectangle in cm?
def solve() -> int: length = 20 width = 15 perimeter = 2*length + 2*width result = perimeter return result
If a bucket holds 7 litres of water, how many litres are in 8 buckets?
def solve() -> int: total_litres = 7 * 8 result = total_litres return result
Mrs. Green takes a census of the number of flowers in her garden every day. On the second day, she planted 20 more flowers than the previous day. The number of flowers that did not bloom on the second day was double the number that did not bloom on the third day. If there were 500 blooming flowers in total in the first...
def solve() -> int: previous_day_blooming = 0 second_day_blooming = 500 / 4 third_day_blooming = 500 / 4 second_day_planted = previous_day_blooming + 20 third_day_planted = second_day_blooming + 20 total_blooming = previous_day_blooming + second_day_blooming + third_day_blooming total_n...
Student: A store offers a 5% discount for every $100 spent. If a customer spends $400, how much will they pay after the discount?
def solve() -> int: amount_spent = 400 discount_rate = 0.05 discount = amount_spent * discount_rate amount_paid = amount_spent - discount result = amount_paid return result
Student: In a backpack, there are 153 items, of which 36 are pencils and 42 are pens. How many items are neither pencils nor pens?
def solve() -> int: total_items = 153 pencils = 36 pens = 42 neither = total_items - pencils - pens result = neither return result
Mike and his family went to a restaurant for dinner. They ordered a $15.00 steak for Mike's dad, a $10.50 pasta for his mom, and two kids' meals for his younger siblings, each priced at $6.00. How much was their final bill?
def solve() -> int: dad_steak = 15.00 mom_pasta = 10.50 kids_meal = 6.00 num_kids_meals = 2 total_bill = dad_steak + mom_pasta + (kids_meal * num_kids_meals) result = total_bill return result
Trey and Elvan both scored in a basketball game. Trey scored 12 more points than Elvan, and together they scored 56. How many points did each of them score?
def solve() -> int: result = 0 et = 0 tt = et+12 total = et + tt while total!= 56: et+=1 tt = et+12 total = et + tt result = et, tt return result
Bill and Matt are playing a game together. Bill gets 7 points for killing an enemy and Matt gets 3 points. If Bill kills at least 100 enemies and Matt kills at least 140 enemies, they both get a 50% bonus to their scores. What is the total score for both if they have killed 150 enemies each?
def solve() -> int: score_bill = 7 * 100 * 1.5 score_matt = 3 * 140 * 1.5 total_score = score_bill + score_matt result = total_score return result
Peter has 24 stickers in his album. His cousin, Lisa, has half as many but later gifts him 12 stickers. How many stickers does Lisa have left?
def solve() -> int: album_stickers = 24 lisa_stickers = album_stickers / 2 lisa_stickers += 12 lisa_stickers_left = lisa_stickers - 12 result = lisa_stickers_left return result
There are 8 oranges in a bag. Three of them are yellow, and two thirds of the rest are ripe. How many ripe oranges are there?
def solve() -> int: total_oranges = 8 yellow_oranges = 3 remaining_oranges = total_oranges - yellow_oranges result = remaining_oranges * 2 / 3 return result
A pizza costs $12 and there is a 10% tax. How much will you pay in total if you order 3 pizzas?
def solve() -> int: cost_per_pizza = 12 num_pizzas = 3 tax_rate = 0.1 sub_total = cost_per_pizza * num_pizzas tax_amount = sub_total * tax_rate total_cost = sub_total + tax_amount result = total_cost return result
A school has 600 students. Of these, 45% are boys and the rest are girls. How many girls are there in the school?
def solve() -> int: total_students = 600 boys_percent = 0.45 girls_percent = 1 - boys_percent girls = girls_percent * total_students result = girls return result
If Greta has 12 marbles and Owen gives her 8 more, how many marbles does Greta have in total?
def solve() -> int: marbles_Greta_original = 12 marbles_Owen_added = 8 result = marbles_Greta_original + marbles_Owen_added return result
A recipe calls for 3 cups of flour, 1 cup of sugar, and 2 eggs. If I want to make 12 cupcakes, how much flour, sugar, and eggs do I need?
def solve() -> int: cupcakes = 12 flour_per_cupcake = 3 / 12 sugar_per_cupcake = 1 / 12 eggs_per_cupcake = 2 / 12 total_flour = cupcakes * flour_per_cupcake total_sugar = cupcakes * sugar_per_cupcake total_eggs = cupcakes * eggs_per_cupcake result = (total_flour, total_sugar, total_eggs)...
Sarah started painting a wall on the first day of June. She painted 20 square feet every day and by the 24th of June, she had painted two-thirds of the wall. How big is the wall?
def solve() -> int: days = 24 - 1 painted_area = (2/3) * (20 * days) wall_area = painted_area / (2/3) result = wall_area return result
At Jack's restaurant, he makes 2 burgers and 3 sandwiches. His restaurant is open from noon to 4:00 p.m. In the first hour, 4 customers order the burgers. In the second hour, 6 customers order sandwiches. In the third hour, 3 customers order the burgers. In the last hour, 5 customers order sandwiches. How many burgers ...
def solve() -> int: burgers_per_hour = 2 sandwiches_per_hour = 3 first_hour_burgers = 4 second_hour_sandwiches = 6 third_hour_burgers = 3 last_hour_sandwiches = 5 total_burgers = first_hour_burgers + third_hour_burgers total_sandwiches = second_hour_sandwiches + last_hour_sandw...