question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Ben gave 4 pencils each to Alia and Cara so that he has only 6 pencils left. How many pencils did Cara have in the beginning?
def solve() -> int: alia = 0 ben = 0 cara = 0 ben = 6 + 4 alia = ben + 12 cara = alia + 3 result = cara return result
A recipe for a smoothie calls for 2 bananas and 3 cups of milk. If you want to make half a batch of the smoothie, how many bananas and cups of milk will you need?
def solve() -> int: banana_per_batch = 2 milk_per_batch = 3 batches = 0.5 bananas_required = batches * banana_per_batch milk_required = batches * milk_per_batch result = (bananas_required, milk_required) return result
Jacob is 5 years old. His older sister, Rachel, is 7 years older than him and 4 years younger than their older brother, Samuel. How old will Samuel be when Jacob reaches his current age?
def solve() -> int: jacob_age = 5 rachel_age = jacob_age + 7 samuel_age = rachel_age + 4 age_difference = jacob_age - 0 samuel_age_when_jacob_reaches_current_age = samuel_age + age_difference result = samuel_age_when_jacob_reaches_current_age return result
A box contains 5 blue balls, 7 green balls, and 8 yellow balls. Liam randomly picks one ball from the box and puts it back. He repeats this process 20 times. What is the most likely number of yellow balls that he picked?
def solve() -> int: probability = 8 / (5 + 7 + 8) probability = 0.32 yellow_picked = probability * 20 yellow_picked = round(yellow_picked) yellow_picked = 6 result = yellow_picked return result
A coffee shop sells 15 cups of coffee every hour, each one selling for $3.50. How many hours does the shop need to run to make $250 in sales?
def solve() -> int: cups_per_hour = 15 price_per_cup = 3.50 target_sales = 250 sales_per_hour = cups_per_hour * price_per_cup hours_needed = target_sales / sales_per_hour result = hours_needed return result
A hiking trail is 2.5 miles long. If a group of hikers walks the trail in 1 hour and 30 minutes, what is their average speed in miles per hour?
def solve() -> int: distance = 2.5 time = 1.5 speed = distance / time result = speed return result
The area of a triangle is 27 square meters and its height is 9 meters. What is the length of its base?
def solve() -> int: height = 9 area = 27 base = (2 * area) / height result = f'The length of the base is {base} meters.' result = base return result
If 40% of a number is 50, what is the number?
def solve() -> int: percentage = 0.4 given_value = 50 number = given_value/percentage result = number return result
ophia had 100 stickers. She gave 1/5 of her stickers to her friends in class. How many stickers does Sophia have left?
def solve() -> int: total_stickers = 100 stickers_given = total_stickers * 1/5 stickers_left = total_stickers - stickers_given result = stickers_left return result
Lisa needs 1/4 as many pieces of candy to make a candy bouquet as she needs flowers. If she uses 12 flowers, how many pieces of candy will she need?
def solve() -> int: flowers = 12 candy = flowers / 4 result = candy return result
Marcus has a bike that can travel 12 miles per hour. He rode his bike for 15 minutes to his school, then 20 minutes to the library, then 10 minutes to the park, and finally 25 minutes back to his home. How many miles did he travel in total?
def solve() -> int: minutes_to_hours = 1 / 60 school_distance = 12 * 15 * minutes_to_hours library_distance = 12 * 20 * minutes_to_hours park_distance = 12 * 10 * minutes_to_hours home_distance = 12 * 25 * minutes_to_hours total_distance = school_distance + library_distance + park_distance + hom...
If Alex needs to make 1 dozen muffins, he needs 3 cups of all-purpose flour. How many cups of flour does he need for 2 dozen?
def solve() -> int: muffins = 2 flour_per_muffin = 0.25 flour = muffins * flour_per_muffin result = "Alex needs 6 cups of all-purpose flour for 2 dozen muffins." return result
If the price of a candy is $0.12, how many candies can you buy with a twenty-dollar bill?
def solve() -> int: price_of_one_candy = 0.12 total_money = 20 number_of_candies = total_money // price_of_one_candy result = number_of_candies return result
Sarah wants to ensure she eats fewer calories every day than the day before. Yesterday she ate 1500 calories. Today she ate 1800 calories. How many calories should she consume tomorrow to reduce her calories intake?
def solve() -> int: yesterday_calories = 1500 today_calories = 1800 calories_difference = today_calories - yesterday_calories tomorrow_calories = today_calories - calories_difference result = tomorrow_calories return result
7. Mark and Mike drove to the mall. Mark drove for 4 hours while Mike drove for 3 hours. How many total hours did they drive?
def solve() -> int: mark_time = 4 mike_time = 3 total_time = mark_time + mike_time result = total_time return result
A team of 50 volunteers was asked to plant 500 trees. Each day they plant 25% of the remaining trees. How many trees will be left to plant after the third day?
def solve() -> int: trees_planted = 0 trees_left = 500 for day in range(3): trees_planted = trees_left * 0.25 trees_left -= trees_planted result = trees_left return result
A store is selling shirts for $10 each. If Tim wants to buy 5 shirts and Ann wants to buy 8 shirts, how much money do they collectively need to spend?
def solve() -> int: TimShirts = 5 AnnShirts = 8 TotalShirts = TimShirts + AnnShirts TotalCost = TotalShirts * 10 result = TotalCost return result
Mrs. Smith made a large dinner for the family and had 16 people coming to eat. She had ordered 3 large pizza pies that could be cut into 12 slices each. She ended up giving away half of the pizza slices before serving dinner. How many slices did she give away?
def solve() -> int: number_of_pizzas = 3 slices_per_pizza = 12 pizza_slices_total = number_of_pizzas * slices_per_pizza amount_given_away = pizza_slices_total / 2 result = amount_given_away return result
Rachel went to a bookstore on Monday and bought 8 novels. The day after, she went back and bought half the number of novels she bought before. On Wednesday, she bought a third of the number of novels she bought the day before. On Thursday, she returned three out of the novels she bought the day before because she reali...
def solve() -> int: novels_on_monday = 8 novels_on_tuesday = novels_on_monday / 2 novels_on_wednesday = novels_on_tuesday / 3 novels_returned_on_thursday = 3 novels_on_thursday = novels_on_wednesday - novels_returned_on_thursday result = novels_on_thursday return result
ome possible questions are: Luke bought 6 bags of chips and 2 times as many bottles of soda for a party. If each bag of chips has 8 servings and each bottle of soda has 12 servings, how many servings of snacks does he have in total?
def solve() -> int: chips = 6 soda = 2 * chips servings_per_chip = 8 servings_per_soda = 12 servings_of_chips = chips * servings_per_chip servings_of_soda = soda * servings_per_soda servings_of_snacks = servings_of_chips + servings_of_soda result = servings_of_snacks ...
An amusement park charges $18 admission fee and $3 per ride. If a visitor went on 4 rides, what is their total cost?
def solve() -> int: Admission_fee = 18 Number_of_rides = 4 Cost_per_ride = 3 Total_ride_cost = Number_of_rides * Cost_per_ride Total_cost = Admission_fee + Total_ride_cost result = Total_cost return result
There are 12 cupcakes available for a party. If each guest will have 2 cupcakes, how many guests can attend the party?
def solve() -> int: cupcakes = 12 guests = cupcakes // 2 result = guests return result
In Riverdale, there are 120 students in the sixth grade. The sixth grade students can choose to join either the chess club or the art club or both or none. There are 60 students in the chess club and 48 students in the art club. 24 students are in both clubs. How many students are in neither club?
def solve() -> int: chess_only = 60 - 24 art_only = 48 - 24 one_or_more = chess_only + art_only + 24 neither = 120 - one_or_more result = neither return result
Fred invests $5000 in the stock market. In the first year, he makes a 10% profit and reinvests the total amount in the next year. In the second year, he loses 5% of the total amount. How much money does he have now?
def solve() -> int: starting_amount = 5000 first_year_profit = starting_amount * 0.1 total_amount_after_first_year = starting_amount + first_year_profit second_year_loss = total_amount_after_first_year * 0.05 ending_amount = total_amount_after_first_year - second_year_loss result = round(ending_...
Tom paid $420 for a new bike after a 20% discount. What was the original price of the bike?
def solve() -> int: discounted_price = 420 percent_off = 20 original_price = discounted_price / (1 - percent_off / 100) result = original_price return result
A pizza restaurant offers a 10-inch pizza for $10 and a 16-inch pizza for $20. If you buy one of each pizza, what is the average cost per inch of pizza?
def solve() -> int: total_cost = 10 + 20 total_size = 10 + 16 cost_per_inch = total_cost / total_size result = cost_per_inch return result
arah has 30 pieces of candy and wants to package them equally into 6 bags. How many pieces of candy will each bag contain?
def solve() -> int: total_candy = 30 num_bags = 6 candy_per_bag = total_candy / num_bags result = candy_per_bag return result
Student: Rachel bought 5 pouches of chips, each pouch contains 10 chips, and each chip costs $1.50. How much did she pay for chips?
def solve() -> int: pouches = 5 chips_per_pouch = 10 chip_price = 1.50 total_chips = pouches * chips_per_pouch total_cost = total_chips * chip_price result = total_cost return result
Student: If a car travels 50 miles in 45 minutes, what is the speed of the car in miles per hour?
def solve() -> int: distance = 50 time = 45/60 speed = distance/time result = speed return result
Max's yacht can carry 12 people, but if he wants to take his scuba gear, he can only fit 3/4 of that number inside. If each person weighs 150 pounds, and the scuba gear weighs 30 pounds, what is the total weight the yacht is carrying?
def solve() -> int: max_people = 12 scuba_people = max_people * 3/4 people_weight = max_people * 150 gear_weight = scuba_people * 30 total_weight = people_weight + gear_weight result = total_weight return result
A movie theater charges $12 per ticket. If there are 100 seats in the theater and only 80 tickets are sold, how much money did the theater make?
def solve() -> int: ticket_price = 12 num_of_seats = 100 num_of_tickets_sold = 80 money_made = num_of_tickets_sold * ticket_price result = money_made return result
The gas tank in my car is empty and weighs 1800 grams. If I fill it with 200 grams of fuel every day and always refill it every 3 days, how much will it weigh if after I ended up refilling the empty tank there is only 25 grams of fuel left in it?
def solve() -> int: empty_tank_weight = 1800 fuel_added_per_day = 200 refill_frequency = 3 remaining_fuel_weight = 25 total_fuel_added = (refill_frequency - 1) * fuel_added_per_day tank_weight_after_refill = empty_tank_weight + total_fuel_added tank_weight_with_remaining_fuel ...
Diana has 80 marbles in a bag. She takes out one-eighth of the marbles at random and puts them in a jar. She then takes out another one-tenth of the marbles from the bag and puts them in another jar. She decides to keep the rest of the marbles in the bag. If each jar can hold 5 marbles, how many jars does Diana need in...
def solve() -> int: jar1 = (1/8) * 80 jar2 = (1/10) * 80 bag = 80 - jar1 - jar2 jar1 = jar1 / 5 jar2 = jar2 / 5 bag = bag / 5 jars = jar1 + jar2 + bag result = jars return result
You have a rectangular garden that is 20 meters long and 10 meters wide. If you want to add a walkway of equal width around the perimeter of the garden, how much area will the walkway cover?
def solve() -> int: garden_length = 20 garden_width = 10 walkway_width = 2 garden_area = garden_length * garden_width walkway_length = garden_length + (2 * walkway_width) walkway_width = garden_width + (2 * walkway_width) walkway_area = (walkway_length * walkway_width) - garden_area resu...
A box contains 12 red balls, 15 blue balls, and 23 green balls. What is the probability of selecting a blue ball randomly from the box?
def solve() -> int: total_balls = 12 + 15 + 23 blue_balls = 15 probability_of_blue = blue_balls / total_balls result = probability_of_blue return result
Aaron has $50 and he wants to buy 10 pencils. Each pencil costs $0.50. How much money does Aaron have left?
def solve() -> int: remaining = 50 for pencil in range(10): remaining = remaining - 0.50 result = remaining return result
Student: A train loaded with 3 coal cars, 6 iron cars, and 9 wood cars needs to be transported from its departure station to its destination. Between each station, it takes 40 minutes and 5 miles to travel. At each station, the train may deposit one coal car, two iron cars, and three wood cars. How many minutes will it...
def solve() -> int: coal_cars = 3 iron_cars = 6 wood_cars = 9 time_per_station = 40 distance_per_station = 5 total_stations = (coal_cars + iron_cars + wood_cars) // 6 total_time = total_stations * time_per_station total_distance = total_stations * distance_per_station result = total_...
A jar contains 20 red candies and 15 green candies. If three candies are drawn at random without replacement, what is the probability that the first candy is red, the second candy is green, and the third candy is red?
def solve() -> int: P_red1 = 20/35 P_green2 = 15/34 P_red3 = 19/33 P_red1_green2_red3 = P_red1 * P_green2 * P_red3 result = P_red1_green2_red3 return result
Leo and Mia are twins. Noah is 9 years younger than Leo. Olivia is 4 years less than thrice Noah's age. If Olivia is 40, how old is Mia?
def solve() -> int: noah = (40 + 4) / 3 leo = noah + 9 mia = leo result = mia return result
4. What is the cost of 36 rolls of wrapping paper at a reduced rate of $2.50 per roll?
def solve() -> int: number_of_rolls = 36 price_per_roll = 2.50 total_cost = number_of_rolls*price_per_roll result = total_cost return result
The pizza shop at Green Valley Middle School sells slices of cheese pizza for $1.50 each and slices of pepperoni pizza for $2 each. How much money, in dollars, will 3 students need in total if each of them gets 1 slice of cheese pizza and 2 slices of pepperoni pizza?
def solve() -> int: cheese_pizza = 1.5 pepperoni_pizza = 2 students = 3 cheese_pizzas = 1 pepperoni_pizzas = 2 total_cost = students * (cheese_pizzas * cheese_pizza + pepperoni_pizzas * pepperoni_pizza) result = total_cost return result
Mia has a rectangular garden that measures 15 meters by 12 meters. She wants to plant roses along the perimeter of the garden, leaving 1 meter of space between each rose. How many roses does she need to buy?
def solve() -> int: length = 15 width = 12 perimeter = 2 * (length + width) spaces = perimeter - 1 roses = spaces // 2 if spaces % 2 > 0: roses += 1 result = roses return result
A car is traveling at a speed of 60 miles per hour. How many feet does it travel in one minute?
def solve() -> int: speed_mph = 60 distance_per_minute = speed_mph * 5280 / 60 result = distance_per_minute return result
Sarah owes her neighbour $200 and pays an initial installment of $75. If she still owes 40% of the original amount, how much did Sarah owe her neighbour originally? In a bakery, 5 bakers can make 80 bread loaves in 3 hours. How many bread loaves will they make in 5 hours?
def solve() -> int: initial_debt = 200 initial_payment = 75 remaining_debt_percentage = 40 remaining_debt = initial_debt - initial_payment original_debt = remaining_debt / (remaining_debt_percentage / 100) bakers = 5 initial_loaves = 80 initial_hours = 3 target_hours = 5 ...
A TV station broadcasts 2 news programs every day. They distribute it to 4 different channels. The first channel receives 700 broadcasts, while the second channel receives 100 more than the first channel. The third channel gets triple the number of broadcasts the first and second channels receive, and the fourth channe...
def solve() -> int: first_channel = 700 second_channel = first_channel + 100 third_channel = (first_channel + second_channel) * 3 fourth_channel = 400 result = third_channel return result
Tyler has completed 30 jigsaw puzzles and finished 90% of them. If he completes 20 more puzzles and only finishes 60% of them, what is his new percentage of finished puzzles?
def solve() -> int: completed_puzzles = 30 percentage_completed = 90 additional_puzzles = 20 new_percentage = 60 total_puzzles = completed_puzzles + additional_puzzles total_completed = (completed_puzzles * percentage_completed / 100) + (additional_puzzles * new_percentage / 100) ...
If Karen had $2,500 in cash and her husband gave her an extra $200, how much money did she have left after donating $600 to a charity?
def solve() -> int: cash = 2500 extra = 200 donation = 600 total = cash + extra remaining = total - donation result = remaining return result
A recipe requires 1/2 tablespoon of vanilla essence. How many teaspoons is this equivalent to?
def solve() -> int: vanilla_tbsp = 1/2 tsp_per_tbsp = 3 vanilla_tsp = vanilla_tbsp * tsp_per_tbsp result = vanilla_tsp return result
Emily borrowed $2000 from her parents but could only repay $1000 before agreeing to work off the rest. She works for $50 an hour. How many hours will it take her to repay the remaining amount?
def solve() -> int: borrowed_amount = 2000 repaid_amount = 1000 hourly_rate = 50 remaining_amount = borrowed_amount - repaid_amount hours_needed = remaining_amount / hourly_rate result = hours_needed return result
At the carnival, Jack had 90 stuffed animals to give out as prizes. While setting up the stand, 3 fell and were damaged. After 2 hours, he gave away 10 and bought 20 more from the vendor next door. How many stuffed animals does Jack have left?
def solve() -> int: stuffed_animals = 90 damaged_animals = 3 given_away_animals = 10 bought_animals = 20 stuffed_animals -= damaged_animals stuffed_animals -= given_away_animals stuffed_animals += bought_animals result = stuffed_animals return result
A coffee shop charges $4 for a latte and $2 for a muffin. If Sarah spends $20 at the coffee shop, how many lattes and muffins did she purchase?
def solve() -> int: latte_price = 4 muffin_price = 2 total_spent = 20 num_lattes = (total_spent - muffin_price) // latte_price num_muffins = (total_spent - latte_price) // muffin_price result = (num_lattes, num_muffins) return result
Faye can knit 1 scarf per hour while Gary can knit 2 scarves per hour. If they have been knitting scarves for 3 hours now, and Faye started with 2 scarves and Gary started with 1 scarf, how many scarves do they have now?
def solve() -> int: faye_rate = 1 gary_rate = 2 time = 3 faye_start = 2 gary_start = 1 faye_knitted = faye_rate * time gary_knitted = gary_rate * time total_scarves = faye_knitted + gary_knitted + faye_start + gary_start result = total_scarves ...
A car dealer sold 120 cars in a month, 40 of which were SUVs. If they plan to double their sales next month, how many more SUVs must they sell if they want SUVs to comprise 30% of their total sales?
def solve() -> int: cars_sold = 120 suv_sold = 40 target_percentage = 0.3 total_sales_next_month = cars_sold * 2 target_suv_sales_next_month = total_sales_next_month * target_percentage additional_suv_sales = target_suv_sales_next_month - suv_sold result = additional_suv_sales...
Mike collected 800 shells on the beach. He shared 4/5 of the shells with his siblings and an equal number of shells with his cousins. If he has 30 cousins, how many shells did each cousin receive?
def solve() -> int: shells_collected = 800 siblings_share = shells_collected * (4/5) cousins_share = siblings_share / 30 result = cousins_share return result
A tank can hold 650 liters of water. If it is filled to 80% capacity, how many more liters can it hold?
def solve() -> int: tank_capacity = 650 filled_capacity = tank_capacity * 0.8 remaining_capacity = tank_capacity - filled_capacity result = remaining_capacity return result
arah is planting flowers that are 12 inches apart from each other. If she wants to plant 33 flowers, how long of a row will they take up?
def solve() -> int: numberOfFlowers = 33 distanceApart = 12 lengthOfRow = 0 lengthOfRow = numberOfFlowers*distanceApart result = lengthOfRow return result
Julia will pay $200 monthly for 18 months. What will be the total amount she will pay?
def solve() -> int: monthly_payment = 200 payment_length = 18 total_payment = monthly_payment*payment_length result = total_payment return result
If a man reads a book, it will take him 3 hours and 10 minutes. However, if he listens to an audiobook, he first needs to wait for 15 minutes for the download before listening to one-third of the time it would have taken him to read the book. How many minutes faster will it take him to "read" the book using the audiobo...
def solve() -> int: read_time = 3*60 + 10 audiobook_time = (1/3)*read_time + 15 time_saved = read_time - audiobook_time result = time_saved return result
``` Rachel has 18 balloons. If she gives 4 balloons to her cousin and 2 balloons to her brother and blow up 3 balloons, how many balloons does she have left? If she gives away half of the remaining balloons to her friends, how many balloons would she give to her friends?
def solve() -> int: balloons = 18 balloons -= 4 balloons -= 2 balloons -= 3 left_balloons = balloons balloons /= 2 result = balloons return result
If Jackson and Jonah both caught a total of 80 fishes throughout the 5 day fishing competition, how many fishes did George catch?
def solve() -> int: fishes_jackson_jonah = 80 * 5 fishes = 250 jackson = 6 jonah = 4 fishes_george = fishes - (fishes_jackson_jonah + jackson + jonah) result = fishes_george return result
Wendy is dividing up candy for her choir class. She bought 80 pieces of candy, and there are 20 students in the class. How many pieces of candy will each student get?
def solve() -> int: total_candy = 80 total_students = 20 candy_per_student = total_candy / total_students result = candy_per_student return result
arah has $80 to go shopping. She bought a skirt for $15, a blouse for $23, and a scarf for $7. How much money does Sarah have left?
def solve() -> int: dollars = 80 skirt = 15 blouse = 23 scarf = 7 left = dollars - skirt - blouse - scarf result = left return result
The sale price of a book is $12. The original price was 20% more than the sale price. What was the original price of the book?
def solve() -> int: sale_price = 12 discount = 0.2 original_price = sale_price / (1 - discount) result = original_price return result
Student: Kate wants to calculate the average velocity of a car. The car travels a distance of 60 miles in 2 hours.
def solve() -> int: distance = 60 time = 2 velocity = distance / time result = velocity return result
A recipe calls for 2 cups of flour to make 12 cookies, how many cups of flour would be needed for 60 cookies?
def solve() -> int: cups_of_flour_for_12_cookies = 2 cookies_needed = 60 cups_of_flour_needed = cups_of_flour_for_12_cookies * cookies_needed / 12 result = cups_of_flour_needed return result
Student: In Tom's family, there are 7 adults and 3 times as many children. How many children are there in Tom's family?
def solve() -> int: adults = 7 children = 3 * adults result = adults + children return result
Ed Sheeran composes 4 new ballads and releases them as singles on Spotify. Additionally, he puts out two albums- one featuring 11 tracks and one featuring 19 tracks. How many songs has Ed Sheeran released altogether?
def solve() -> int: ballads = 4 album1_tracks = 11 album2_tracks = 19 total_songs = ballads + album1_tracks + album2_tracks result = total_songs return result
Possible questions and programs: Bella wants to plant 3 rows of flowers in her garden. Each row will have 5 flowers of the same type. The first row will have roses that are 2 feet wide each and need 3 feet between them. The second row will have sunflowers that are 4 feet wide each and need 5 feet between them. The thir...
def solve() -> int: row1 = 5 w1 = 2 s1 = 3 row2 = 5 w2 = 4 s2 = 5 row3 = 5 w3 = 1 s3 = 2 length1 = row1 * w1 + (row1 - 1) * s1 length2 = row2 * w2 + (row2 - 1) * s2 length3 = row3 * w3 + (row3 - 1) * s3 max_length = max(length1, length2, length3) ...
Amanda purchased 25 packs of pencils at $5 each. She then sold each pack for $7. What was her profit if she sold all of them?
def solve() -> int: packs_of_pencils = 25 cost_per_pack = 5 selling_price_per_pack = 7 total_cost = packs_of_pencils * cost_per_pack total_revenue = packs_of_pencils * selling_price_per_pack profit = total_revenue - total_cost result = profit return result
You have $50 to spend on school supplies. You want to buy pens ($0.50 each), notebooks ($1.25 each), and sticky notes ($0.10 each). You want to buy at least 10 pens, at least 5 notebooks, and at least 50 sticky notes. How many of each item can you buy?
def solve() -> int: pen_cost = 0.50 notebook_cost = 1.25 sticky_note_cost = 0.10 min_pens = 10 min_notebooks = 5 min_sticky_notes = 50 available_money = 50 max_pens = available_money // pen_cost max_notebooks = available_money // notebook_cost max_sticky_notes = available_money /...
The sum of two numbers is 25 and their difference is 7. What are the two numbers?
def solve() -> int: sum = 25 difference = 7 x = (sum + difference)/2 y = (sum - difference)/2 result = (x, y) return result
Ann was 18 when her mother was 45. How old is Ann's mother now?
def solve() -> int: ann_original_age = 18 mother_original_age = 45 difference = mother_original_age - ann_original_age now_age = mother_original_age + difference result = now_age return result
It takes Tanner 1 hour to bake 24 cookies and it takes Tyler 2 hours. If Tanner bakes at a rate of 12 cookies per hour, what is Tyler's baking rate in cookies per hour?
def solve() -> int: tanner_cookies = 24 tanner_time = 1 tanner_rate = tanner_cookies / tanner_time tyler_time = 2 tyler_rate = tanner_cookies / tyler_time result = tyler_rate return result
If there are 32 students in a class and the ratio of girls to boys is 3:2, how many girls are in the class?
def solve() -> int: totalStudents = 32 ratio = 3/2 girls = totalStudents / (ratio + 1) result = girls return result
Student: Brian needs to get some wood pieces cut into 30 segments. Each segment needs to be 9 inches long. How many total inches of wood does Brian need to get cut?
def solve() -> int: num_segments = 30 segment_length = 9 total_length = num_segments * segment_length result = total_length return result
The sum of two numbers is 25 and their difference is 3. What are the numbers?
def solve() -> int: total = 25 difference = 3 second_num = (total - difference)/2 first_num = total - second_num result = (first_num, second_num) return result
Emily bought 3 skirts for $20 each. She also bought 2 jackets for $50 each. She paid the cashier $190. How much change did she receive?
def solve() -> int: num_skirts = 3 skirt_price = 20 num_jackets = 2 jacket_price = 50 total_cost = (num_skirts * skirt_price) + (num_jackets * jacket_price) cash_paid = 190 change = cash_paid - total_cost result = change return result
Ten years ago, Jack started saving $100 per month. If he still saves $100 per month, how much money will he have in his savings account after twenty years? Assume the monthly interest rate is 0.5%.
def solve() -> int: savings = 0 interest_rate = 1 + 0.005/12 for i in range(240): savings = (savings + 100) * interest_rate result = round(savings, 2) return result
Samantha wants to buy a new laptop worth $1500. Her sister wants to buy the same laptop, but is only able to afford the one that costs $1200. Samantha has saved $800 and her sister has saved $600. If Samantha works part-time and gets paid $14 per hour, how many hours must she work to afford the laptops?
def solve() -> int: samantha_laptop_cost = 1500 sister_laptop_cost = 1200 samantha_savings = 800 sister_savings = 600 total_savings = samantha_savings + sister_savings remaining_cost = samantha_laptop_cost + sister_laptop_cost - total_savings hours_needed = remaining_cost / 14 resul...
am has 120 balloons for a party. He fills 48 balloons with helium and ties them to the chairs. He pops 6 balloons by mistake and throws them away. He gives 18 balloons to his friends to take home. He uses 12 balloons to make a balloon animal. How many balloons does he have left?
def solve() -> int: balloons = 120 balloons = balloons - 48 balloons = balloons - 6 balloons = balloons - 18 balloons = balloons - 12 result = balloons return result
am and Tara are sharing a pizza. The pizza has 8 slices. Sam eats 2/3 of the slices and Tara eats the rest of the slices. How many slices does Tara eat?
def solve() -> int: total_slices = 8 sam_fraction = 2 / 3 sam_slices = sam_fraction * total_slices tara_slices = total_slices - sam_slices result = tara_slices return result
Matthew has 14 shirts and Alex has 2 times as many shirts as Matthew, but 6 fewer shirts than Eliza. How many shirts do they have altogether?
def solve() -> int: matthew_shirts = 14 alex_shirts = 2 * matthew_shirts eliza_shirts = alex_shirts + 6 total_shirts = matthew_shirts + alex_shirts + eliza_shirts result = total_shirts return result
Ava wants to buy a new dress that costs $80. She already has $20 saved. She plans to sell her old jewelry to make the rest. If she sells 10 pieces of jewelry and still has $30 left after buying the dress, how much did she charge per piece of jewelry?
def solve() -> int: dress_cost = 80 saved_money = 20 pieces_of_jewelry = 10 leftover_money = 30 needed_money = dress_cost - saved_money - leftover_money price_per_piece = needed_money / pieces_of_jewelry result = price_per_piece return result
Hannah made some cupcakes for her friends. She used 8 eggs, 400 grams of flour and 200 grams of sugar. She had bought a dozen eggs for 3€, a kilogram of flour for 2€ and a kilogram of sugar for 1.5€. How much money did she spend on the ingredients?
def solve() -> int: eggs = 8 flour = 400 sugar = 200 price_egg = 3 / 12 price_flour = 2 / 1000 price_sugar = 1.5 / 1000 cost_egg = eggs * price_egg cost_flour = flour * price_flour cost_sugar = sugar * price_sugar total_cost = cost_egg + cost_flour + cost_sugar result = to...
The temperature decreased from 25°C to -5°C over a day. What was the percentage decrease in temperature?
def solve() -> int: initial_temp = 25 final_temp = -5 percent_decrease = (initial_temp - final_temp) / initial_temp * 100 result = percent_decrease return result
Some possible questions are: Eight friends collected 20 coins each. They decided to share them equally among themselves and two other friends who did not collect any coins. How many coins did each friend get in the end?
def solve() -> int: total_coins = 8 * 20 number_of_friends = 8 + 2 coins_per_friend = total_coins // number_of_friends result = coins_per_friend return result
Ben goes to the gym 3 times per week. He lifts 200 pounds per exercise for 8 sets. How many pounds does he lift in a month?
def solve() -> int: times_per_week = 3 pounds_per_exercise = 200 sets_per_exercise = 8 weeks_per_month = 4 exercises_per_month = times_per_week * weeks_per_month sets_per_month = exercises_per_month * sets_per_exercise pounds_per_month = sets_per_month * pounds_...
Sarah is selling tickets to her concert. She charges $20.00 per ticket or $120.00 for 8 tickets. How much will it cost a group to buy 15 tickets?
def solve() -> int: ticket_price = 20.00 group_size = 15 if group_size < 8: total_cost = ticket_price * group_size else: num_groups = group_size // 8 remaining_tickets = group_size % 8 total_cost = (num_groups * 120.00) + (remaining_tickets * ticket_price) r...
A classroom has 24 students and 3 teachers. Each teacher needs to monitor 8 students. How many additional teachers are needed so that each teacher is monitoring the same number of students?
def solve() -> int: students = 24 current_teachers = 3 students_per_teacher = 8 current_students_monitored = students_per_teacher * current_teachers additional_teachers_needed = (students - current_students_monitored) / students_per_teacher result = additional_teachers_needed return result
A jacket was originally priced at $200 but it was discounted by 15%. What is the discounted price?
def solve() -> int: original_price = 200 discount = 0.15 discounted_price = original_price*(1-discount) result = discounted_price return result
Ms. Green has 15 stickers and 3 times as many cards as stickers. She traded 5 stickers and 12 cards with her friend. How many more cards than stickers does she have now?
def solve() -> int: stickers = 15 cards = 3 * stickers stickers_traded = 5 cards_traded = 12 stickers_left = stickers - stickers_traded cards_left = cards - cards_traded difference = cards_left - stickers_left result = difference return result
A farmer has 300 cows, and every day, 50 cows are sent for slaughter. If the farmer purchases 100 more cows every day, how many cows would be there at the end of 6 days?
def solve() -> int: cows = 300 slaughtered_cows = 50 purchased_cows = 100 for day in range(1, 7): cows -= slaughtered_cows cows += purchased_cows result = cows return result
An ice cream shop produces 500 ice cream containers in the beginning of the summer. The shop then produces 30% more ice cream containers in every month in the summer, how many ice cream containers will the shop produce by the end of the summer?
def solve() -> int: ice_cream_June = 500 percentage_increase = 0.3 ice_cream_July = ice_cream_June * (1 + percentage_increase) ice_cream_August = ice_cream_July * (1 + percentage_increase) total = ice_cream_June + ice_cream_July + ice_cream_August result = total return r...
John invested $5,000 in a mutual fund with an annual interest rate of 7%. What is the value of his investment after 5 years if he did not withdraw any money?
def solve() -> int: investment = 5000 interest_rate = 0.07 time = 5 value = investment * (1 + interest_rate) ** time result = value return result
A square has a side length of 8 cm. What is the perimeter of the square?
def solve() -> int: side_length = 8 perimeter = 4 * side_length result = perimeter return result
Max had 3 different types of pencils. One type had 7 left and the other had 2 left. His friend, Ben, had 3 types of pencils. One type had 9 left and the other had 4 left. How many more pencils did Ben have than Max?
def solve() -> int: max_pencil_type1 = 7 max_pencil_type2 = 2 ben_pencil_type1 = 9 ben_pencil_type2 = 4 max_total_pencils = max_pencil_type1 + max_pencil_type2 ben_total_pencils = ben_pencil_type1 + ben_pencil_type2 difference = ben_total_pencils - max_total_pencils r...
Three friends decide to split a pizza. The pizza was cut into six slices. If they each eat 2 slices, how many slices are left?
def solve() -> int: total_slices = 6 slices_per_person = 2 slices_left = total_slices - (slices_per_person * 3) result = slices_left return result
Mark wants to buy a new phone that costs $500. He has saved $300 and earns $50 per week. How many weeks will he need to save up enough money to buy the phone?
def solve() -> int: phone_cost = 500 saved_money = 300 weekly_earnings = 50 money_needed = phone_cost - saved_money weeks_needed = money_needed / weekly_earnings result = weeks_needed return result
If 4 chairs cost $180, how much would it cost for 18 chairs?
def solve() -> int: chair_price = 180 chair_number = 18 total_cost = chair_price * chair_number result = total_cost return result
A pizza restaurant sells pizzas for $15 each and they charge an additional fee of $2 for toppings. If Paul buys 3 pizzas with 2 toppings each, what is his total bill?
def solve() -> int: pizza_price = 15 topping_price = 2 pizzas = 3 toppings = 2 total_bill = pizzas*(pizza_price+toppings*topping_price) result = f'$ {total_bill} is the total bill' result = total_bill return result