question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: Jim is making a cake. The recipe calls for 3 cups of sugar, 2 cups of flour, and 1 cup of milk. Jim has 9 cups of sugar, 8 cups of flour, and 3 cups of milk. How many cakes can Jim make?
def solve() -> int: sugar_recipe = 3 flour_recipe = 2 milk_recipe = 1 sugar_jim = 9 flour_jim = 8 milk_jim = 3 cakes = min(sugar_jim // sugar_recipe, flour_jim // flour_recipe, milk_jim // milk_recipe) result = cakes return result
Alice and Bob are playing a game of dice. They each roll a fair six-sided die and add up their scores. The winner is the one with the higher score. If there is a tie, they roll again until there is a winner. Alice rolled a 5 and a 6, and Bob rolled a 4 and a 5. What is the probability that Bob wins the game?
def solve() -> int: from fractions import Fraction p_bob_six = Fraction(1, 6) p_alice_five_or_less = Fraction(5, 6) p_bob_wins_first = p_bob_six * p_alice_five_or_less p_tie_first = Fraction(1, 6) p_bob_wins_second = Fraction(15, 36) p_bob_wins_second_roll = p_tie_first * p_bob_wins_sec...
In a shoe store, there are 150 pairs of shoes. There are two times as many sandals as boots. There are 12 more sneakers than sandals. If there are 10 boots, how many loafers and oxfords are there if they have equal amounts and there are no other types of shoes?
def solve() -> int: boots = 10 sandals = 2 * boots sneakers = sandals + 12 total_shoes = boots + sandals + sneakers + 150 loafers_and_oxfords = (total_shoes - boots - sandals - sneakers) / 2 result = loafers_and_oxfords return result
Theresa has 90 marbles in a bag, but she does not know how many different colors she has. She finds that there are 27 blue marbles, 18 red marbles, and 45 other marbles. How many other colored marbles are there?
def solve() -> int: total_marbles = 90 number_of_blue_marbles = 27 number_of_red_marbles = 18 number_of_other_marbles = total_marbles - (number_of_blue_marbles + number_of_red_marbles) result = number_of_other_marbles return result
Sarah runs a franchise that sells left-handed laptops. These laptops cost around 40% more than the regular ones. She can sell around 8 laptops a day. If the regular laptop costs $900, what would be the weekly profit for Sarah's store?
def solve() -> int: regular_laptop_cost = 900 left_handed_laptop_cost = regular_laptop_cost * 1.4 laptops_sold_per_day = 8 weekly_profit = (left_handed_laptop_cost - regular_laptop_cost) * laptops_sold_per_day * 7 result = weekly_profit return result
If David can paint a room in 5 hours and Amanda can paint a room in 3 hours, how long would it take them to paint the room together?
def solve() -> int: david_rate = 1/5 amanda_rate = 1/3 together_rate = david_rate + amanda_rate time_together = 1 / together_rate result = time_together return result
A group of students planned a trip. Each student needs to pay $12.50 for transportation and $25 for lodging. If there are 15 students in the group, how much money do they need in total?
def solve() -> int: num_students = 15 transport_cost = num_students * 12.50 lodging_cost = num_students * 25 total_cost = transport_cost + lodging_cost result = total_cost return result
Possible new questions and python programs: Rosa sells homemade bracelets at a craft fair. She charges $5 for each bracelet and pays $20 for the booth rental. She sells 8 bracelets on the first day and 12 bracelets on the second day. How much profit does she make after the two-day fair?
def solve() -> int: price = 5 cost = 20 sales_1 = 8 sales_2 = 12 revenue = price * (sales_1 + sales_2) total_cost = cost profit = revenue - total_cost result = profit return result
A right triangle has side lengths of 5 and 7. What is the length of the hypotenuse?
def solve() -> int: total_cost = 200 tax_percentage = 8/100 total_with_tax = total_cost * (1+tax_percentage) result = total_with_tax return result
Karen has 5 more pencils than Rachel, who has half the number of pencils as Allison. If Allison has 12 pencils, how many pencils do they have altogether?
def solve() -> int: allison_pencils = 12 rachel_pencils = allison_pencils / 2 karen_pencils = rachel_pencils + 5 total_pencils = allison_pencils + rachel_pencils + karen_pencils result = total_pencils return result
Daniel is counting the number of candies in a jar. 50% of the candies are chocolate, 30% are gummy, and the rest are hard. If there are 25 gummy candies, how many hard candies are there?
def solve() -> int: chocolate_percentage = 50 gummy_percentage = 30 total_candies = 100 gummy_candies = 25 hard_candies = total_candies - (chocolate_percentage + gummy_percentage) - gummy_candies result = hard_candies return result
A train leaves station A for station B and travels at an average speed of 40 mph. Another train departs from station B to station A at the same time, traveling at an average speed of 50 mph. If the distance between the two stations is 500 miles, how long will it take for both trains to meet?
def solve() -> int: speed1 = 40 speed2 = 50 distance = 500 total_speed = speed1 + speed2 time = distance/total_speed result = time return result
An online store sells one item and produces 20 items an hour. How many items can the online store produce in 3 days?
def solve() -> int: items_per_hour = 20 hours_per_day = 24 days = 3 total_items = items_per_hour * hours_per_day * days result = total_items return result
Hussein needs to fill up a 1/6 of a jar with oil. If the jar is 2/3 litre big, how much oil does Hussein need to fill the jar?
def solve() -> int: litre_to_ml = 1000 amount_to_fill = 1/6 litres = 2/3 amount_ml = (amount_to_fill * litres * litre_to_ml) result = amount_ml return result
Jack has a stash of candy bars. He eats 18 bars and then gives 62 bars to his classmates. Later, he receives 48 more candy bars from his parents. If Jack has 97 candy bars left, how many candy bars did he initially have?
def solve() -> int: initial_candy_bars = 97 + 18 + 62 - 48 result = initial_candy_bars return result
Tom has a budget of $15. He wants to buy some fruits at the local market, where oranges cost $0.25 and apples cost $0.50. What is the maximum amount of fruit that he can buy?
def solve() -> int: budget = 15 orange_price = 0.25 apple_price = 0.50 max_oranges = budget // orange_price max_apples = budget // apple_price result = max_oranges + max_apples return result
Kevin has sixty candy bars in a box- 15 of them are chocolate flavored, 20 are fruit flavored, and the rest all have a different flavor. If he eats six candy bars, on average, how many of the different flavors will he eat?
def solve() -> int: num_candy_bar = 60 num_choco = 15 num_fruit = 20 num_remainder = num_candy_bar - num_choco - num_fruit eaten = 6 result = eaten * (num_remainder / num_candy_bar) return result
If Mary's hourly wage is $15.5 and she works 8 hours a day, calculate how much she would earn in two weeks if she works for 10 days.
def solve() -> int: hours = 8 days = 10 wage = 15.5 total_wage = wage * hours * days * 2 result = total_wage return result
A jar contains 60 marbles of different colors. 15 of the marbles are blue, 20 of them are red, and the rest are green. What percentage of marbles are green?
def solve() -> int: green_marbles = 60 - 15 - 20 percentage_of_green_marbles = (green_marbles / 60) * 100 result = percentage_of_green_marbles return result
The total cost of a toy car is $5.50 and Monica wants to buy 4 cars with a $20 bill. How much money will Monica get back?
def solve() -> int: cost = 5.50 cars = 4 bill = 20 total_cost = cost * cars back = bill - total_cost result = f'${back} back' result = back return result
Student: Marsha bought 1 pair of shoes from the store for $45 with 25% discount. How much money did she save from the discount?
def solve() -> int: original_price = 45 discount_rate = 0.25 discounted_price = original_price * (1 - discount_rate) money_saved = original_price - discounted_price result = money_saved return result
If 6 teachers have a total of 120 apples to share, then how many apples will each teacher get?
def solve() -> int: total_apples = 120 num_teachers = 6 each_teacher = total_apples/num_teachers result = each_teacher return result
Possible new questions are: Alice buys 2 pizzas and 3 drinks for her friends. One pizza costs $12 and has 8 slices. One drink costs $2 and has 250 ml of juice. Alice and her friends eat all the slices and drink all the juice. How much money does Alice spend and how much juice does each person drink?
def solve() -> int: pizza_cost = 12 drink_cost = 2 pizza_slices = 8 drink_juice = 250 total_cost = 2 * pizza_cost + 3 * drink_cost total_slices = 2 * pizza_slices total_juice = 3 * drink_juice juice_per_person = total_juice / 4 result = (total_cost, juice_per_person) return resu...
Mona needs to cover a rectangular wall with a wallpaper that is sold by the roll. Each roll covers 4 square meters of the wall. The wall has a height of 3 meters and a length of 8 meters. How many rolls of wallpaper should Mona buy?
def solve() -> int: wall_height = 3 wall_length = 8 roll_area = 4 wall_area = wall_height * wall_length rolls_needed = wall_area / roll_area result = rolls_needed return result
A restaurant serves 100 customers per hour. If the restaurant operates for 10 hours a day, how many customers do they serve in a day?
def solve() -> int: customers_per_hour = 100 hours_operating = 10 daily_customers = customers_per_hour * hours_operating result = daily_customers return result
Ava and Mia invested some capital into a bond. Ava's investment should yield 6% of the capital annually while Mia's should yield 4% annually. If Ava invested $800 and Mia invested $1200, what is the difference between their return-on-investment after 5 years?
def solve() -> int: ava_investment = 800 mia_investment = 1200 ava_annual_return = ava_investment * 0.06 mia_annual_return = mia_investment * 0.04 ava_total_return = ava_annual_return * 5 mia_total_return = mia_annual_return * 5 difference = ava_total_return - mia_total_return result = d...
ome possible questions and programs are: Maria works as a cashier at a supermarket. She works 6 hours a day, 4 days a week. If Maria earns $12 an hour, how much does she make in a week?
def solve() -> int: hourly_rate = 12 daily_hours = 6 weekly_days = 4 weekly_income = hourly_rate * daily_hours * weekly_days result = weekly_income return result
A box of cereal weighs 600 grams. How many boxes will be needed to have a total weight of 4.8 kilograms?
def solve() -> int: box_weight = 600 total_weight_needed = 4800 num_boxes_needed = total_weight_needed/box_weight result = num_boxes_needed return result
There are two water tanks. One has twice the capacity of the other. If the smaller tank holds 50 liters, how many liters does the bigger tank hold?
def solve() -> int: smaller_tank_capacity = 50 bigger_tank_capacity = smaller_tank_capacity * 2 result = bigger_tank_capacity return result
am has 4 jars of strawberry jam. Each jar is 8oz and cost $2.50 each. How much money did he spend in total?
def solve() -> int: num_jars = 4 jar_oz = 8 jar_cost = 2.50 total_cost = num_jars * jar_oz * jar_cost result = total_cost return result
Lisa purchased 2 skirts, 3 blouses, and 1 pair of shoes from the clothing store for $87. If each blouse costs $20 and a skirt costs twice as much as a blouse, what is the cost of the pair of shoes?
def solve() -> int: blouse_cost = 20 skirt_cost = 2 * blouse_cost shoes_cost = (87 - (2 * skirt_cost + 3 * blouse_cost)) result = shoes_cost return result
The age of James is half the age of Peter. If James is 21 years old, determine the age of Peter.
def solve() -> int: age_James = 21 age_Peter = age_James * 2 result = age_Peter return result
A recipe for cake asks for 2 cups of sugar and 3 cups of flour. How much flour do we need if we only have 1 cup of sugar?
def solve() -> int: sugar_needed = 2 flour_needed = 3 sugar_available = 1 flour_available = (sugar_available/flour_needed) * sugar_needed result = flour_available return result
A cell phone plan costs $20 per month plus $0.10 per minute of talking time. If my bill for the month of June was $32.50, how many minutes did I spend talking on the phone?
def solve() -> int: plan_cost = 20 overage_cost = 32.50 - plan_cost cost_per_minute = 0.10 num_minutes = overage_cost/cost_per_minute result = num_minutes return result
Ethan hurt his back while lifting boxes. It will take 14 days for the pain to fully subside. He wants to wait for 7 more days before he starts lifting boxes again. If he wants to wait for 3 weeks after that to start his new job, how long until he can start working?
def solve() -> int: pain_subside = 14 wait_days = 7 total_wait_days = 21 total_days = pain_subside + wait_days + total_wait_days result = total_days return result
The difference between Asaf and Alexander's age is 54 years. If Alexander has 5 times as many pencils as Asaf, and their ages add up to 210. How many pencils do they have together?
def solve() -> int: total = 0 asaf_pencil = 0 alexander_pencil = 0 difference = 210-54 asaf_age = int(difference/2) alexander_age = difference-asaf_age asaf_pencil = asaf_age/50 alexander_pencil = asaf_pencil*5 total_pencil = asaf_pencil + alexander_pencil result =...
A grocery store sells 30 kg of potatoes every day. If each bag of potatoes weighs 5 kg, how many bags of potatoes does the store sell every day?
def solve() -> int: total_potatoes_kg = 30 kg_per_bag = 5 num_bags = total_potatoes_kg // kg_per_bag result = num_bags return result
A store sells cans of soda for $1.50 each. Jacob buys 3 cans and gives the cashier $5. How much change will he get back?
def solve() -> int: cost_per_can = 1.50 cans_bought = 3 total_cost = cost_per_can * cans_bought amount_paid = 5 change = amount_paid - total_cost result = f'<<<{change}>>>' result = change return result
An amusement park has 4 different rides that operate at intervals of 5 minutes, 10 minutes, 15 minutes, and 20 minutes, respectively. If all the rides are turned on at the same time, what is the earliest possible moment by which all of the rides will finish their cycle at the same time? There are three different types ...
def solve() -> int: ride1 = 5 ride2 = 10 ride3 = 15 ride4 = 20 time = 0 while True: time += 1 if time % ride1 == 0 and time % ride2 == 0 and time % ride3 == 0 and time % ride4 == 0: break roses = 2 * (24 // 3) result = roses return result
Maria bakes 15 cakes every 2 hours. By the end of the 10th hour, how many cakes does Maria have if she gives away 25 cakes to her neighbors?
def solve() -> int: cakes_per_hour = 15 hours = 10 cakes_given_away = 25 total_cakes = cakes_per_hour * (hours // 2) - cakes_given_away result = total_cakes return result
Student: A pet shop wants to sell 100 bags of dog food. Each bag contains 20 lbs of food and is sold for $25. What is the total weight of dog food they will sell?
def solve() -> int: bags = 100 lbs_per_bag = 20 price_per_bag = 25 total_weight = bags * lbs_per_bag total_cost = bags * price_per_bag result = total_weight return result
If the recipe calls for 2 cups of flour to make 12 cookies, how many cups of flour are needed to make 48 cookies?
def solve() -> int: cookies = 48 flour = 2 cups = (flour*cookies)/12 result = cups return result
A rectangular prism has a length of 6 feet, a width of 4 feet, and a height of 3 feet. What is the volume of the rectangular prism in cubic feet?
def solve() -> int: length = 6 width = 4 height = 3 volume = length * width * height result = volume return result
A bakery had 80 cupcakes in stock. They sold 20 of them in the morning. Then, they received a shipment of 30 new cupcakes and added them to their stock. They then sold 60% of the remaining cupcakes throughout the day. They ended up with 28 cupcakes left. How many did they sell throughout the day?
def solve() -> int: initial_stock = 80 morning_sales = 20 shipment = 30 remaining_stock = initial_stock - morning_sales + shipment sales = remaining_stock * 0.6 final_stock = remaining_stock - sales sold_during_day = int(remaining_stock - final_stock) r...
Student: Allison bought 4 ice creams at $4 each and plans to sell them at $5. She also bought 3 biscuits at $4 for 9 and plans to sell them at $1 each. How much would be her profit if she sells 2 ice creams and 3 biscuits?
def solve() -> int: ice_cream_cost = 4 ice_cream_price = 5 ice_cream_sold = 2 biscuit_cost = 4 / 9 biscuit_price = 1 biscuit_sold = 3 total_cost = ice_cream_cost * 4 + biscuit_cost * 3 total_revenue = ice_cream_price * ice_cream_sold + biscuit_price * biscuit_sold profit = tota...
Roy has 6 times as many cards as Jen. Jen has 1/4 as many cards as Ken. How many fewer cards does Roy have than Ken, if Ken has 12?
def solve() -> int: ken = 12 jen = 1/4 * ken roy = 6 * jen difference = ken - roy result = difference return result
Rachel types 19 words a minute and takes a 3-minute break after every 20 minutes. How long does it take for Rachel to type 603 words?
def solve() -> int: time_per_words = 1/19 time_used_without_break = time_per_words * 603 time_used_with_break = time_used_without_break + 3 total_time = time_used_with_break + (time_used_with_break) // 20 result = total_time return result
Rose went to the grocery store and bought 14 pieces of oranges that each cost her $. 50 and a chocolate cake that cost her $12. If she pays with 6 twenty dollar bills, how much money should she get in change?
def solve() -> int: total_cost = 0.50 * 14 + 12 cash_paid = 6 * 20 change = cash_paid - total_cost result = change return result
Mrs. Evans is renovating her mansion that has 15 floors. Every other floor has a security guard station where everyone has to check-in; this process takes 2 minutes. As they walk between floors, visitors have to climb the stairs that is 700 feet long, and they walk at 7 feet/second. What's the time it requires to go fr...
def solve() -> int: num_floors = 15 check_in_time = 2 stair_length = 700 walking_speed = 7 total_check_in_time = (num_floors // 2) * check_in_time total_stair_time = (num_floors * stair_length) / walking_speed result = total_check_in_time + total_stair_time return result
Alex purchased a case of water bottles. He gave 8 to his coworker, then he gave three times as many as he had given his coworker to his brother, and then he gave 7 less than twice as many as he had given his brother to his friend. If Alex had 3 bottles remaining, what is the total number of bottles he bought to begin w...
def solve() -> int: bottles_bought = 3 + 7 bottles_given_to_coworker = 8 bottles_given_to_brother = 3 * bottles_given_to_coworker bottles_given_to_friend = 2 * bottles_given_to_brother - 7 total_bottles_bought = bottles_given_to_coworker + bottles_given_to_brother + bottles_given_to_friend + ...
It takes a train 4 hours to travel 200 km, and it takes a car 6 hours to travel the same distance. If the train travels at 50 km/h, what speed does the car travel at?
def solve() -> int: train_distance = 200 train_time = 4 train_speed = train_distance / train_time car_distance = 200 car_time = 6 car_speed = car_distance / car_time car_speed = (car_distance / car_time) car_speed = round(car_speed, 2) car_speed = car_speed * 3...
A company owes $5,000 in taxes. If the taxes increase by 12%, how much does the company owe in total?
def solve() -> int: increase = 5000 * 0.12 total = 5000 + increase result = total return result
How many books does Lola have if Emma has 15 books and Lola has 5 times as many books as Emma?
def solve() -> int: emma_books = 15 lola_books = emma_books * 5 result = lola_books return result
A company produces 500 widgets per hour. They want to produce 10,000 widgets this week. If they work 8 hours a day, how many widgets do they need to produce per hour to reach their goal?
def solve() -> int: widgets_per_hour = 500 hours_per_day = 8 widgets_per_week = 10000 widgets_per_hour_needed = widgets_per_week / (hours_per_day * 5) result = widgets_per_hour_needed return result
A rectangular swimming pool has a length of 20 meters and a width of 10 meters. If the pool is filled with water to a depth of 2 meters, what is the volume of the water in cubic meters?
def solve() -> int: length = 20 width = 10 depth = 2 volume = length * width * depth result = volume return result
Student: Maria is serving drinks at a party. She has 5 bottles of soda, with 2 liters in each bottle. If each cup is 250 mL, how many cups can Maria fill with the 5 bottles of soda?
def solve() -> int: bottles = 5 bottle_volume = 2 cup_volume = 0.25 bottle_volume_ml = bottle_volume * 1000 total_volume_ml = bottles * bottle_volume_ml cups = total_volume_ml / cup_volume result = cups return result
John was shopping for his family reunion. He bought 22 porcelain plates which cost $2.88 each. He was charged a total of $1.67 total for tax. He left with $41.73 in change. How much did John start with?
def solve() -> int: cost = 2.88 * 22 tax = cost * 0.167 total = cost + tax result = total - 41.73 return result
During a road trip, Tanya’s car gets 27 miles to the gallon and Karen’s car gets 36 miles to the gallon. If Tanya drove 60 miles and Karen drove 80 miles and they used 5 gallons of gas total, how many gallons of gas did Tanya use?
def solve() -> int: tanya_mpg = 27 karen_mpg = 36 tanya_distance = 60 karen_distance = 80 total_distance = tanya_distance + karen_distance total_gas = 5 tanya_gas = (tanya_distance / total_distance) * total_gas result = tanya_gas return result
Amanda wants to travel 70 miles by car. If she drives at 45 miles per hour, how long does it take for her to get there?
def solve() -> int: total_distance = 70 speed = 45 total_time = total_distance / speed result = int(total_time) return result
Liam has 3 piles of quarters, 7 piles of dimes, 4 piles of nickels, and 2 piles of pennies, with each pile containing 25 coins. What is the total value of his coins?
def solve() -> int: quarters = 3 dimes = 7 nickels = 4 pennies = 2 quarters_value = quarters * 25 dimes_value = dimes * 10 nickels_value = nickels * 5 pennies_value = pennies * 1 total_value = quarters_value + dimes_value + nickels_value + pennies_value result = to...
A recipe for chocolate chip cookies calls for 1/2 cup of sugar for every dozen cookies. If you want to make 3 dozen cookies, how much sugar do you need?
def solve() -> int: num_dozen = 3 sugar_per_dozen = 0.5 total_sugar = num_dozen * sugar_per_dozen * 16 result = total_sugar return result
Example questions: Amy bought 12 apples, 8 oranges, and 15 bananas from the market. She gave 3 apples, 2 oranges, and 4 bananas to her friend Bob. How many pieces of fruit did Amy have left?
def solve() -> int: total_fruit = 12 + 8 + 15 bob_fruit = 3 + 2 + 4 left_fruit = total_fruit - bob_fruit result = left_fruit return result
A company produced 4000 units of a product at a cost of $2.50 per unit. If they sell each unit for $5, what is their gross profit?
def solve() -> int: units = 4000 cost_per_unit = 2.50 selling_price = 5 revenue = units * selling_price cost = units * cost_per_unit gross_profit = revenue - cost result = gross_profit return result
Student: Benny wants to buy a set of tiles for his kitchen. His kitchen is 10 feet by 10 feet and the cost of a tile is $7. How much money does Benny need to pay for the tiles?
def solve() -> int: length = 10 width = 10 cost_per_tile = 7 area = length * width num_tiles = area // 1 total_cost = num_tiles * cost_per_tile result = total_cost return result
In football, each touchdown is worth 7 points. How many touchdowns does Jaime need to score to get to 63 points?
def solve() -> int: points = 0 touchdowns = 0 while points < 63: touchdowns += 1 points += 7 result = touchdowns return result
``` John has $150 in his wallet. If he spends $40 on a pair of shoes and $25 on a shirt, how much money does he have left in his wallet?
def solve() -> int: total_money = 150 shoe_cost = 40 shirt_cost = 25 total_spent = shoe_cost + shirt_cost money_left = total_money - total_spent result = money_left return result
If Michael is a bartender who earns $20.00 per hour, and in one hour he serves 50 patrons, who each leave a $1.50 tip, how much money did he make in that hour? John works at a construction site and every hour, a crane he oversees lifts 5 steel beams. How many steel beams can one crane lift in 3 hours?
def solve() -> int: hourly_wage = 20.00 num_patrons = 50 tip_amount = 1.50 total_tips = num_patrons * tip_amount total_earnings = hourly_wage + total_tips beams_per_hour = 5 num_beams = beams_per_hour * 3 result = total_earnings + num_beams ...
If Julia walked for 3.5 miles, Luke walked for 2.25 miles, and Sophia walked for 4500 feet, how many more miles did Julia and Luke walk combined than Sophia?
def solve() -> int: julia_distance = 3.5 luke_distance = 2.25 sophia_distance = 4500 / 5280 julia_luke_distance = julia_distance + luke_distance difference = julia_luke_distance - sophia_distance result = difference return result
A basketball team has 15 players. If 40% of them are forwards and 30% are centers, how many guards are on the team?
def solve() -> int: num_forwards = round(0.4 * 15) num_centers = round(0.3 * 15) num_guards = 15 - num_forwards - num_centers result = num_guards return result
A car travels 300 kilometers in 6 hours. Calculate the average speed of the car in kilometers per hour.
def solve() -> int: distance = 300 time = 6 speed = distance / time result = speed return result
Rachel and her friend Emily decided to have a jumping jack contest. Rachel did 250 jumping jacks in the first round, while Emily managed 3/5 as many jumping jacks as Rachel did. In the second round, Rachel did 80 more jumping jacks than Emily. If Emily managed to do 4/5 times the number of jumping jacks she did in the ...
def solve() -> int: rachel_first_round = 250 emily_first_round = (3/5) * rachel_first_round rachel_second_round = emily_first_round + 80 emily_second_round = (4/5) * emily_first_round total_jumping_jacks = rachel_first_round + emily_first_round + rachel_second_round + emily_second_round ...
In 2020 the Los Angeles Lakers won 52 games. The Denver Nuggets won 7 fewer games than the Lakers. The Lakers also beat the Nuggets in 5 games in the third round of the playoffs. How many games did the Nuggets play in the playoffs?
def solve() -> int: lakers_win = 52 nuggets_win = lakers_win - 7 nuggets_first = 7 nuggets_second = 7 nuggets_third = 5 nuggets_playoff = nuggets_first + nuggets_second + nuggets_third result = nuggets_playoff return result
You are buying paint to cover a room that is 12 feet long, 10 feet wide, and 8 feet tall. If each can of paint covers 400 square feet, how many cans of paint do you need?
def solve() -> int: area = 2*(10*8 + 12*8) + 10*12 Cans = area/400 result = round(Cans) return result
A store is offering a 20% discount on all dresses priced at $50 or more. A customer purchases 2 dresses priced at $40 each and 1 dress priced at $60. How much discount does the customer receive?
def solve() -> int: items = [40, 40, 60] total_price = sum(items) dresses_over_50_price = sum([price for price in items if price >= 50]) if dresses_over_50_price > 0: discount = 0.2 * dresses_over_50_price else: discount = 0 result = discount return result
6. Mr. Smith has a balance of $150 plus 10% interest. He pays 25% upfront in cash and will pay the rest immediately. How much will he pay in total?
def solve() -> int: balance = 150 interest_ratio = 0.1 advance_payment_ratio = 0.25 advance_payment_amount = balance * advance_payment_ratio remaining_amount_owed = balance - advance_payment_amount + balance * interest_ratio result = remaining_amount_owed return result
Student: Mark is making a cake that requires 3 eggs. However, he only has egg whites left. 1 egg white is equivalent to 2/3 of a whole egg. How many egg whites does he need?
def solve() -> int: eggs_required = 3 egg_white_equivalent = 2/3 egg_whites_required = eggs_required * egg_white_equivalent result = egg_whites_required return result
Emma is studying for a history exam. She spends 3 hours studying on Monday, then adds 2 hours to this on Tuesday, and then reduces her study time by 30 minutes on Wednesday. How many minutes does Emma study over the three days?
def solve() -> int: monday_hours = 3 tuesday_hours = 2 wednesday_hours = 2.5 monday_minutes = monday_hours * 60 tuesday_minutes = tuesday_hours * 60 wednesday_minutes = wednesday_hours * 60 total_minutes = monday_minutes + tuesday_minutes + wednesday_minutes result = total...
Alex has 120 pens, and he wants to distribute them equally among 15 of his co-workers. How many pens will each co-worker get, and how many pens will Alex have left?
def solve() -> int: pens = 120 co_workers = 15 pens_per_co_worker = pens // co_workers pens_left = pens % co_workers result = f'Each co-worker will get {pens_per_co_worker} pens, and Alex will have {pens_left} pens left.' return result
A store owner buys 100 items at $5 each and sells them at $8 each. What is the store owner's profit?
def solve() -> int: items_bought = 100 price_bought = 5 price_sold = 8 total_cost = items_bought * price_bought total_income = items_bought * price_sold profit = total_income - total_cost result = profit return result
There are 5 friends who want to go on a weekend trip. They need to rent a car for $60 per day, and need to pay for gas at $0.30 per mile. Their hotel costs $200 per night. If they plan to go for 3 days and drive 800 miles in total, how much does each person need to contribute?
def solve() -> int: days = 3 car_rental = 60 * days hotel_cost = 200 * days total_miles = 800 gas_cost = 0.3 * total_miles total_cost = car_rental + hotel_cost + gas_cost per_person_cost = total_cost / 5 result = per_person_cost return result
Student: John needs to purchase roofing materials for a slanted roof that he is constructing. The roof is 17 feet long with a pitch of 4/12. How many square feet of shingles will John need to purchase?
def solve() -> int: length = 17 pitch = 4/12 height = length * pitch area = length * height / 2 result = area return result
If 3x + 4y = 24 and x - 2y = 3, what is the value of x?
def solve() -> int: eq1 = [3, 4, 24] eq2 = [1, -2, 3] x = (eq1[2]*eq2[1]-eq2[2]*eq1[1])/(eq1[0]*eq2[1]-eq2[0]*eq1[1]) result = x return result
In a science fair, Mia collected 24 data points, Noah collected 8 data points more than Mia, and Olivia collected half as many as Noah. If each data point was worth 3 points, how many points did Olivia score?
def solve() -> int: mia = 24 noah = mia + 8 olivia = noah / 2 olivia_points = olivia * 3 result = olivia_points return result
There are 180 students in Josh's school, and 2/5 of them are girls. How many are boys?
def solve() -> int: total_students = 180 girls_fraction = 2/5 girls = total_students * girls_fraction boys = total_students - girls result = boys return result
A bag contains 8 red balls, 5 green balls, and 3 blue balls. What is the probability of drawing a red ball?
def solve() -> int: red_balls = 8 total_balls = 16 probability = red_balls / total_balls result = probability return result
Lisa wants to learn a new language. She takes an online course that has 12 lessons, each lasting 1.2 hours. She also practices with a native speaker for 0.75 hours every week. How many hours will she spend on learning the language in total?
def solve() -> int: lessons = 12 lesson_duration = 1.2 practice = 0.75 weeks = 4 total_hours_course = lessons * lesson_duration total_hours_practice = practice * weeks total_hours_language = total_hours_course + total_hours_practice result = total_hours_...
A school is hosting a basketball tournament. Each team played 10 games. The winning team receives 2 points and the losing team receives 0 points. The winning team has a total of 18 points, how many games did they win?
def solve() -> int: winning_points = 18 points_per_game = 2 games_played = winning_points/points_per_game result = games_played return result
The perimeter of a rectangle is 26 and the length is 7. Find the width of the rectangle.
def solve() -> int: perimeter = 26 length = 7 width = (perimeter - (2 * length)) / 2 result = width return result
Student: Henry bought 36 toys and each toy costs $7. He paid for the total amount, and received $12 back as change. How much money did Henry pay?
def solve() -> int: toys = 36 cost = 7 change = 12 total_cost = toys * cost payment = total_cost - change result = payment return result
A person invested $5,000 at a 10% annual interest rate. How much money will they have after 5 years, if the interest is compounded annually?
def solve() -> int: principal = 5000 interest_rate = 0.1 time_years = 5 amount = principal * ((1 + interest_rate)**time_years) result = round(amount, 2) return result
There were books on a shelf. Nicholas took one-sixth of them and 6 more. Then Zoey came and took half of the remaining books. How many books were on the shelf at first?
def solve() -> int: books_on_shelf = 0 nicholas_books = 0 zoey_books = 0 nicholas_books = books_on_shelf / 6 + 6 remaining_books = books_on_shelf - nicholas_books zoey_books = remaining_books / 2 total_books = nicholas_books + zoey_books result = total_books ...
Four bakers were comparing the weight of their cakes. They found out that Mary’s cake weighs 200 grams more than Paul's cake, while Paul's cake weighs 500 grams more than John’s cake. Then, Lucy’s cake weighs 125 grams less than John’s cake. How much heavier is Mary’s cake compared to Lucy's cake, in grams?
def solve() -> int: john_cake_weight = 1 paul_cake_weight = john_cake_weight + 500 mary_cake_weight = paul_cake_weight + 200 lucy_cake_weight = john_cake_weight - 125 mary_lucy_weight_difference = mary_cake_weight - lucy_cake_weight result = mary_lucy_weight_difference return ...
Student: A truck can carry 5000 pounds of goods. If the truck already has 1200 pounds of goods, how many more pounds of goods can it carry?
def solve() -> int: truck_capacity = 5000 goods_on_truck = 1200 remaining_capacity = truck_capacity - goods_on_truck more_goods = remaining_capacity result = more_goods return result
Mack buys 30 pieces of apples but gives away 6 of them to friends. Then he takes one-third of the remaining. How many apples does Mack have left?
def solve() -> int: total = 30 given_away = 6 remaining = total - given_away one_third = remaining/3 result = remaining - one_third return result
Student: Michelle has to clean her bedroom each week. She needs to vacuum the rug and dust the furniture. She can vacuum the rug in 30 minutes and dust the furniture in 45 minutes. How long will it take her to clean her bedroom if she works for 2 hours?
def solve() -> int: vacuum_time = 30 dust_time = 45 work_time = 2 total_time = vacuum_time + dust_time time_left = work_time * 60 - total_time result = time_left return result
If a recipe calls for 2 cups of sugar but you only want to make half a recipe, how many cups of sugar do you need for half a recipe?
def solve() -> int: original_recipe = 2 scaled_recipe = 0.5 new_recipe = original_recipe * scaled_recipe result = new_recipe return result
Student: For 28 servings of Mac and Cheese you need 7.2 cups of noodles and 2 cups of cheese. How many cups of noodles would you need for 10 servings?
def solve() -> int: servings = 28 noodles = 7.2 cheese = 2 noodles_per_serving = noodles / servings noodles_for_10 = noodles_per_serving * 10 result = noodles_for_10 return result
Maya is baking cupcakes for a party. She uses 1/3 cups of sugar for each batch that makes 6 cupcakes. If she makes 5 batches in total, how much cups of sugar does Maya need?
def solve() -> int: batches = 5 cupcakes_per_batch = 6 sugar_per_cupcake = 1/3 total_cupcakes = batches * cupcakes_per_batch total_sugar = total_cupcakes * sugar_per_cupcake result = total_sugar return result
A company has 10 employees earning a total of $5000 per week. If the company hires 5 more employees and distributes the total earnings equally among all employees, what will be the weekly salary after the hiring?
def solve() -> int: employees = 10+5 total_earnings = 5000 equal_salary = total_earnings/employees result = equal_salary return result
The population of a city is currently 500,000 people. That is 15% more than it was 5 years ago. What was the city's population 5 years ago?
def solve() -> int: current_population = 500000 percentage_increase = 15 years_ago = 5 population_increase = current_population - (current_population * (100 / (100 + percentage_increase))) population_5_years_ago = current_population - population_increase result = population_5_years_ago...