question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Dana is saving money for a trip. She already has $250 in her savings account. She can deposit $50 every month from her allowance. The trip costs $800 and will take place in 6 months. How much more money does she need to save by then?
def solve() -> int: savings = 250 deposit = 50 trip_cost = 800 months = 6 total = savings + deposit * months difference = trip_cost - total result = difference return result
A packet of powdered sugar weighs 500g. If 20% of the packet is used, how much powdered sugar is left?
def solve() -> int: packet_weight = 500 used_percentage = 0.2 used_weight = packet_weight * used_percentage remaining_weight = packet_weight - used_weight result = remaining_weight return result
A baseball team has won 21 games and lost 16 games. What is their winning percentage?
def solve() -> int: total_games = 21 + 16 games_won = 21 winning_percent = (games_won / total_games) * 100 result = winning_percent return result
A park has 28 trees. 1/4 of the trees are oak trees. How many oak trees are there in the park?
def solve() -> int: total_trees = 28 oak_trees = total_trees // 4 result = oak_trees return result
A cake recipe calls for 3/4 cups of sugar for every 2 cups of flour. If you need 5 cups of flour for your cake, how much sugar do you need?
def solve() -> int: flour_cups = 5 sugar_cups = (3/4) * (flour_cups / 2) result = sugar_cups return result
How many minutes are there in 1 week?
def solve() -> int: minutes_in_hour = 60 hours_in_day = 24 days_in_week = 7 minutes_in_week = minutes_in_hour * hours_in_day * days_in_week result = minutes_in_week return result
Student: The local bookstore is running a sale to encourage people back to the stores. All books are currently priced at 10% off the regular price. Ana purchased 6 books for a total of $134. What would the regular price of the 6 books be?
def solve() -> int: x = 134 / 5.4 result = round(x * 10, 2) return result
Tina had 36 pencils. She gave 9 pencils to her brother and 6 pencils to her sister. Then she received 4 pencils from her teacher and 2 pencils from her friend. She used 3 pencils each day for homework and 5 pencils each day for drawing. How many pencils did she have left after 3 days?
def solve() -> int: pencils = 36 pencils = pencils - 9 - 6 pencils = pencils + 4 + 2 pencils = pencils - (3 + 5) * 3 result = pencils return result
Student: 1. Tom has 42 apples in total. Every day the number of apples increased by 6. After 7 days, how many apples will Tom have?
def solve() -> int: apples = 42 increase = 6 days = 7 total = apples + increase * days result = total return result
If Tom goes through 3 cans of soda every day and likes to buy enough for the entire year when there is a 20% discount, how much will all of his soda cost after the discount if each can is $1.50?
def solve() -> int: cans_per_day = 3 discount = 0.2 price_per_can = 1.5 days_per_year = 365 cans_per_year = cans_per_day * days_per_year total_price_before_discount = cans_per_year * price_per_can discount_amount = total_price_before_discount * discount total_price_after_discount = ...
A train can travel 240 miles in 3 hours. If it continues to travel at the same speed, how long will it take to travel 320 miles?
def solve() -> int: distance = 240 time = 3 speed = distance / time new_distance = 320 new_time = new_distance / speed result = new_time return result
A rectangular picture is 9 cm longer than it is wide. A frame with a width of 3 cm is placed around the picture. The area of the picture and the frame is 672 square cm. Find the dimensions of the picture.
def solve() -> int: total_area = 672 frame_width = 3 length_to_width_ratio = 9/3 length = (total_area + ((frame_width*2)+(length_to_width_ratio*frame_width*2))) / ((length_to_width_ratio+1)*2) width = length / length_to_width_ratio result = (length, width) return result
The sum of two consecutive numbers is 85. What are the numbers?
def solve() -> int: num1 = (85-1)/2 num2 = (85+1)/2 result = num1, num2 return result
Student: At a pet store, there are 250 fish tanks. If 20% of the tanks are saltwater, how many are freshwater tanks?
def solve() -> int: total_tanks = 250 saltwater_tanks = total_tanks * 0.2 freshwater_tanks = total_tanks - saltwater_tanks result = freshwater_tanks return result
Student: Pauline had 9 treats. She shared 2 with Kayla, 3 with James and gave away the last 4. How many treats did Pauline keep?
def solve() -> int: total_treats = 9 shared_with_kayla = 2 shared_with_james = 3 gave_away = 4 total_shared = shared_with_kayla + shared_with_james total_kept = total_treats - total_shared - gave_away result = total_kept return result
Betty buys 9 packs of fruits which contain 3 fruits in each pack. How many fruits does she have in total?
def solve() -> int: packs = 9 fruits_in_each_pack = 3 total = 0 for x in range(1, packs+1): total = total + fruits_in_each_pack result = total return result
In a classroom, there are three students. Student A has 6 more pencils than student B, while student B has 4 more pencils than student C. If student C has 8 pencils, how many pencils are there in all three students' possession?
def solve() -> int: c_pencils = 8 b_pencils = c_pencils + 4 a_pencils = b_pencils + 6 total_pencils = a_pencils + b_pencils + c_pencils result = total_pencils return result
David buys a book for $10 and sells it for $12. He repeats this process with another book. How much profit does he make in total?
def solve() -> int: book_cost = 10 book_price = 12 profit_per_book = book_price - book_cost number_of_books = 2 total_profit = profit_per_book * number_of_books result = total_profit return result
Mr. Johnson has a class of 25 students. One-third of his class answered blue, one-fourth answered red, and the remaining students answered green. How many students answered green?
def solve() -> int: n_students = 25 blue = n_students / 3 red = n_students / 4 green = n_students - blue - red result = green return result
Emily had 4 pieces of chicken and 3 slices of toast for dinner last night. Today, she plans to have 2 more pieces of chicken than yesterday, 6 times as many toasts as she ate yesterday, and half the number of slices of bread as pieces of chicken she'll have today. How many food items would Emily have eaten so far in th...
def solve() -> int: yesterday_chicken = 4 yesterday_toast = 3 today_chicken = yesterday_chicken + 2 today_toast = yesterday_toast * 6 today_bread = today_chicken / 2 total_food = yesterday_chicken + yesterday_toast + today_chicken + today_toast + today_bread result = total_food return re...
Question6: LeBron can walk 8 km in 30 minutes. How far can he walk in 2.5 hours?
def solve() -> int: distance_per_30_min = 8 total_time = 2.5 total_distance = distance_per_30_min * (total_time * 2) result = total_distance return result
Danny was making LEGO creations. He had 48 pieces in his bag, and used 30 pieces to build his model. How many pieces did Danny have left in his bag?
def solve() -> int: lego_total = 48 lego_used = 30 result = lego_total - lego_used return result
Stella is a seamstress making a dress. She needs 10 yards of fabric to complete the dress. For every 2 yards of fabric, she needs to use one button and for every button, she needs to use 4 feet of thread. If Stella has a spool of 200 feet of thread, how many feet of thread will be remaining after she completes making t...
def solve() -> int: fabric_needed = 10 button_needed = fabric_needed / 2 thread_needed = button_needed * 4 thread_remaining = 200 - thread_needed result = thread_remaining return result
Here are some possible questions and programs: Lisa has a jar of 60 jelly beans. She eats 12 of them and then shares the rest equally with her three siblings. How many jelly beans does she have left?
def solve() -> int: jar = 60 eaten = 12 shared = 4 remaining = jar - eaten left = remaining // shared result = left return result
John has $150 saved for a new bike. The bike costs $350. If he saves $25 every week, how long will it take for him to buy the bike?
def solve() -> int: saving_per_week = 25 current_savings = 150 required_savings = 350 weeks_to_save = (required_savings - current_savings) / saving_per_week result = weeks_to_save return result
Arthur was planting flowers in his garden and bought 9 bags of soil, each of which weighs 10 pounds. How much soil did he buy in total?
def solve() -> int: x = 10 y = 9 result = x * y return result
Mike has a collection of 400 comic books. He wanted to divide them up and give 3/5 of them to his friend and the rest to his brother. Calculate how many comic books Mike will give to each person.
def solve() -> int: total_number_of_comics = 400 percentage_of_friend = 3/5 number_of_comics_to_friend = total_number_of_comics * percentage_of_friend number_of_comics_to_brother = total_number_of_comics - number_of_comics_to_friend result = (number_of_comics_to_friend, number_of_comics_to_brother) ...
A garden is 20m long and 15m wide. If 2/3 of the garden is covered with grass, how much area is covered with grass?
def solve() -> int: length = 20 width = 15 total_area = length * width grass_area = (2/3) * total_area result = grass_area return result
Daniel wants to fill a 200-liter swimming pool with water. He turns on the water pump for 5 minutes before turning it off for 2 minutes. This process repeats until the pool is full. However, the pool has a small hole where 3 liters of water escape per minute. The water pump supplies water at a rate of 30 liters per min...
def solve() -> int: pump_rate = 30 leak_rate = 3 pool_capacity = 200 time = 0 water_in_pool = 0 while water_in_pool < pool_capacity: time += 5 water_in_pool += (pump_rate - leak_rate) * 5 if water_in_pool >= pool_capacity: break ...
Lily, Rose, and Daisy went to a park. Lily picked twice as many flowers as Rose, and Daisy picked five more flowers than Lily. If Rose picked 15 flowers, how many flowers did they all pick together?
def solve() -> int: rose = 15 lily = 2 * rose daisy = lily + 5 total_flowers = rose + lily + daisy result = total_flowers return result
On Tuesday, Lilly completed 4 out of 5 tasks and 7 out of 10 tasks on Wednesday. What fraction of the total tasks that she needs to do is complete?
def solve() -> int: tasksCompletedTue = 4 tasksToDoTue = 5 tasksCompletedWed = 7 tasksToDoWed = 10 totalTasksCompleted = tasksCompletedTue + tasksCompletedWed totalTasksToDo = tasksToDoTue + tasksToDoWed result = totalTasksCompleted / totalTasksToDo return result
Hailey is preparing for a picnic with her friends. She needs to bring 10 sandwiches per each of her 12 friends. She's already made 4 dozen sandwiches. How many more dozen sandwiches should she make?
def solve() -> int: friends = 12 sandwiches_per_friend = 10 sandwiches_per_dozen = 12 total_sandwiches_needed = friends * sandwiches_per_friend total_sandwiches_made = 4 * sandwiches_per_dozen sandwiches_needed = total_sandwiches_needed - total_sandwiches_made dozen_sandwiches_need...
Ava and Ethan are organizing a graduation party. Ava has invited 80 guests, and Ethan has invited one third of that number of guests. They have hired a caterer to make snacks for each guest at the graduation party. The caterer always makes twenty extra snacks just in case something goes wrong. Each plate of mini pizzas...
def solve() -> int: ava_guests = 80 ethan_guests = ava_guests / 3 total_guests = ava_guests + ethan_guests snacks_per_guest = 1 extra_snacks = 20 total_snacks = (total_guests * snacks_per_guest) + extra_snacks pepperoni_slices_per_snack = 5 total_pepperoni_slices = total_snacks * peppero...
A train travels 40 miles per hour. If it travels for 1.5 hours, how far does it go?
def solve() -> int: distance_traveled = 40 * 1.5 result = distance_traveled return result
Possible questions and programs: A farmer harvested 120 apples from his orchard. He sold 3/5 of them at the market and gave 1/10 of the remaining ones to his neighbor. How many apples did he have left?
def solve() -> int: apples = 120 sold = 3/5 * apples left = apples - sold given = 1/10 * left left = left - given result = left return result
A paint can covers 400 square feet. If a room is 10 feet by 15 feet and has two walls, one wall that is 10 feet by 8 feet, and another wall that is 15 feet by 8 feet, how many paint cans do you need to paint all four walls?
def solve() -> int: area_of_first_wall = 10*8 area_of_second_wall = 15*8 area_of_third_wall = 10*15 total_area_to_paint = (2*area_of_first_wall) + (2*area_of_second_wall) + area_of_third_wall paint_cans_needed = total_area_to_paint/400 result = paint_cans_needed return result
The train is going from station A to station B which is 280 miles away. If the train's speed is 40 mph, how long will it take for the train to reach station B?
def solve() -> int: time = 0 for miles in range(280): time += 1 / 40 result = time return result
A company has 100 employees. On Monday, 10 employees quit and 5 more were hired. On Tuesday, 6 employees were fired and 2 more were hired. How many employees are still working in the company on Tuesday?
def solve() -> int: company_employees = 100 monday_quitters = 10 company_employees = company_employees - monday_quitters monday_hires = 5 company_employees = company_employees + monday_hires tuesday_fired = 6 company_employees = company_employees - tuesday_fired tuesday_hires = 2 com...
Amy has 180 beads. She decided to make some bracelets with 6 beads each and some necklaces with 15 beads each. She made 15 bracelets and 7 necklaces. How many beads did she have left?
def solve() -> int: x = (6 * 15) + (15 * 7) y = 180 - x result = y return result
John has a job that pays him $20 an hour. If he works for 8 hours a day for 5 days a week, how much money will he earn in one week?
def solve() -> int: pay_per_hour = 20 hours_per_day = 8 days_per_week = 5 weekly_earnings = pay_per_hour * hours_per_day * days_per_week result = weekly_earnings return result
A baseball team won 25 out of the 40 games they played. What percentage of games did they win?
def solve() -> int: percentage = (25/40)*100 result = percentage return result
A rectangle has a length of 8cm and a width of 5cm. What is its perimeter?
def solve() -> int: length = 8 width = 5 perimeter = 2 * (length + width) result = perimeter return result
A store has a 20% off sale on all items. If the original price of a shirt is $25, how much will it cost during the sale?
def solve() -> int: original_price = 25 discount = 0.2 sale_price = original_price * (1-discount) result = sale_price return result
At a grocery store, John weighs fruits for customers. In an hour, he can weigh 20 fruits that weigh an average of 0.5 pounds each. How many pounds of fruit can John weigh in a 6 hour workday?
def solve() -> int: fruits_per_hour = 20 average_weight = 0.5 hours_worked = 6 total_fruits = fruits_per_hour * hours_worked total_weight = total_fruits * average_weight result = total_weight return result
Olivia walked 2 miles on Monday. The next day, she walked another 4 miles, and on the third day, she walked four times the number she got from the first two days. How many miles did Olivia walk in total?
def solve() -> int: monday_distance = 2 tuesday_distance = 4 wednesday_distance = 4 * (monday_distance + tuesday_distance) total_distance = monday_distance + tuesday_distance + wednesday_distance result = total_distance return result
A group of friends had pizza delivered for their party. The pizza was sliced into 8 pieces and they ordered 4 pizzas. If each friend eats 2 slices of pizza, how many friends are at the party?
def solve() -> int: num_slices_per_pizza = 8 num_pizzas = 4 total_slices = num_slices_per_pizza * num_pizzas num_friends = total_slices / 2 result = num_friends return result
Emily's chinchilla bit her. She decided to take herself and the chinchilla to the veterinarian. Her visit to the veterinarian cost $600 and insurance covered 80%. Her chinchilla's visit cost $120 and her pet insurance covered $60. How much did Emily pay?
def solve() -> int: vet_cost = 600 insurance_coverage = 0.8 chinchilla_cost = 120 insurance_coverage_chinchilla = 60 vet_cost_after_insurance = vet_cost * (1 - insurance_coverage) chinchilla_cost_after_insurance = chinchilla_cost - insurance_coverage_chinchilla total_cost = vet_cos...
Student: Ellie wants to make muffins for her breakfast. It will take 2 and a half cups of flour, 1 cup of milk, and 2 eggs to make 12 muffins. If she has 10 cups of flour, 4 cups of milk, and 8 eggs, how many muffins can she make in total?
def solve() -> int: flour_per_muffin = 2.5 milk_per_muffin = 1 eggs_per_muffin = 2 total_flour = 10 total_milk = 4 total_eggs = 8 muffins_from_flour = total_flour // flour_per_muffin muffins_from_milk = total_milk // milk_per_muffin muffins_from_eggs = total_eggs // eggs_per_muffin ...
David wants to order a burger which costs $7 and a milkshake which costs $5. If he gives a 20% tip to the server for each item, what will be his total cost?
def solve() -> int: burger_cost = 7 milkshake_cost = 5 tip_percentage = 0.2 burger_tip = burger_cost * tip_percentage milkshake_tip = milkshake_cost * tip_percentage total_cost = burger_cost + milkshake_cost + burger_tip + milkshake_tip result = total_cost return resu...
A car travels 60 miles per hour. If the car travels for 2.5 hours, how far will it go?
def solve() -> int: distance = 60 * 2.5 result = distance return result
Max, the mechanic, arrives at work early every morning to fix cars throughout the day. It usually takes Max 30 minutes to diagnose the problem, 1 hour to fix it, and another 15 minutes to run the car through a quick test drive. One day, Max received a car that was in a really bad shape and it took four times longer to ...
def solve() -> int: diagnose_time = 30 fix_time = 60 test_drive_time = 15 bad_day_multiplier = 4 total_time = (diagnose_time + fix_time + test_drive_time) * bad_day_multiplier result = total_time return result
If a store has 30 shelves, and each shelf has 10 boxes on it, then how many boxes are in the store?
def solve() -> int: number_of_shelves = 30 boxes_per_shelf = 10 result = number_of_shelves * boxes_per_shelf return result
-Do not repeat the same logic or numbers from the given question or other questions. Some possible questions are: James bought a notebook for 2.3$, a pen for 0.8$, and a ruler for 1.2$. He paid with a 10$ bill. How much change did he get back?
def solve() -> int: total_cost = 2.3 + 0.8 + 1.2 change = 10 - total_cost result = change return result
John's team won 8 matches in February, then they won 2 matches per week in March. How many matches did they win altogether in February and March?
def solve() -> int: feb_matches = 8 mar_matches = 2 * 4 total_matches = feb_matches + mar_matches result = total_matches return result
David and three friends are to collect 180 bottles for recycling. David collects 45 bottles and his first friend collects 36 bottles. The second friend collects 5 more bottles than the third friend. How many bottles does the second friend collect?
def solve() -> int: total_bottles = 180 david_bottles = 45 first_friend_bottles = 36 second_friend_extra_bottles = 5 remaining_bottles = total_bottles - david_bottles - first_friend_bottles two_friends_bottles = remaining_bottles / 2 second_friend_bottles = two_friends_bottles + s...
Tom wants to buy a new laptop. If the laptop costs $600 and he needs to pay $100 per month for 6 months, how much money will he have left after he pays for the laptop?
def solve() -> int: laptop_cost = 600 num_payments = 6 payment_amount = 100 total_paid = num_payments * payment_amount money_left = laptop_cost - total_paid result = money_left return result
Emily has 32 more marbles than Noah, who has five times as many as Mason. If Mason has 6 marbles, how many more marbles does Emily have than Noah? Sammy is twice as old as his little cousin. In 10 years, Sammy will be 30 years old. How old is his little cousin today?
def solve() -> int: mason_marbles = 6 noah_marbles = mason_marbles * 5 emily_marbles = noah_marbles + 32 emily_more_marbles = emily_marbles - noah_marbles sammy_future_age = 30 sammy_current_age = sammy_future_age - 10 little_cousin_age = sammy_current_age / 2 result = emi...
Ethan has 24 pencils. He gives 1/3 of them to his sister and 1/4 of them to his brother. He uses 2 pencils every day for his homework. How many days will it take for him to use up all his pencils?
def solve() -> int: pencils_given = 24 * (1/3 + 1/4) pencils_left = 24 - pencils_given days = pencils_left / 2 result = days return result
In a race, the winner's time was 25.8 seconds. The runner-up was only 0.3 seconds behind the winner. What was the time of the runner-up?
def solve() -> int: winner_time = 25.8 difference = 0.3 runner_up_time = winner_time + difference result = runner_up_time return result
Two siblings share a monthly allowance equally. If their monthly allowance is $80 and one sibling spent $35, how much did the other sibling spend?
def solve() -> int: monthly_allowance = 80 spent_by_one_sibling = 35 remaining_allowance = monthly_allowance - spent_by_one_sibling spent_by_other_sibling = remaining_allowance / 2 result = spent_by_other_sibling return result
Emily watches 4 movies that are all 90 minutes long and one movie that is 120 minutes long. How much time does she spend watching movies?
def solve() -> int: movie_length = 90 num_movies = 4 extra_movie_length = 120 total_time = movie_length * num_movies + extra_movie_length result = total_time return result
Joe can drive 120 miles in 8 hours. How many miles can he drive in 20 hours?
def solve() -> int: distance = 120 time = 8 linear_velocity = distance / time result_distance = linear_velocity * 20 result = 600 return result
A rectangle has a length of 12 cm and a width of 6 cm. What is the perimeter of the rectangle?
def solve() -> int: Length = 12 Width = 6 Perimeter = 2 * (Length + Width) result = Perimeter return result
Possible new questions and programs: Eli loves to bake cakes, and he wants to buy some new ingredients and tools. His dad agrees to pay him $3 for every cake he sells to his neighbors, and $2 for every hour he helps in the garden. Eli bakes and sells 4 cakes, and spends 1.5 hours in the garden. How much money has Eli m...
def solve() -> int: cakes = 4 cake_price = 3 garden_time = 1.5 garden_rate = 2 cake_money = cakes * cake_price garden_money = garden_time * garden_rate total_money = cake_money + garden_money result = total_money return result
Student: Sam bought 6 bags of chips. If 3 of the bags cost the same amount, and the remaining three cost $2 each, how much did Sam pay for the same priced bags?
def solve() -> int: total_bags = 6 same_price_bags = 3 cheap_bags_cost = 2 total_cost = 0 same_price_cost = total_cost - (cheap_bags_cost * (total_bags - same_price_bags)) result = same_price_cost return result
Student: Q1. Jessica bought 5 pens and 10 erasers with her allowance money. Each pen cost $2 and each eraser cost $1. How much money does Jessica have left?
def solve() -> int: pens = 5 pen_cost = 2 erasers = 10 eraser_cost = 1 allowance = 20 total_cost = pens * pen_cost + erasers * eraser_cost money_left = allowance - total_cost result = money_left return result
If the total length of a rectangle is 36 cm and its width is 12 cm, calculate the area.
def solve() -> int: length = 36 width = 12 area = length * width result = area return result
Joe wanted to buy a new monitor and he decided to get a discount of 20%. The price of the monitor was $400 and he had to pay 8% sales tax on the discounted price. How much money did Joe have to pay?
def solve() -> int: price_monitor = 400 discount_monitor = price_monitor * 0.20 price_discounted = price_monitor - discount_monitor tax = price_discounted * 0.08 final_cost = price_discounted + tax result = final_cost return result
Mrs. Martin is shopping for groceries. She has $64 and wants to know how many boxes of apples and oranges can she buy. Each box of apples cost $4 and each box of oranges cost $6. How many boxes of apples and oranges can she buy?
def solve() -> int: budget = 64 apple_price = 4 orange_price = 6 max_apple_box = budget//apple_price max_orange_box = budget//orange_price result = 'Mrs. Martin can buy'+ str(max_apple_box) +'boxes of apples and'+ str(max_orange_box) +'boxes of oranges' return result
A recipe for a cake requires 2 cups of flour. If you want to make 3 cakes, how many cups of flour do you need?
def solve() -> int: cakes = 3 flour_per_cake = 2 total_flour = cakes * flour_per_cake result = total_flour return result
Jonny had 6 toy cars and he receives 4 more as a birthday present. He then gives 2 of his toy cars away to his younger brother. What is the total number of toy cars Jonny has?
def solve() -> int: toy_cars=6+4-2 result=toy_cars return result
10. If a rectangular field has a length of 60 meters and a width of 50 meters, what is the area of the field?
def solve() -> int: length = 60 width = 50 area = length * width result = area return result
Tyler collected 30 rocks. Ava collected three times as many rocks as Tyler. If Tyler gave away a quarter of his rocks and Ava sold half of hers, how many rocks do they have left in total?
def solve() -> int: tyler_rocks = 30 ava_rocks = 3 * tyler_rocks tyler_rocks = tyler_rocks - (tyler_rocks / 4) ava_rocks = ava_rocks - (ava_rocks / 2) total_rocks = tyler_rocks + ava_rocks result = total_rocks return result
A rectangle has a length of 10 cm and a width of 6 cm. If a triangle is cut out of it with a base of 4 cm, and a height of 3 cm, what is the area of the remaining shape?
def solve() -> int: rectangle_area = 10 * 6 triangle_area = 4 * 3 / 2 remaining_area = rectangle_area - triangle_area result = remaining_area return result
Alex has a bookshelf with 25 shelves. Each shelf has 60 books, and 20% of the books are hardcovers while the rest are paperbacks. How many hardcover books does Alex have on their bookshelf?
def solve() -> int: shelves = 25 books_per_shelf = 60 total_books = shelves * books_per_shelf hardcover_percentage = 20 hardcover_books = (hardcover_percentage / 100) * total_books result = hardcover_books return result
Two cars move away from each other on a straight line road from a point P. The blue car moves at a rate of 60 miles per hour while the red car moves at 40 miles per hour. After how many hours will the cars be 120 miles away from the point P?
def solve() -> int: separation_distance = 120 blue_car_speed = 60 red_car_speed = 40 total_time = separation_distance/(blue_car_speed + red_car_speed) result = total_time return result
Dan bought 3 burgers for $5 each and 2 fries for $3 each. He spent a total of $19. How much did each burger cost?
def solve() -> int: num_burgers = 3 cost_per_burger = 5 num_fries = 2 cost_per_fry = 3 total_cost = 19 result = cost_per_burger return result
Student: A park has a circular pond with a radius of 10 m. A path surrounds the pond with a width of 2 m. What is the area of the path?
def solve() -> int: radius = 10 width = 2 area_circle = 3.14 * radius**2 area_pond = 3.14 * (radius - width)**2 area_path = area_circle - area_pond result = area_path return result
Laila has $80 more money than her sister Hadeel. If Laila has $180, and they decide to combine and share the money equally, how much money does each get?
def solve() -> int: laila_money = 180 hadeel_money = laila_money - 80 total_money = laila_money + hadeel_money each_get = total_money / 2 result = each_get return result
Student: Jamie has three jars of apple sauce. Each jar contains 630 milliliters of apple sauce. How many liters in total does Jamie have?
def solve() -> int: jar_size = 630 num_jars = 3 total_milliliters = jar_size * num_jars total_liters = total_milliliters / 1000 result = total_liters return result
Student: In a store, there are red apples, green apples, and yellow apples. There are 8 red apples. The green apples are 4 more than the red apples, and there are 10 fewer yellow apples than the total number of red and green apples combined. How many apples are there in the store?
def solve() -> int: red_apples = 8 green_apples = red_apples + 4 total_red_green_apples = red_apples + green_apples yellow_apples = total_red_green_apples - 10 total_apples = total_red_green_apples + yellow_apples result = total_apples return result
Student: At a store, a customer bought 4 items at a total cost $59.25. What is the average cost of each item?
def solve() -> int: total_cost = 59.25 number_of_items = 4 average_cost = total_cost / number_of_items result = average_cost return result
Student: Leo has 500 candy bars in his pantry. He gives away 1/10 of them to his friends on Halloween. Then he eats 1/5 of the remaining candy bars as a treat. He realizes he has too many candy bars and decides to sell 2/7 of the remaining candy bars for $1 each. How much money does he make from selling the candy bars ...
def solve() -> int: candy_bars = 500 given_away = candy_bars * 1/10 eaten = (candy_bars - given_away) * 1/5 sold = (candy_bars - given_away - eaten) * 2/7 money_made = sold * 1 candy_bars_left = candy_bars - given_away - eaten - sold result = (money_made, candy_bars_left) return result
A school wants to build a rectangular playground with a perimeter of 60 meters. If one side of the playground is 5 meters long, what is the length of its other side in meters?
def solve() -> int: given_side = 5 perimeter = 60 other_side = (perimeter - 2*given_side)/2 result = other_side return result
The total time taken by a car to travel a certain distance is 15 hours. If the car travels 30 MPH uphill and 50 MPH downhill and the uphill distance is twice the downhill distance, what is the distance traveled?
def solve() -> int: time = 15 speed_uphill = 30 speed_downhill = 50 distance_downhill = time * speed_downhill / (speed_uphill + speed_downhill) distance_uphill = 2 * distance_downhill total_distance = distance_uphill + distance_downhill result = total_distance return result
A car travels 300 km on 20 litres of fuel. How far can it travel on 30 litres of fuel?
def solve() -> int: distance_per_litre = 300/20 total_distance = distance_per_litre*30 result = total_distance return result
A lemonade stand buys 20 gallons of lemonade for $15. Each gallon costs $. 77 to make and the stand sells each gallon for $2.50. How much profit did the stand make if all the lemonade was used?
def solve() -> int: cost = 15 amount = 20 price_selling = 2.5 price_making = 0.77 total_making = amount*price_making profit = price_selling*amount - cost result = profit return result
Sarah won $650 in a writing contest. She gave 1/2 of her winnings to charity and spent 1/5 on a new laptop. How much money did Sarah have left?
def solve() -> int: winnings = 650 charity = winnings / 2 laptop = winnings / 5 left = winnings - charity - laptop result = left return result
If Tom is twice as old as Sam and the difference between their ages is 16, how old is each person?
def solve() -> int: age_diff = 16 tom_age = (age_diff + (2*age_diff)) / 3 sam_age = tom_age - age_diff result = (tom_age, sam_age) return result
Student: - A pack of stickers contains 50 stickers. Isabel collects 5 stickers every day from her friends. If she starts with an empty pack of stickers, how many days will it take for her to fill up the pack of stickers?
def solve() -> int: stickers_in_pack = 50 stickers_collected_per_day = 5 days = stickers_in_pack // stickers_collected_per_day result = days return result
Student: Brian is a quarter century older than Tom. How old is Brian now if Tom is currently 42 years old?
def solve() -> int: tom_age = 42 brian_age = tom_age + 25 result = brian_age return result
Student: A recipe calls for 2 cups of sugar for every 3 cups of flour. If you want to make 10 cups of flour, how much sugar do you need?
def solve() -> int: sugar = 2 flour = 3 target_flour = 10 ratio = sugar / flour sugar_needed = ratio * target_flour result = sugar_needed return result
Ben is making paper airplanes with different designs. He measures how far each airplane flies in meters. The first airplane flies 6 meters, the second airplane flies 50% farther than the first one, and the third airplane flies 20% less than the second one. What is the average distance that his airplanes fly?
def solve() -> int: airplane_1 = 6 airplane_2 = 0 airplane_3 = 0 total = 0 average = 0 airplane_2 = airplane_1 * 1.5 airplane_3 = airplane_2 * 0.8 total = airplane_1 + airplane_2 + airplane_3 average = total / 3 result = average return result
Jacob skates for 30 minutes each day on Monday through Thursday. Then he skates twice the amount of time he skated on Monday every Friday and Saturday. How many minutes will he skate in two months with 8 weeks?
def solve() -> int: min_mon = 30 min_tues = 30 min_wed = 30 min_thur = 30 min_fri = min_mon * 2 min_sat = min_mon * 2 total_min = (min_mon + min_tues + min_wed + min_thur) * 8 + (min_fri + min_sat) * 8 result = total_min return result
Alice has $500 in her bank account. She deposits $75 each month. How much money will Alice have in her bank account after 13 months?
def solve() -> int: starting_balance = 500 monthly_deposit = 75 number_of_months = 13 total_balance = starting_balance + (monthly_deposit * number_of_months) result = total_balance return result
Alex earns $600 if he works for 45 hours a week and gets an extra $22 for every hour of overtime. If he worked 55 hours last week, calculate his total income.
def solve() -> int: hourly_pay = 600/45 overtime_pay = 22 regular_hours = 45 overtime_hours = 55 - regular_hours regular_pay = regular_hours * hourly_pay overtime_pay = overtime_hours * overtime_pay total_income = regular_pay + overtime_pay result = total_income return result
Student: Gina started making bracelets with 6 beads when she was 6 years old. By the time she was three times that age, she was making bracelets with 5 times more beads. 7 years later, she was making bracelets with 4 times more beads than before. Presently, she makes bracelets with 3 times the previous number of beads....
def solve() -> int: beads_6 = 6 beads_3x = beads_6 * 5 beads_7y = beads_3x * 4 beads_now = beads_7y * 3 result = beads_now return result
A bus can fit 60 passengers. At its first pickup point, 3/5 of the bus's carrying capacity is filled up with passengers. How many passengers have already boarded the bus?
def solve() -> int: bus_capacity = 60 filled_capacity = 3/5 result = bus_capacity * filled_capacity return result
If I'm 4 times older than Grace currently, and Grace is 8 years old, how old was I when Grace was born?
def solve() -> int: grace_age = 8 my_age = 4 * grace_age my_age_when_grace_was_born = my_age - grace_age result = my_age_when_grace_was_born return result
A rectangle has a length of 10 cm and a width of 6 cm. What is the perimeter of the rectangle?
def solve() -> int: perimeter = 2 * (10 + 6) result = perimeter return result