question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Jack and his three colleagues go to a restaurant. Beef entrees are $32, and chicken entrees are $26. If Jack wants to leave a 20% tip to the server, how much would it be?
def solve() -> int: beef_entree_price = 32 chicken_entree_price = 26 num_people = 4 tip_percentage = 0.2 total_cost = (beef_entree_price + chicken_entree_price) * num_people tip_amount = total_cost * tip_percentage total_cost_with_tip = total_cost + tip_amount result = total_co...
Emily won a prize of $24000 and wanted to use it wisely. She used 30% of the amount to pay off her credit card bills and then donated 10% to charity. She saved $3000 and invested one-fifth of the remaining amount in the stock market. How much money does Emily have available for taking a vacation?
def solve() -> int: prize = 24000 credit_card_bills = prize * 0.3 remaining_amount = prize - credit_card_bills donation = remaining_amount * 0.1 remaining_amount -= donation savings = 3000 remaining_amount -= savings stock_market = remaining_amount * 0.2 remaining_amount -= stock_mar...
You have 3 apples. You give away 1 apple and then receive 2 more. How many apples do you have now?
def solve() -> int: apples = 3 apples -= 1 apples += 2 result = apples return result
Student: John has 8 textbooks. This is three times as many textbooks as Natasha. How many textbooks does Natasha have?
def solve() -> int: john_textbooks = 8 natasha_textbooks = john_textbooks / 3 result = natasha_textbooks return result
Mary has 5 apples and John has twice as many apples as Mary. If Jane has 3 less apples than John, how many apples does Jane have?
def solve() -> int: mary_apples = 5 john_apples = mary_apples * 2 jane_apples = john_apples - 3 result = jane_apples return result
A school has 50 students. Each student is charged $30 for a field trip. How much money will the school make from all the students going on the field trip?
def solve() -> int: num_students = 50 cost_per_student = 30 total_income = num_students * cost_per_student result = total_income return result
A city has a population of 600,000 people. Every year, half of the people move away. After 10 years, how many people will remain in the city?
def solve() -> int: population = 600000 years = 10 for i in range(years): population = population / 2 result = population return result
There are 24 people at a party. If each person gets 2 pieces of pizza, how many pieces of pizza will be needed?
def solve() -> int: people = 24 pizzaPerPerson = 2 totalPizza = people * pizzaPerPerson result = totalPizza return result
Two numbers differ by 12. The difference between their squares is 180. What are the two numbers?
def solve() -> int: difference = 12 square_diff = 180 sum_num = (square_diff + difference**2) / 2 num1 = sum_num + difference / 2 num2 = sum_num - difference / 2 result = f"The two numbers are {num1} and {num2}." return result
A fruit basket has 30 oranges. Every day, 5 oranges are eaten. After 12 days, how many oranges are left in the basket?
def solve() -> int: oranges_in_basket = 30 oranges_eaten_per_day = 5 days_passed = 12 oranges_left = oranges_in_basket - (oranges_eaten_per_day * days_passed) result = oranges_left return result
A restaurant serves 75 burgers per day. On the weekend, the number of burgers sold triples. How many burgers do they sell on a weekend?
def solve() -> int: weekday_burgers = 75 weekend_burgers = weekday_burgers * 3 result = weekend_burgers return result
Laura saves $120 each month. If she manages to save this amount for 3 years, how much money will she have in total?
def solve() -> int: savings_per_month = 120 period = 3 total_savings = savings_per_month * 12 * period result = total_savings return result
Student: - A crafter made 36 bracelets using beads and strings. She used 12 beads and 1 string for each bracelet. She bought 500 beads and 60 strings from the store. How many more bracelets can she make with the remaining materials, assuming she uses the same amount of beads and strings for each bracelet?
def solve() -> int: bracelets = 36 beads_per_bracelet = 12 string_per_bracelet = 1 beads_bought = 500 strings_bought = 60 beads_used = bracelets * beads_per_bracelet strings_used = bracelets * string_per_bracelet beads_left = beads_bought - beads_used strings_left = strings_b...
Ava is organizing a potluck dinner for her 4 coworkers and their spouses. She is also bringing enough food for herself and the 2 other hosts to eat as well. If there are 12 dishes for everyone to share and each dish has 8 servings, when they evenly distribute all of the food among everyone, how many servings does each ...
def solve() -> int: num_couples = 4 num_hosts = 3 num_people = num_couples * 2 + num_hosts num_dishes = 12 num_servings_per_dish = 8 total_servings = num_dishes * num_servings_per_dish servings_per_person = total_servings / num_people result = servings_per_person return res...
Lisa has $30. She wants to buy some lemons for $0.25 each and some limes for $0.15 each. After buying the fruits, she has $20 left. How many limes did she buy?
def solve() -> int: budget = 30 lemon_price = 0.25 lime_price = 0.15 remaining_budget = 20 total_fruit_cost = budget - remaining_budget total_lemon_cost = total_fruit_cost - (total_fruit_cost // 3) * 3 * lime_price total_lime_cost = total_fruit_cost - total_lemon_cost num_limes...
A swimming pool can hold 50,000 liters of water. If 500 liters of water evaporates every day, how long will it take to empty the pool?
def solve() -> int: days = 50000/500 result = days return result
A store gave a discount of 15% on an item and then charged 5% sales tax on its reduced price. If the final price paid was $75, what was the original price of the item?
def solve() -> int: final_price = 75 percentage_discount = 15 percentage_sales_tax = 5 reduced_price = final_price / ((100 + percentage_sales_tax)/100) original_price = reduced_price / ((100 - percentage_discount)/100) result = original_price return result
Zeke sold 80 DVDs for $10 each. He had to spend $300 for the stock of DVDs. How much profit, in dollars, did he make from the sales?
def solve() -> int: number_of_dvds_sold = 80 sell_price_per_dvd = 10 cost_for_stock = 300 profit = (number_of_dvds_sold * sell_price_per_dvd) - cost_for_stock result = profit return result
Student: A pizza place has 100 boxes of pizza. They sold 3/5 of it yesterday, and 1/4 of the remaining today. How many boxes of pizza are left?
def solve() -> int: boxes_of_pizza = 100 sold_yesterday = 3/5 * boxes_of_pizza sold_today = 1/4 * (boxes_of_pizza - sold_yesterday) result = boxes_of_pizza - sold_yesterday - sold_today return result
If it takes 6 people 9 hours to build a house, how long will it take 8 people to build the same house?
def solve() -> int: time_to_build = 0 number_of_people_1 = 6 number_of_people_2 = 8 time_to_build = (number_of_people_1 * 9) / number_of_people_2 result = time_to_build return result
A jar of jelly beans has 15 blue beans, twice as many pink beans as blue beans, and 5 less yellow beans than pink beans. How many jelly beans are there in the jar?
def solve() -> int: blue = 15 pink = blue * 2 yellow = pink - 5 total = blue + pink + yellow result = total return result
Student: At a certain temperature, a bacterial culture of E.coli has an initial population of 5,000 cells and an increase rate of 300 cells per hour. What is the total population of E.coli after 16.5 hours?
def solve() -> int: initial_population = 5000 increase_rate = 300 total_population = initial_population + increase_rate * 16.5 result = total_population return result
amantha went shopping for clothes and bought 2 dresses for $50 each and 1 pair of shoes for $60. She also bought earrings for $15. How much did she spend in total?
def solve() -> int: num_dresses = 2 cost_per_dress = 50 cost_shoes = 60 cost_earrings = 15 result = (num_dresses * cost_per_dress) + cost_shoes + cost_earrings return result
Lara has $23.19 in her wallet. She spent $5.67 buying candies, $2.98 on a magazine, and $3.45 on a drink. How much money does she have left?
def solve() -> int: initial_money = 23.19 candies = 5.67 magazine = 2.98 drink = 3.45 remaining_money = initial_money - candies - magazine - drink result = remaining_money return result
Alex saves 30% of his monthly income towards his savings account. If he wants to save 50% of his monthly income, how much does he need to increase his monthly income by?
def solve() -> int: monthly_income = 5000 savings_percentage = 0.3 savings_amount = monthly_income * savings_percentage new_savings_percentage = 0.5 new_savings_amount = monthly_income * new_savings_percentage difference = new_savings_amount - savings_amount increase_percentage = difference ...
A water tank can hold 600 liters of water. It is filled with 450 liters of water and then drained at a rate of 15 liters per minute. How long will it take to empty the tank completely?
def solve() -> int: time_to_empty = 450 / 15 result = time_to_empty return result
Mary has a total of $100. She spends two-fifths of it in a store, and then later gives 20% of the remaining money to her friend. How much money does Mary have left now?
def solve() -> int: total_money = 100 money_spent = total_money * 2/5 remaining_money = total_money - money_spent money_given_to_friend = remaining_money * 20/100 money_left = remaining_money - money_given_to_friend result = money_left return result
Student: A company had a revenue of $500,000 in 2019 and $600,000 in 2020. What is the percentage increase in revenue from 2019 to 2020?
def solve() -> int: revenue_2019 = 500000 revenue_2020 = 600000 difference = revenue_2020 - revenue_2019 percentage_increase = (difference / revenue_2019) * 100 result = percentage_increase return result
A book has 240 pages. If Jack reads 30 pages every day, how many days will he need to finish the book?
def solve() -> int: total_pages = 240 pages_per_day = 30 total_days = total_pages / pages_per_day result = total_days return result
Michael and his two friends decided to equally split the cost of 10 burgers. Michael's mom bought the burgers, 5 bottles of water that cost $1 per bottle, and a packet of fries that costs $4. If Michael's mom paid a total of $36 for the groceries, how much should Michael and his friends pay for each burger?
def solve() -> int: num_burgers = 10 cost_water = 1 num_water = 5 cost_fries = 4 total_cost = 36 cost_burgers = total_cost - (num_water * cost_water) - cost_fries cost_per_burger = cost_burgers / num_burgers result = cost_per_burger return result
A car rental agency charges $50 per day, plus $0.20 per mile driven. If you rent the car for 3 days and drive 100 miles, what is the total cost?
def solve() -> int: rental_cost_per_day = 50 miles_driven = 100 cost_per_mile = 0.2 num_days_rented = 3 total_rental_cost = (rental_cost_per_day * num_days_rented) + (miles_driven * cost_per_mile) result = total_rental_cost return result
A car can travel 360km on 30L of petrol. How many liters of petrol does the car need to travel 270km?
def solve() -> int: km_per_liter = 360/30 distance = 270 liters_needed = distance/km_per_liter result = round(liters_needed, 2) return result
A car is traveling at a speed of 80 km/h, how many hours will it take to cover a distance of 360 km?
def solve() -> int: speed = 80 distance = 360 time = distance/speed result = time return result
Ronald can lift 1.6 times more than he weighs. His sister weighs a third as much as Ronald and can lift four times her own weight off the ground. If Ronald can lift 400 pounds, how much can his sister lift?
def solve() -> int: weight_Ronald = 400 / 1.6 weight_sister = weight_Ronald / 3 result = weight_sister * 4 return result
Justin has one fourth the number of cards that Owen has. If Justin has 45 cards, how many cards does Owen have?
def solve() -> int: num_justin = 45 num_owen = num_justin*4 result = num_owen return result
Olivia wants to make cupcakes for a bake sale. The recipe calls for 2 cups of flour to make 12 cupcakes. If she wants to make 60 cupcakes, how many cups of flour does she need?
def solve() -> int: num_cupcakes = 60 flour_per_cupcake = 2/12 flour_needed = flour_per_cupcake * num_cupcakes result = flour_needed return result
If Jill can pot 20 plants in 2 hours, how many plants can she pot in 6 hours?
def solve() -> int: plants_potted = 20 time_taken = 2 hours_needed = 6 plants_potted_in_6_hours = plants_potted * hours_needed / time_taken result = plants_potted_in_6_hours return result
John needs 1 pound of ground beef and 1 onion to make 4 burgers. Ground beef costs $3.00 per pound while onion costs $0.75 each. He has a coupon of $0.50 for one pound of ground beef. If he made 12 burgers, what is the cost per burger?
def solve() -> int: ground_beef_price = 3.00 onion_price = 0.75 coupon = 0.50 pounds_of_ground_beef_needed = 1 onions_needed = 1 burgers_made = 12 total_cost = (pounds_of_ground_beef_needed * (ground_beef_price - coupon)) + (onions_needed * onion_price) cost_per_burger = total_cost ...
Three numbers are in the ratio 2:3:5. If the second number is 21, find the sum of all three numbers.
def solve() -> int: ratio_sum = 2 + 3 + 5 ratio_value = 3 value = 21 second_value_ratio = ratio_sum - ratio_value second_value = second_value_ratio / 3 first_value = (2/3) * second_value third_value = (5/3) * second_value total_sum = first_value + second_value + third_value result = ...
A rectangular box has a length that is twice its width and a height that is 1 less than the length. If the total surface area of the box is 192 square units, what is the width of the box?
def solve() -> int: length = 16 height = 15 total_surface_area = 192 width = (total_surface_area - 2*length*height)/(2*length + 2*height) result = width return result
Student: A school has 8 classes, each with 30 students. The school organizes a field trip and rents 5 buses. Each bus can fit 48 passengers. How many students, in total, can go on the field trip?
def solve() -> int: num_classes = 8 students_per_class = 30 num_buses = 5 capacity_per_bus = 48 total_students = num_classes * students_per_class total_capacity = num_buses * capacity_per_bus result = min(total_students, total_capacity) return result
If 2 workers can paint a house in 10 days, how many days would it take for 3 workers to paint the same house?
def solve() -> int: num_days = (2/3)*10 result = num_days return result
Emily and Peter work for a pizza delivery company, delivering pizzas to different neighborhoods in their city. They are paid $5 for each delivery made in a day. In a particular month, Emily delivered 80 pizzas while Peter delivered 2/3 times as many pizzas as Emily. Calculate their difference in pay that month.
def solve() -> int: emily_pizzas = 80 peter_pizzas = (2/3) * emily_pizzas emily_pay = emily_pizzas * 5 peter_pay = peter_pizzas * 5 pay_difference = emily_pay - peter_pay result = pay_difference return result
John has 100 Lego blocks, 60% of them are blue and the rest are red. If he wants to make a tower of 20 blocks, what is the probability that at least 2 of the blocks will be red?
def solve() -> int: total_blocks = 100 red_blocks = total_blocks * 0.4 blue_blocks = total_blocks * 0.6 p_not_red = red_blocks/total_blocks p_two_red = (red_blocks/total_blocks) * ((red_blocks-1)/(total_blocks-1)) p_three_red = (red_blocks/total_blocks) * ((red_blocks-1)/(total_blocks-1)) * ((re...
Max wants to become an architect. He spent 4 years studying architecture in college and then did a year-long apprenticeship program at an architectural firm. He then spent another 3 years getting his master's degree in architecture. How many years in total did Max spend studying to become an architect?
def solve() -> int: years_college = 4 years_apprenticeship = 1 years_masters = 3 total_years = years_college + years_apprenticeship + years_masters result = total_years return result
Tara needs to pack a box with 60 pencils and 39 markers. If she decides to pack twice as many pencils as markers, calculate the total number of pencils she needs to pack?
def solve() -> int: totalItems = 60 + 39 markers = 39 pencils = 2 * markers totalPencils = totalItems - markers result = totalPencils return result
On day 1, Samantha ran 1 mile. Every day thereafter, she ran 1 mile more than the previous day. How many miles did she run on day 20?
def solve() -> int: miles_day1=1 miles_day2=2 miles_day3=3 miles_day4=4 miles_day5=5 miles_day6=6 miles_day7=7 miles_day8=8 miles_day9=9 miles_day10=10 miles_day11=11 miles_day12=12 miles_day13=13 miles_day14=14 miles_day15=15 miles_day16=16 miles_day1...
Gina is buying presents for her 9 friends and each present has a cost of $27. How much money does Gina need in total for her presents?
def solve() -> int: number_of_friends = 9 cost_per_present = 27 total_cost = number_of_friends*cost_per_present result = total_cost return result
Student: John can run 2 miles in 15 minutes. How long does it take him to run 6 miles at the same pace?
def solve() -> int: miles = 2 minutes = 15 target = 6 pace = minutes / miles time = pace * target result = time return result
Sophie wants to purchase a new dress that costs $65.00. The store is offering a 20% discount. She is also charged a 10% tax rate. How much will it cost for Sophie to purchase the dress?
def solve() -> int: price = 65.00 discount = 0.20 tax_rate = 0.10 discount_amount = price * discount price_after_discount = price - discount_amount tax_amount = price_after_discount * tax_rate final_price = price_after_discount + tax_amount result = final_price ...
A ship left Seattle and took 4 hours to get to San Francisco. It then took 4 times as long to get from San Francisco to San Diego. Calculate the total time it took for the ship to complete its journey.
def solve() -> int: time_to_seattle_san_francisco = 4 time_to_san_francisco_san_diego = 16 time_to_seattle_san_diego = time_to_seattle_san_francisco + time_to_san_francisco_san_diego result = time_to_seattle_san_diego return result
A store sells shirts for $20 and pants for $30. If the store sold 10 shirts and 5 pants in a day, how much revenue did they earn?
def solve() -> int: shirt_price = 20 pants_price = 30 num_shirts_sold = 10 num_pants_sold = 5 shirt_revenue = shirt_price * num_shirts_sold pants_revenue = pants_price * num_pants_sold total_revenue = shirt_revenue + pants_revenue result = total_revenue return result
If the diameter of a circle is increased by 50%, what is the percentage increase in its circumference?
def solve() -> int: diameter = 10 new_diameter = diameter * 1.5 circumference = new_diameter * 3.14159 percentage_increase = ((circumference - (diameter * 3.14159)) / (diameter * 3.14159)) * 100 result = percentage_increase return result
If a car travels at a speed of 60 miles per hour, how many minutes will it take to travel 25 miles?
def solve() -> int: distance = 25 speed = 60 time_in_hours = distance / speed time_in_minutes = time_in_hours * 60 result = time_in_minutes return result
On a recent hike, Jessica climbed up a mountain of 487 feet and then down another of 324 feet. Assuming Jessica walks at a constant rate, how many minutes did it take her to ascend and descend the two mountains?
def solve() -> int: height_up = 487 height_down = 324 rate = 5 time_up = height_up // rate time_down = height_down // rate total_time = time_up + time_down result = 96 return result
John makes $15 dollars a day by selling oranges and $30 dollars a day selling apples. If he spends $6 for gas every day, how much will he earn in a week if he sells 4 oranges and 2 apples on Monday, Wednesday and Friday, and 6 oranges and 4 apples on Tuesday and Thursday?
def solve() -> int: orange_cost = 15 apple_cost = 30 gas_cost = 6 oranges_MWF = 4 apples_MWF = 2 oranges_TTh = 6 apples_TTh = 4 total_earned = (oranges_MWF*(orange_cost+apple_cost) + apples_MWF*(apple_cost+orange_cost) + oranges_TTh*(orange_cost+apple_cost) + apples_TTh*(a...
Student: Tim buys a box of chocolates with 16 pieces. He eats 3 pieces and each piece has 80 calories. He then shares the rest of the box equally with his 4 siblings. How many calories does each sibling get?
def solve() -> int: num_pieces = 16 num_eaten = 3 calories_per_piece = 80 num_siblings = 4 total_calories_eaten = num_eaten * calories_per_piece num_pieces_left = num_pieces - num_eaten calories_per_sibling = total_calories_eaten / num_siblings result = calories_per_sibling return r...
Brad is building a pen in his backyard for his chickens. He has 5 panels in total, and each panel is 6 feet tall and 4 feet wide. How many total square feet does Brad need for the pen?
def solve() -> int: panel_height = 6 panel_width = 4 num_panels = 5 total_area = panel_height * panel_width * num_panels result = total_area return result
A shipping company charges $10 for the first pound and $2 for each additional pound. If a package weighs 7 pounds, how much is the shipping fee?
def solve() -> int: weight = 7 cost_per_pound_extra = 2 if weight == 1: shipping_fee = 10 else: shipping_fee = 10 + ((weight - 1) * cost_per_pound_extra) result = shipping_fee return result
A fruit seller bought 200 oranges for $80. He sold each orange for $0.50. What was his profit?
def solve() -> int: buying_price = 80 selling_price = 0.50 oranges = 200 total_revenue = oranges * selling_price total_cost = buying_price profit = total_revenue - total_cost result = profit return result
Possible questions and programs: Sean buys 4 pints of blueberries for $2.50 each, 2 loaves of bread for $1.75 each, a gallon of milk for $3.50, a dozen eggs for $2, and a pound of ham for $4. How much did he spend on dairy products, rounded to the nearest dollar?
def solve() -> int: dairy_cost = 3.50 + 2 total_cost = 2.5 * 4 + 1.75 * 2 + dairy_cost + 4 dairy_percentage = dairy_cost / total_cost * 100 dairy_percentage = round(dairy_percentage) result = dairy_percentage return result
Michael had 10 apples. He decided to give away half of his apples. How many apples does he have now?
def solve() -> int: apples_michael = 0 apples_michael = 10 // 2 result = apples_michael return result
Bob has 55 cards and Sarah has 2 times more than Bob. How many more cards does Sarah have compared to Bob?
def solve() -> int: BobCards = 55 SarahCards = BobCards * 2 result = SarahCards - BobCards return result
Jack filled a 1-liter jug with water. He then poured half of the water into an empty 0.5-liter jug. How much water does he have in total?
def solve() -> int: liter1 = 1 liter2 = 0.5 total = liter1 + liter2 result = total return result
There are eight pigs on the farm. They love corn, grass, and mud. The first pig, which loves corn, eats 7 times as much corn as the number of grasses eaten by the second pig that loves grass. The second pig that loves grass eats 3/4 of the amount of mud eaten by the third pig. If the third pig eats 120 kg of mud, calcu...
def solve() -> int: pig1_corn_per_grass = 7 pig2_grass_per_mud = 1/3 pig3_mud = 120 pig2_grass = pig3_mud * pig2_grass_per_mud pig1_corn = pig1_corn_per_grass * pig2_grass total_food = (pig1_corn + pig2_grass + pig3_mud) * 8 result = total_food return result
A recipe calls for 2 cups of flour and 1 cup of sugar to make 12 cookies. How many cups of sugar are needed to make 60 cookies?
def solve() -> int: flour_for_12_cookies = 2 sugar_for_12_cookies = 1 cookies_to_make = 60 sugar_needed = sugar_for_12_cookies / 12 * cookies_to_make result = sugar_needed return result
Ron bought 24 notebooks, and Harry bought one-third as many notebooks. If Ron gave one-fourth of his notebooks to Hermione, how many more notebooks than Harry does Ron have now?
def solve() -> int: ron_notebooks = 24 harry_notebooks = ron_notebooks // 3 ron_gave = ron_notebooks // 4 ron_left = ron_notebooks - ron_gave result = ron_left - harry_notebooks result return result
A hiker is climbing a mountain that is 1200 meters tall. The hiker climbs at a pace of 100 meters per hour, but takes a 10 minute break every 300 meters climbed. How long will it take the hiker to reach the top of the mountain?
def solve() -> int: distance = 1200 pace = 100/60 rest_time = (1200/300)*10 climb_time = distance/pace result = (climb_time + rest_time)/60 return result
There are 45 jelly beans in a jar. How many jelly beans would be in the jar if it was divided into 3 equal parts?
def solve() -> int: total_beans = 45 parts = 3 beans_in_each_part = total_beans/parts result = beans_in_each_part return result
Michael's fridge is full, so he decides to donate some food to a local food bank. He takes out 8 cans of soup, 10 cans of beans, and 6 boxes of pasta. His friend, David, donates the same amount of food as Michael. Michael then realizes that he wants to keep just one-sixth of his food. How many food items are being dona...
def solve() -> int: michael_soup = 8 michael_beans = 10 michael_pasta = 6 michael_total = michael_soup + michael_beans + michael_pasta total_donated = michael_total * 2 michael_keeps = michael_total / 6 total_donated -= michael_keeps result = total_donated ...
Ethan needs one-third as many pages to write his essay as he needs pens. If he uses 18 pens in his essay, how many pages does he need in total?
def solve() -> int: pens = 18 pages = pens * 3 result = pages return result
If there are 520 students in a school and 90 more boys than girls, how many girls are there?
def solve() -> int: students = 520 boys = (students + 90) / 2 girls = students - boys result = girls return result
There are 60 students in class and the ratio of boys to girls is 2:1. How many more boys than girls are there?
def solve() -> int: boys = (2/3)*60 girls = (1/3)*60 difference = boys - girls result = difference return result
If it takes 3 chefs 6 hours to bake 120 cookies, how many chefs are required to bake 360 cookies in 12 hours?
def solve() -> int: chefs_1 = 3 cookies_1 = 120 hours_1 = 6 cookies_2 = 360 hours_2 = 12 chefs_2 = (chefs_1 * cookies_2 * hours_2) / (cookies_1 * hours_1) result = chefs_2 return result
A box of crayons costs $2.50 and a pack of markers costs $5.00. If a teacher needs to buy 4 boxes of crayons and 3 packs of markers, how much does she spend in total?
def solve() -> int: crayon_cost = 2.5 marker_cost = 5 total_crayons = 4 total_markers = 3 total_cost = (total_crayons * crayon_cost) + (total_markers * marker_cost) result = total_cost return result
Jane had 3/5 of a pizza and gave 1/4 away. How much pizza does she have left?
def solve() -> int: pizza = 3/5 gave_away = 1/4 remaining = pizza - (pizza * gave_away) result = remaining return result
You have 1200 jelly beans and you want to divide it among 6 friends. How many jelly beans will each friend get?
def solve() -> int: jelly_beans = 1200 friends = 6 result = jelly_beans//friends return result
Mia has 7 brown buttons. She has 3 more than twice as many silver and 2 less than half as many gold than silver buttons. How many buttons does Mia have in all?
def solve() -> int: brown = 7 silver = 2 * brown + 3 gold = silver // 2 - 2 total = brown + silver + gold result = total return result
Liam is studying for his final exams. He needs to study 4 hours for each exam. If he has 5 exams, how many hours does Liam need to study in total?
def solve() -> int: num_exams = 5 hours_per_exam = 4 total_hours = num_exams * hours_per_exam result = total_hours return result
A train is travelling at 50 miles per hour for 3 hours. How far has it travelled?
def solve() -> int: speed = 50 time = 3 distance = speed * time result = round(distance, 2) return result
Chris and Ashley are renting a piano for 3 months. The monthly rate is $200. There is a $50 tuning fee. They need to pay 50% of the entire bill as a security deposit. How much is their security deposit? Tommy is selling candy. He earns $2 for every bag of candy he sells, $1 for every bag he gives away for free, and he ...
def solve() -> int: monthly_rate = 200 tuning_fee = 50 total_cost = monthly_rate * 3 + tuning_fee security_deposit = total_cost * 0.5 sold_bags = 50 free_bags = 20 lost_money = 25 profit = sold_bags * 2 + free_bags * 1 - lost_money num_sold = sold_bags result = security...
In a classroom, there are 131 students. There are 23 more girls than boys. How many girls are there in the classroom?
def solve() -> int: total_students = 131 more_girls = 23 girls = total_students + more_girls result = girls return result
Student: There are 5 women in a classroom and the percentage of men is double that of women. How many men are in the classroom?
def solve() -> int: women = 5 men_percentage = 2 * (women / 100) total = 100 men = men_percentage * total result = round(men) return result
Student: During a sale a bookseller reduced the prices of the books by 3/5. If the original price of the book was 70$, what is the price of the book after the sale?
def solve() -> int: original_price = 70 reduction = 3/5 sale_price = original_price - reduction * original_price result = sale_price return result
A florist is making bouquets of flowers. Each bouquet requires 5 red roses, 3 pink roses, and 2 white roses. If the florist has 60 red roses, 36 pink roses, and 40 white roses, how many bouquets can the florist make?
def solve() -> int: num_bouquets_red = 60 // 5 num_bouquets_pink = 36 // 3 num_bouquets_white = 40 // 2 num_bouquets = min(num_bouquets_red, num_bouquets_pink, num_bouquets_white) result = num_bouquets return result
When Robert was half his sister's age, his sister passed away. If his sister were still alive now, ten years later, she would be 60. How old is Robert currently?
def solve() -> int: sister_age = 60 - 10 robert_age = sister_age / 2 result = robert_age return result
Leo has 16 marbles, while Max has four more than half as many marbles as Leo. If Max lost 6 of his marbles, how many marbles did he have left?
def solve() -> int: leo = 16 max = (leo // 2) + 4 max_left = max - 6 result = max_left return result
A manufacturer of laptops has set the price of one model at $480. If the manufacturer has sales of $5,520, how many laptops were sold?
def solve() -> int: price_per_laptop = 480 total_sales = 5520 num_laptops = int(total_sales / price_per_laptop) result = num_laptops return result
There are 450 students in a school. If 60% of them are girls, how many boys are in the school?
def solve() -> int: total_students = 450 girls_percentage = 60 boys_percentage = 100 - girls_percentage girls_count = (girls_percentage / 100) * total_students boys_count = total_students - girls_count result = boys_count return result
A triangle has a base of 10cm and a height of 5cm. What is the area of the triangle?
def solve() -> int: base = 10 height = 5 area = 0.5 * base * height result = area return result
A toy store sells a toy that costs $5 each and they have a promotion where they sell 5 toys for $20. If they sold 100 toys, how much profit did they make?
def solve() -> int: regular_cost = 5 bundle_cost = 20/5 total_cost = (regular_cost * 4) + bundle_cost sales = 100/5 total_sales = (bundle_cost * sales) + ((100 % 5) * regular_cost) total_profit = total_sales - (total_cost * sales) result = total_profit return result
A farmer has a rectangular field which is 80 meters wide and 120 meters long. How much fence is needed to go around the field?
def solve() -> int: w = 80 l = 120 result = 2*w + 2*l return result
A delivery truck drove from point A to point B at an average of 50 mph. If it traveled a distance of 500 miles, how long did it take?
def solve() -> int: distance = 500 speed = 50 time = distance / speed result = time return result
A farmer has 20 chickens and 15 cows. Each chicken lays 5 eggs per week and each cow produces 10 liters of milk per week. The farmer sells each egg for $0.50 and each liter of milk for $1.20. How much money does the farmer earn in one week from selling eggs and milk?
def solve() -> int: eggs = 20 * 5 milk = 15 * 10 egg_income = eggs * 0.50 milk_income = milk * 1.20 total_income = egg_income + milk_income result = total_income return result
Tom takes a loan of $5000 from the bank. The interest rate is 12% per annum compounded yearly. How much will he have to pay back after 3 years?
def solve() -> int: loan_amount = 5000 interest_rate = 12 compounding_period = 1 duration_years = 3 interest_rate_decimal = interest_rate / 100 amount_due = loan_amount * ((1 + interest_rate_decimal) ** (compounding_period * duration_years)) result = amount_due return result
A company sells a product for $10 per unit. The company's expenses are $1000. For each unit sold, the company makes a profit of $2. How many units does the company need to sell in order to break even?
def solve() -> int: total_expenses = 1000 profit_per_unit = 2 unit_price = 10 num_units_needed = total_expenses / (unit_price-profit_per_unit) result = int(num_units_needed) return result
Olga has 5 apples and Bob has 3 times as many pears as Olga. Kate has half the amount of the pears Bob has. How many pears does Kate have?
def solve() -> int: number_apples = 5 number_pears_Bob = number_apples * 3 number_pears_Kate = number_pears_Bob / 2 result = number_pears_Kate return result
A store sells shirts for $25 each. If a customer buys 3 shirts, the fourth shirt is half off. How much does a customer pay for 4 shirts?
def solve() -> int: price_per_shirt = 25 num_shirts = 4 full_price_shirts = num_shirts - 1 discount_shirt_price = price_per_shirt/2 subtotal = full_price_shirts*price_per_shirt + discount_shirt_price result = subtotal return result
If a book has a total of 300 pages, and you have read 75 pages so far, what percentage of the book have you read?
def solve() -> int: total_pages = 300 pages_read = 75 percentage_read = (pages_read/total_pages)*100 result = percentage_read return result
Student: A rectangular garden measures 12m long and 8m wide. If the garden has a perimeter walkway of 1m wide, what is the total area of the walkway?
def solve() -> int: length = 12 width = 8 walkway_width = 1 total_area = (length + width) * walkway_width result = total_area return result