question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Sophie walks from her dorm to the coffee shop. Then she walks, at the same speed, 25 blocks to her friend Emily's apartment. It takes Sophie three times as long to go from her dorm to the coffee shop as it takes to go from the coffee shop to Emily's apartment. If Emily and Sophie now walk back to the coffee shop togeth...
def solve() -> int: dorm_to_coffee = 25/4 coffee_to_apartment = 25/4 total_blocks_walked = (dorm_to_coffee + coffee_to_apartment) * 2 result = total_blocks_walked return result
If the circumference of a circle is 18*pi units, what is the radius of the circle?
def solve() -> int: circumference = 18*3.14 radius = circumference/(2*3.14) result = radius return result
Bob is going on a road trip and needs to fill up his car's gas tank. His car can hold 12 gallons of gas. If he pays $2.75 per gallon, how much will it cost him to fill up his gas tank?
def solve() -> int: gas_price = 2.75 gas_amount = 12 total_cost = gas_price * gas_amount result = total_cost return result
A store sells a pair of socks for $6.50. If Juan bought 8 pairs of socks, how much did he spend in total?
def solve() -> int: cost_of_each_pair = 6.50 number_of_pairs_bought = 8 total_cost_of_socks = cost_of_each_pair * number_of_pairs_bought result = total_cost_of_socks return result
Emily has 3 hours to complete an assignment. She has completed 30 out of 100 problems. If she keeps up this same pace, how many minutes will she have left when she finishes the assignment?
def solve() -> int: hours_given = 3 problems_completed = 30 total_problems = 100 problems_left = total_problems - problems_completed time_per_problem = hours_given * 60 / total_problems time_left = problems_left * time_per_problem result = time_left return result
The Garcias own a storage facility with 400 storage units. If only 60% of the units are rented at any given time and each unit rents for $100 per month, what is the total revenue the Garcias will generate in a year?
def solve() -> int: units = 400 rented_units = units * 0.6 rental_price = 100 monthly_revenue = rented_units * rental_price annual_revenue = monthly_revenue * 12 result = annual_revenue return result
Student: There are 96 coins and 15% of them are dimes. How many dimes are there?
def solve() -> int: coins = 96 dimes_percent = 15 dimes_decimal = dimes_percent / 100 dimes = coins * dimes_decimal dimes = round(dimes) result = dimes return result
Ann picked 15 flowers from a garden, 8 of the flowers were yellow, 3 were red, and 4 were blue. How many more blue flowers were there than red?
def solve() -> int: number_yellow_flowers = 8 number_red_flowers = 3 number_blue_flowers = 4 number_blue_minus_red = number_blue_flowers - number_red_flowers result = number_blue_minus_red return result
If a book has 250 pages and 1/5 is colored, how many pages in the book are not colored?
def solve() -> int: total_pages = 250 colored_pages = total_pages/5 uncolored_pages = total_pages - colored_pages result = uncolored_pages return result
Student: A pack of markers costs $6. If Tanya wants to buy 9 packs, including tax at a rate of 7.25%, how much does she have to pay in total?
def solve() -> int: pack_cost = 6 packs = 9 tax_rate = 0.0725 subtotal = pack_cost * packs tax = subtotal * tax_rate total = subtotal + tax result = total return result
Student: A square has a perimeter of 24 inches. What is the length of each side of the square?
def solve() -> int: perimeter = 24 side_length = perimeter / 4 result = side_length return result
A faucet is dripping at a rate of 1 ounce of water per minute. After 20 minutes, the faucet is tightened and the rate decreases to 0.5 ounce of water per minute. After another 30 minutes, the faucet is fixed and the dripping stops. How many ounces of water have dripped from the faucet after 60 minutes?
def solve() -> int: water = 0 water = water + 1 * 20 water = water + 0.5 * 30 water = water + 0 * 10 result = water return result
Tony has 72 toy cars. He wants to split them evenly between himself and his two friends. How many cars will be left over?
def solve() -> int: toy_cars = 72 friends = 2 cars_left = toy_cars % (friends+1) result = cars_left return result
The difference between my age and my grandfather's age is 60 years. Ten years ago, my age was one-fifth my grandfather's age. How old am I now?
def solve() -> int: age_difference = -1 age_sum = 60 years_passed = -10 grandfather_age = (age_sum + age_difference*years_passed)/(age_difference - 1) my_age = age_sum - grandfather_age result = int(my_age - years_passed) return result
Emma can complete a 5k in 30 minutes without drinking water. Drinking water increases her time by 10%. How many minutes does it take to complete a 5k with adequate water intake?
def solve() -> int: time = 30 water = time *.10 with_water = time + water result = with_water return result
The basketball team scored a total of 120 points. Jaxon made 3 times more points than his teammate Brian. Brian made 15 points alone. How many points did Jaxon make?
def solve() -> int: brian_points = 15 total_points = 120 jaxon_points = 3 * brian_points total_points_without_jaxon = total_points - brian_points result = (total_points_without_jaxon - jaxon_points) return result
There are 80 birds in a birdhouse which have a mix of canaries, lovebirds and parrots. There were originally 30 canaries and an equal number of lovebirds and parrots. Jack removes a number of birds equal to five times the difference between the number of parrots and the number of lovebirds. How many birds are left in t...
def solve() -> int: canaries = 30 lovebirds = canaries parrots = lovebirds total_birds = canaries + lovebirds + parrots birds_removed = 5 * (parrots - lovebirds) remaining_birds = total_birds - birds_removed result = remaining_birds return result
A company employs 120 people. If 60% of the employees are men and 20% of the employees are over 50 years old, how many men over 50 are employed by the company?
def solve() -> int: total_employees = 120 men_employees = 0.6 * total_employees old_employees = 0.2 * total_employees men_over_50 = 0.6 * 0.2 * total_employees result = men_over_50 return result
Janet ate 25% of the pizza while Brad ate 40% of the same pizza. If the pizza was 16 inches in diameter, how many inches of pizza went uneaten?
def solve() -> int: pizzasize = 16 janeteaten = pizzasize * 0.25 bradeaten = pizzasize * 0.4 uneaten = pizzasize - (janeteaten + bradeaten) result = uneaten return result
Student: Tom has 250 pounds of potatoes and wants to share them among 5 people. How many pounds of potatoes does each person get?
def solve() -> int: potatoes = 250 people = 5 each_person = potatoes / people result = each_person return result
Student: A mobile phone store has a discount of $50 on all models of a brand. If a specific model cost $350 and has a tax of 9%, how much does one need to pay after the discount and tax?
def solve() -> int: cost = 350 discount = 50 tax_rate = 0.09 cost_after_discount = cost - discount tax = cost_after_discount * tax_rate final_cost = cost_after_discount + tax result = final_cost return result
Student: The sum of two numbers is 50. If one of these numbers is 20.5, what is the other number?
def solve() -> int: sum = 50 number1 = 20.5 number2 = sum - number1 result = number2 return result
Anna, Maria, and Diana are measuring the height of trees. During all the measurements they took, Maria measured a tree that was 5 feet taller than Anna's tree, and Anna measured a tree that was 7 feet shorter than Diana's tree. If Anna measured a tree that was 12 feet tall, what was the total height of all three trees?...
def solve() -> int: anna_tree_height = 12 maria_tree_height = anna_tree_height + 5 diana_tree_height = anna_tree_height + 7 total_height = anna_tree_height + maria_tree_height + diana_tree_height tom_shirt_price = 40 tom_jeans_price = 60 discount_percentage = 20 total_pric...
A gardener plants 36 flowers in a rectangular garden bed. He arranges them in 6 rows, with the same number of flowers in each row. The length of the garden bed is 3 meters, and the width is 1.5 meters. What is the area of each flower in the garden bed?
def solve() -> int: area = 3 * 1.5 flowers_per_row = 36 / 6 flower_area = area / 36 result = round(flower_area, 2) return result
Student: Jenna needs to buy 10 bricks for her house. Each brick costs $4.50. How much money does Jenna need to pay for the 10 bricks?
def solve() -> int: num_bricks = 10 price_per_brick = 4.50 total_cost = num_bricks * price_per_brick result = total_cost return result
Max got a loan of $15,000 from a bank at an annual rate of 12%, compounded quarterly for 5 years. After paying off the loan, he invested the same amount in a deposit account that offered a return of 9%, compounded annually. How much money does he have now? At a concert, tickets are sold for $12 each. Three-quarters of ...
def solve() -> int: P = 15000 r = 0.12/4 n = 4*5 A = P*(1+r)**n r = 0.09 n = 5 B = A*(1+r)**n tickets = 4752/12 tshirt = 0.75*tickets*20 poster = 0.2*tickets*6 hotdog = 0.67*tickets*4 total_sales = tickets*12 + tshirt + poster + hotdog result = B + total_sales ...
Mia is 25 years old and her grandfather is 100 years old. In how many years will Mia be half the age of her grandfather?
def solve() -> int: mia_age = 25 grandfather_age = 100 years = 0 while mia_age < (grandfather_age / 2): mia_age += 1 grandfather_age += 1 years += 1 result = years return result
Fanny just made smoothies for her family of 9. Each smoothie requires 2 cups of blueberries, 3 cups of pineapple and 1 cup of peaches. How many cups of total fruit did she need in order to make the smoothies?
def solve() -> int: blueberries = 2 pineapple = 3 peaches = 1 total_fruit = blueberries * 9 + pineapple * 9 + peaches * 9 result = total_fruit return result
A box of candy costs $7.50. If Sandra bought 3 boxes, how much did she spend?
def solve() -> int: cost_per_box = 7.5 num_boxes = 3 total_cost = cost_per_box*num_boxes result = total_cost return result
san is paid $18 per hour and worked 32 hours this week. She also receives a bonus of $50. What is her total pay for the week?
def solve() -> int: hours_worked = 32 hourly_wage = 18 bonus = 50 total_pay = (hours_worked * hourly_wage) + bonus result = total_pay return result
Amy received $4,500 from her aunt and wants to buy a new phone for $1,200. She can pay $700 upfront and the rest over 6 monthly installments. How much does she need to pay every month?
def solve() -> int: amt_received = 4500 phone_cost = 1200 amt_upfront = 700 amt_remaining = phone_cost - amt_upfront num_installments = 6 amt_per_month = amt_remaining / num_installments result = amt_per_month return result
Maria baked 6 cakes for her birthday. In total, she has 36 pieces. She gave away 3 pieces of cake. What is the percentage of her remaining cake?
def solve() -> int: total_cakes = 6 pieces_total = 36 pieces_given = 3 remaining_pieces = pieces_total - pieces_given percentage = (remaining_pieces/pieces_total)*100 result = percentage return result
A company earned $500,000 profit last year. If they spent $250,000 on expenses this year, how much profit did they make this year?
def solve() -> int: last_year_profit = 500000 expenses = 250000 this_year_profit = last_year_profit - expenses result = this_year_profit return result
A car travels at a constant speed of 60 miles per hour. How long, in minutes, will it take the car to cover a distance of 15 miles?
def solve() -> int: distance = 15 speed = 60 time = distance / speed time = time * 60 result = time return result
Jason is 2 feet, 6 inches tall. His younger brother is 2 feet tall. How many inches taller is Jason than his brother?
def solve() -> int: jason_height_feet = 2 jason_height_inches = 6 jason_height_total_inches = jason_height_feet * 12 + jason_height_inches brother_height_feet = 2 brother_height_inches = 0 brother_height_total_inches = brother_height_feet * 12 + brother_height_inches height_differe...
A baseball team is playing a 162-game season. If the team wins 53% of their games, how many games do they win?
def solve() -> int: games_played = 162 win_percentage = 0.53 games_won = int(games_played * win_percentage) result = games_won return result
Oliver has ten full bags of marbles and 8 loose marbles, and his friend has 38 loose marbles. They need to put all of their loose marbles in a jar. How many more jars do they need if Oliver has a total of 205 marbles?
def solve() -> int: oliver_bags = 10 oliver_loose = 8 friend_loose = 38 total_marbles = oliver_bags * 10 + oliver_loose + friend_loose jars_needed = (total_marbles - 205) // 50 + 1 result = jars_needed return result
Tom has 9 tubes of toothpaste with 12 ounces in each tube. How many ounces of toothpaste does Tom have in total?
def solve() -> int: tubes = 9 ounces_per_tube = 12 total_ounces = tubes * ounces_per_tube result = total_ounces return result
Tina consumed 15 pieces of candy and then ate 6 apples. If each apple is equivalent to 3 pieces of candy, how many pieces of candy did she have left?
def solve() -> int: candy_pieces = 15 apple_pieces = 6 candy_per_apple = 3 consumed_candy = candy_pieces + apple_pieces*candy_per_apple result = consumed_candy return result
Michael, Mackenzie and Monica can lift a combined weight of 888 pounds. Michael can lift three times as much as Mackenzie, and Mackenzie can lift 14 pounds less than four times the amount that Monica can lift. How much can Michael lift?
def solve() -> int: mackenzie_weight = 0 monica_weight = 0 michael_weight = 0 monica_weight = 1 mackenzie_weight = 4 * monica_weight - 14 michael_weight = 3 * mackenzie_weight total_weight = monica_weight + mackenzie_weight + michael_weight result = michael_weigh...
Student: Jade was 4 inches taller than Josh. Josh was 6 inches shorter than Jordan. Jordan is 72 inches tall. How many inches tall is Jade?
def solve() -> int: jade_height = 0 josh_height = 0 jordan_height = 72 josh_height = jordan_height - 6 jade_height = josh_height + 4 result = jade_height return result
Student: Mia earned $9 each day walking her neighbor's dog. She is saving to buy a new electric skateboard for $360. She already has $50 saved. If she walks her neighbor's dog 3 days a week, in how many weeks should Mia work to buy her electric skateboard?
def solve() -> int: daily_earnings = 9 skateboard_cost = 360 saved_amount = 50 days_per_week = 3 total_earnings = daily_earnings * days_per_week total_cost = skateboard_cost - saved_amount weeks_needed = total_cost // total_earnings result = weeks_needed return result
Student: How many minutes will it take Jaden to wash the car if it takes him 9 minutes to do half of the job?
def solve() -> int: time_for_half_job = 9 total_time = time_for_half_job * 2 result = total_time return result
Jeremy is claiming damages from a motorcycle accident caused by faulty equipment. He's asking for $35,000 in medical bills, $20,000 in lost wages, and $50,000 in physical and emotional distress. He wants $75,000 in punitive damages. If he gets 85% of what he asks for, how much money will he receive? Hannah enjoys going...
def solve() -> int: medical_bills = 35000 lost_wages = 20000 distress = 50000 punitive_damages = 75000 total_claim = medical_bills + lost_wages + distress + punitive_damages amount_received = total_claim * 0.85 result = amount_received distance_to_trail = 50 dista...
You invest $5000 in a savings account that guarantees an annual interest rate of 3%. How much money will you have after 10 years?
def solve() -> int: initial_investment = 5000 interest_rate = 0.03 num_years = 10 future_value = initial_investment * ((1 + interest_rate) ** num_years) result = future_value return result
A bus travels at a speed of 50 miles per hour. If it travels for 3 hours, how far does it go?
def solve() -> int: speed = 50 time = 3 distance = speed * time result = distance return result
Sarah has a garden of 60 plants. 1/3 of these plants are sunflowers. If she also has another garden with 80 plants and 50% of these plants are sunflowers, what percentage of all the plants she has are sunflowers?
def solve() -> int: garden1_plants = 60 garden1_sunflowers = garden1_plants * (1/3) garden2_plants = 80 garden2_sunflowers = garden2_plants * (50/100) total_plants = garden1_plants + garden2_plants total_sunflowers = garden1_sunflowers + garden2_sunflowers percentage_sunflower...
Jaden went to the store and saw that apples were twice as expensive than oranges. He bought 6 apples and 8 oranges. If he spent a total of $20, how much was each fruit?
def solve() -> int: apples_each = 0 oranges_each = 0 total_apple = 6 * apples_each total_orange = 8 * oranges_each total_cost = total_apple + total_orange apples_each = total_cost / 6 oranges_each = total_cost / 8 result = apples_each + oranges_each return result
Arnav wants to create a sandwich. He can choose one type of bread from 5 options. For meat, he has 3 options and for toppings, he has 7 options. He can only select one type of bread, one type of meat, and one topping. However, if he chooses ham, he cannot have bacon. How many different sandwich combinations are there f...
def solve() -> int: bread_options = 5 meat_options = 3 topping_options = 7 total_combinations = bread_options * meat_options * topping_options ham_no_bacon_combinations = (bread_options - 1) * (meat_options - 1) * topping_options restricted_combinations = total_combinations - ham_...
A store sells 5 t-shirts of a particular brand for $35. How much will 15 shirts of the same brand cost?
def solve() -> int: num_shirts = 15 shirt_price = (35/5) * num_shirts result = shirt_price return result
Josh has 10 pens worth $5 each. He trades 3 of them to Alex in exchange for 2 pens worth $7 each and 1 pen worth $3. How much profit did he make?
def solve() -> int: pen_price = 5 josh_pen_num = 10 alex_pen_num = 3 alex_pen_price_1 = 7 alex_pen_price_2 = 3 profit1 = (josh_pen_num - alex_pen_num) * pen_price profit2 = (2 * alex_pen_price_1) + (1 * alex_pen_price_2) result = profit1 + profit2 return result
Student: A recipe calls for 2.5 cups of flour to make 12 cookies. How many cups of flour will be needed to make 48 cookies?
def solve() -> int: ratio = 2.5 / 12 cookies = 48 flour = ratio * cookies result = flour return result
Kurt won a poetry contest and received 1/3 of the prize money. After spending 1/8 of his prize money, Kurt was left with $500. How much was the prize money in the poetry contest? The bakery sells croissants for $1 and bagels for $3. They sold $28 in baked goods. If they sold 7 croissants, how many bagels did they sell?
def solve() -> int: kurt_prize = 0.0 total_prize = 0.0 kurt_prize = total_prize / 3 amount_spent = kurt_prize / 8 remaining_amount = kurt_prize - amount_spent total_amount = remaining_amount * 3 result = total_amount croissants_sold = 7 return ...
Adam has 2 dogs, and each dog needs to be walked twice a day for 30 minutes each. Additionally, he is dog-sitting for his neighbor's dog, which needs to be walked for 1 hour each day. How many minutes does Adam spend walking dogs each day?
def solve() -> int: dogs = 2 walks_per_day = 2 minutes_per_walk = 30 neighbor_dog_walk = 1 total_minutes = (dogs * walks_per_day * minutes_per_walk) + (neighbor_dog_walk * 60) result = total_minutes return result
A factory produces 2000 pencils a day. If they sell 85% of their pencils, how many pencils are left unsold?
def solve() -> int: pencils_produced = 2000 pencils_sold = pencils_produced * 0.85 pencils_unsold = pencils_produced - pencils_sold result = pencils_unsold return result
A car travels 240 miles in 4 hours. If it travels at this rate, how far would it travel in 8 hours?
def solve() -> int: velocity = 240 / 4 distance = velocity * 8 result = distance return result
Mark wants to buy toys for his children. He has 4 children and wants to spend the exact same amount on each. He buys his youngest child 6 stuffed animals that cost $7 each. He plans to buy board games for his older children. They cost $30 each. How many board games does he need to buy?
def solve() -> int: num_children = 4 stuffed_animal_cost = 7 num_stuffed_animals = 6 total_stuffed_animal_cost = stuffed_animal_cost * num_stuffed_animals total_spending_per_child = total_stuffed_animal_cost / num_children board_game_cost = 30 num_board_games = total...
Emily's car had a fuel efficiency of 30 miles per gallon initially. After a tune-up, it doubled its fuel efficiency in the next 2 weeks, and tripled its fuel efficiency at the next maintenance. After another tune-up, it quadrupled its fuel efficiency, and it finally reached its full fuel efficiency by getting another 2...
def solve() -> int: initial_efficiency = 30 two_weeks_efficiency = initial_efficiency * 2 maintenance_efficiency = two_weeks_efficiency * 3 second_tune_up_efficiency = maintenance_efficiency * 4 full_efficiency = second_tune_up_efficiency + 20 result = full_efficiency return result...
Student: Alex buys 36 oranges. He eats 4 oranges per week. Each week he gives 3 to his mom and 2 to his dad. How many weeks will the oranges last?
def solve() -> int: oranges = 36 oranges_eaten_per_week = 4 oranges_given_per_week = 3 + 2 weeks = oranges // (oranges_eaten_per_week + oranges_given_per_week) result = weeks return result
Student: Jake bought 4 cookies for $2 each. He gave Jane 2 of them in exchange for 3 cookies worth $2.50 each. How much profit did Jake make?
def solve() -> int: cookies_bought = 4 price_bought = 2 cookies_given = 2 price_given = 2.50 total_spent = cookies_bought * price_bought total_received = cookies_given * price_given profit = total_received - total_spent result = profit return result
Student: A factory consumes 10 liters of fuel in three hours. How much will it consume in twelve hours?
def solve() -> int: fuel_consumption_3h = 10 time_3h = 3 time_12h = 12 fuel_consumption_12h = fuel_consumption_3h * (time_12h / time_3h) result = fuel_consumption_12h return result
Ryan has a collection of baseball cards. In his card collection, he has twice as many rookie cards as All-Star cards. If he trades away 15 All-Star cards and now has a total of 75 rookie and All-Star cards, how many rookie cards does he have?
def solve() -> int: all_star_cards = 75 - 15 rookie_cards = 2 * all_star_cards result = rookie_cards return result
A classroom has thrice as many students as teachers and each teacher has 20 students. There are 10 teachers, how many students are there in the classroom?
def solve() -> int: students_per_teacher = 20 total_teachers = 10 total_students = total_teachers * students_per_teacher * 3 result = total_students return result
Mark bought 20 boxes of chocolates. He gave 3/10 of them to his colleagues. If each box has 12 chocolates, how many chocolates are left with Mark?
def solve() -> int: boxes_of_chocolates = 20 chocolates_per_box = 12 colleagues_share = 3/10 total_chocolates = boxes_of_chocolates * chocolates_per_box colleagues_chocolates = total_chocolates * colleagues_share mark_chocolates = total_chocolates - colleagues_chocolates result = m...
A store has a sale with 20% off all merchandise. If a shirt normally costs $25, what is the sale price of the shirt?
def solve() -> int: normal_price = 25 discount_percentage = 20 sale_price = normal_price - (normal_price*discount_percentage/100) result = sale_price return result
Harry's golf team scored 1440 strokes in the season. There are 8 players on the team. If 4 of them averaged 240 strokes each, how many strokes did the remainder average?
def solve() -> int: total_strokes = 1440 players = 8 average_4 = 240 total_4 = average_4 * 4 remaining_strokes = total_strokes - total_4 remaining_players = players - 4 average_remaining = remaining_strokes / remaining_players result = average_remaining retu...
Mary got 82, 90, 88 and 94 on her first four tests. She wants to get an average of 90 on her 5 quizzes. What score should she get on her fifth quiz to get a 90 average?
def solve() -> int: mary_grades = [82, 90, 88, 94] avg_goal = 90 num_quizzes = 5 sum_grades = sum(mary_grades) sum_goal = avg_goal * num_quizzes goal_score = sum_goal - sum_grades result = goal_score return result
A bakery made 200 cupcakes and sold them for $2 each. Their total revenue was $350. How many more cupcakes would they need to sell at $2 each to make a total of $500 in revenue?
def solve() -> int: num_cupcakes = 200 price_per_cupcake = 2 total_revenue = 350 revenue_goal = 500 current_revenue = num_cupcakes * price_per_cupcake additional_revenue_needed = revenue_goal - current_revenue additional_cupcakes_needed = additional_revenue_needed / price_per_cupcake res...
A car travels at a constant speed of 60 km/h. How far will it travel in 2 hours and 15 minutes?
def solve() -> int: time = 2 + 15 / 60 distance = 60 * time result = distance return result
An urn contains 5 red balls and 3 blue balls. One ball is drawn at random and not replaced. Then a second ball is drawn at random. What is the probability that the first ball drawn was red and the second ball drawn was blue?
def solve() -> int: total_balls = 8 red_balls = 5 blue_balls = 3 numerator = red_balls*blue_balls result = numerator/(total_balls*(total_balls-1)) return result
A garden hose fills a 60 gallon tank in 1 hour and 20 minutes. If the hose runs at the same rate, how long does it take to fill a 180 gallon tank?
def solve() -> int: rate = 60 / (60+20) time = 180 / rate result = round(time, 2) return result
A computer screen is 24 inches by 18 inches. There are 100 dots per inch. How many total pixels are there?
def solve() -> int: width = 24 height = 18 dpi = 100 width_pixels = width * dpi height_pixels = height * dpi result = width_pixels * height_pixels result return result
A box has a volume of 48 cubic inches. One side of the box measures 4 inches. What are the other two dimensions of the box?
def solve() -> int: volume = 48 side1 = 4 side2 = volume / side1**2 side3 = volume / (side1 * side2) result = (side2, side3) return result
A box of chocolates costs $6 and a dozen red roses costs $24. David spent all his money buying 1 box of chocolates and as many dozens of roses as he could. He originally had $90. How much money did David have left after shopping?
def solve() -> int: money_spent = 6 + (24 * (90 // 24)) left_money = 90 - money_spent result = left_money return result
A toy factory needs to package 5000 toys. Each package contains 10 toys and takes 2 minutes to prepare. How many hours will it take to package all the toys if there are 5 workers working together?
def solve() -> int: toys_per_package = 10 total_toys = 5000 time_per_package = 2 workers = 5 total_packages = total_toys / toys_per_package total_time = total_packages * time_per_package total_hours = total_time / 60 / workers result = total_hours return result
There are 20 students in the classroom and each student has 8 books. How many books are present in the classroom in total?
def solve() -> int: number_of_books = 20 * 8 result = number_of_books return result
6. Jill was running a marathon and she ran a total of 42 kilometers. She started at the first marker and ran 4 kilometers before reaching the second marker. How many kilometers did she run between the first and second markers?
def solve() -> int: total = 42 marker_1 = 4 distance = total - marker_1 result = distance return result
Jeff and Mark shared a $10 movie ticket. How much should each person pay if they split the cost equally?
def solve() -> int: total_cost = 10 result = total_cost / 2 return result
Leo is buying books for his class. He needs 15 copies of the same book, and each book costs $12. He has a coupon that gives him 20% off his total purchase. He also has to pay 7% sales tax on the final amount. How much does he pay for the books?
def solve() -> int: copies = 15 book_price = 12 discount_rate = 0.2 tax_rate = 0.07 subtotal = copies * book_price discount = subtotal * discount_rate total_after_discount = subtotal - discount tax = total_after_discount * tax_rate final_amount = total_after_discount + tax result...
In three chess tournaments this week, 50 people participated in the first tournament while 10 fewer people participated in the second tournament than the first tournament. Then 5 more people participated in the third tournament than the second tournament. If each participant paid $20 to enter the tournament, how much m...
def solve() -> int: first = 50 second = first - 10 third = second + 5 total = first + second + third money = total * 20 result = money return result
On Thursday, Abdullah bought 168 oranges from the market. He gave 18 to his neighbor, and had 7 times as many oranges left. How many oranges did he have left in the end?
def solve() -> int: n_start = 168 n_end = n_start - 18 n_left = n_end // 7 result = n_left return result
A lumberjack has 12 logs in 60cm length. He cut them into pieces with the same length. Two thirds of the pieces are 40cm long while the rest are 20cm. How many 20cm pieces did he cut?
def solve() -> int: total_logs = 12 pieces_forty = total_logs * 2 / 3 result = total_logs - pieces_forty return result
A garden has 30 roses and 40 tulips. If 15 roses are removed, how many more tulips are there than roses remaining in the garden?
def solve() -> int: roses = 30 tulips = 40 roses_left = roses - 15 tulips_more_than_roses = tulips - roses_left result = tulips_more_than_roses return result
Lucas ordered pizza for a party. On the first day, he ordered 50 pizzas, and on the second day, he ordered twice the number of pizzas he ordered on the first day. If his friends also ordered pizza on the second day and the total pizzas ordered on both days were 300, how many pizzas did his friends order on the second d...
def solve() -> int: first_day_pizzas = 50 second_day_pizzas = first_day_pizzas * 2 total_pizzas = 300 friends_second_day = total_pizzas - (first_day_pizzas + second_day_pizzas) result = friends_second_day return result
A person drives for 120 minutes at a speed of 50 miles per hour and then drives for another 60 minutes at a speed of 30 miles per hour. What is the total distance traveled by the person?
def solve() -> int: speed1 = 50 time1 = 2 speed2 = 30 time2 = 1 distance1 = speed1 * time1 distance2 = speed2 * time2 total_distance = distance1 + distance2 result = total_distance return result
Jacob has two types of shirts. He has 60% of shirt A and 40% of shirt B. Each shirt A has buttons, and only 75% of them are stitched properly. Each shirt B has a zipper and 80% of them work perfectly. If Jacob has to pack 96 shirts in a month, how many are of shirt type A?
def solve() -> int: shirt_A_percentage = 60 shirt_B_percentage = 40 shirt_A_buttons_percentage = 75 shirt_B_zipper_percentage = 80 total_shirts = 96 shirt_A_count = (shirt_A_percentage / 100) * total_shirts shirt_B_count = (shirt_B_percentage / 100) * total_shirts shirt_A_butto...
Hayley has 6 cartons of eggs. In a carton, there are 12 eggs. She will use 17 eggs for making scrambled eggs and French toast. How many eggs will she have left for making boiled eggs?
def solve() -> int: cartons = 6 eggs_per_carton = 12 used_eggs = 17 total_eggs = cartons * eggs_per_carton left_eggs = total_eggs - used_eggs result = left_eggs return result
Every time John lifts 10 weights, he sweats 1 drop. He plans to lift 100 weights, how many drops of sweat will he produce?
def solve() -> int: weights_lifted = 100 drops_per_weight = 1/10 total_drops = weights_lifted * drops_per_weight result = total_drops return result
A garden is 10 feet long and 6 feet wide. If a bag of soil covers 5 square feet, how many bags of soil are needed to cover the garden?
def solve() -> int: garden_area = 10 * 6 bags_needed = garden_area/5 result = bags_needed return result
A person spent 20% of their monthly salary on food, 25% on rent, 12.5% on insurance, and 15% on shopping. If their monthly salary is $4000, how much did they spend on shopping?
def solve() -> int: monthly_salary = 4000 fraction_food = 0.20 fraction_rent = 0.25 fraction_insurance = 0.125 fraction_shopping = 0.15 amount_food = monthly_salary * fraction_food amount_rent = monthly_salary * fraction_rent amount_insurance = monthly_salary * fraction_insurance amo...
At the gym, there are three times as many weight machines as there are treadmills. But there are one-fifth as many stationary bikes as there are treadmills. If there are 10 stationary bikes, how many weight machines are at the gym?
def solve() -> int: treadmills = 10 stationary_bikes = 10 weight_machines = 3 * treadmills weight_machines = weight_machines - (1/5) * stationary_bikes result = weight_machines return result
The population of a city grows by 5% per year. If the population of a city is 26,000, what will it be after 3 years?
def solve() -> int: init_pop = 26000 gr_rate = 0.05 end_pop = init_pop for i in range(3): end_pop *= (1+gr_rate) result = end_pop return result
Student: A car dealership has 50 cars in stock and they plan to sell them over a period of 8 weeks. What is the minimum number of cars they need to sell each week to clear their stock?
def solve() -> int: cars_in_stock = 50 weeks = 8 minimum_cars_per_week = cars_in_stock / weeks result = minimum_cars_per_week return result
A pack of hot dogs contains 8 hot dogs and costs $3.00. A pack of buns contains 12 buns and costs $2.50. Tom is having a barbecue for 15 people. He wants to make sure everyone gets one hot dog and one bun. How many packs of hot dogs and buns does he need to buy and how much does he spend in total?
def solve() -> int: packs_hotdogs = 15 // 8 + 1 packs_buns = 15 // 12 + 1 cost_hotdogs = packs_hotdogs * 3 cost_buns = packs_buns * 2.5 cost_total = cost_hotdogs + cost_buns result = packs_hotdogs, packs_buns, cost_total return result
Kelly had 90 cookies in her jar on Monday. She gave 35 cookies to her friends. On Tuesday, 20 cookies were given back to her but she gave away 5 cookies. Later, she bought 18 more cookies and put them in her jar. How many cookies does Kelly have now?
def solve() -> int: cookies_in_jar = 90 cookies_given_to_friends = 35 cookies_given_back = 20 cookies_given_away = 5 cookies_bought = 18 cookies_in_jar -= cookies_given_to_friends cookies_in_jar += cookies_given_back cookies_in_jar -= cookies_given_away cookies_in_jar += cookies...
Jane drank 2 cups of water every hour for 8 hours straight. How many cups of water did Jane drink in total?
def solve() -> int: cups_per_hour = 2 hours = 8 total_cups = cups_per_hour * hours result = total_cups return result
Maria buys 3 types of fruits from the market. 5 apples cost $2, 4 oranges cost $3, and 2 bananas cost $1. If her total bill amounts to $10, how much did she pay per fruit on average?
def solve() -> int: apples_cost = 2/5 oranges_cost = 3/4 bananas_cost = 1/2 total_apples_cost = 5 * apples_cost total_oranges_cost = 4 * oranges_cost total_bananas_cost = 2 * bananas_cost total_cost = total_apples_cost + total_oranges_cost + total_bananas_cost total_fruits...
**** Jessica collects 8 leaves per hour. She collects for 1.5 hours on Monday, 20 minutes on Tuesday, 1 hour on Wednesday, and 35 minutes on Thursday. How many leaves did she collect in total?
def solve() -> int: speed = 8 Monday = 1.5 Tuesday = 0.33 Wednesday = 1 Thursday = 0.58 leaves = speed * (Monday + Tuesday + Wednesday + Thursday) result = leaves return result
A recipe calls for 2 cups of sugar, 3 cups of flour, and 1 cup of milk. Write a program to calculate the total amount of ingredients needed to make 6 batches of this recipe.
def solve() -> int: sugar_per_batch = 2 flour_per_batch = 3 milk_per_batch = 1 total_batches = 6 total_sugar = sugar_per_batch * total_batches total_flour = flour_per_batch * total_batches total_milk = milk_per_batch * total_batches result = f'<<<{total_sugar + total_flour + total_mil...
arah saved $1.50 last week. She wants to buy a dress that costs $25. How much money must she save each week in order to pay for the dress in 5 weeks?
def solve() -> int: dress_price = 25 saved_so_far = 1.5 weeks_left = 5 target_amount = dress_price - saved_so_far savings_per_week = target_amount/weeks_left result = savings_per_week return result