question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Lisa can make 8 bracelets in an hour using her beads. She has 200 beads in total. How many hours will she need to use up all her beads if each bracelet uses 10 beads?
def solve() -> int: bracelets = 200 / 10 hours = bracelets / 8 result = round(hours, 2) return result
A rectangular plot of land is 8 meters wide and 12 meters long. If John puts a fence around the perimeter of the plot, how many meters of fence will he need?
def solve() -> int: width = 8 length = 12 area = width * length perimeter = 2 * (width + length) total_fence_length = perimeter result = total_fence_length return result
A garden has a length of 12 feet and a width of 8 feet. If each square tile that covers the garden is 1 square foot, how many tiles do you need to cover the garden?
def solve() -> int: garden_area = 12 * 8 num_tiles = garden_area result = num_tiles return result
Joe was asked to redesign a logo by his client Mrs. Robinson. The time he took to create the font was five times shorter than the time he took to create the icon. He spent 4 hours on the font and then devoted 20 hours to the icon. If he charged Mrs. Robinson $10 per hour of work, what was the total amount of money that...
def solve() -> int: font_time = 4 icon_time = 20 total_time = font_time + icon_time hourly_rate = 10 font_time = icon_time / 5 total_hours = font_time + icon_time total_cost = total_hours * hourly_rate result = total_cost return result
A square piece of paper has a side length of 9 cm. What is the perimeter and area of the square?
def solve() -> int: side_length = 9 perimeter = 4*side_length area = side_length**2 result = (perimeter, area) return result
Anna can paint a wall in 6 hours and Ben can paint the same wall in 4 hours. If they work together, how long will it take them to paint 3 walls?
def solve() -> int: result = 12/5 return result
Emily is knitting a scarf while listening to her favorite music. She can knit one row every 10 seconds. If the scarf requires 200 rows and Emily wants to finish it in 2 hours, how many rows can she knit in a minute?
def solve() -> int: rows_per_second = 1/10 total_seconds = 2 * 60 * 60 total_rows = rows_per_second * total_seconds rows_per_minute = total_rows / 120 result = rows_per_minute return result
In a class of 50 students, 60% of the students are boys. How many girls are there in the class?
def solve() -> int: total_students = 50 boys_percentage = 60 girls_percentage = 100 - boys_percentage girls_count = (girls_percentage / 100) * total_students result = girls_count return result
A toy store sells puzzles at $4 each, board games at $15 each, and dolls at $25 each. There is a 25% off coupon that can be used on one item. The sales tax is 7%. Ben wants to buy three puzzles, two board games, and one doll for his niece. He decides to use the coupon on the most expensive item. How much does Ben have ...
def solve() -> int: if 25 > 15 and 25 > 4: doll = 25 * 0.75 else: doll = 25 subtotal = 3 * 4 + 2 * 15 + doll tax = subtotal * 0.07 total = subtotal + tax result = total return result
Alice has 12 blue marbles and 8 red marbles in a bag. She wants to divide them equally into 4 smaller bags. How many marbles of each color will be in each bag?
def solve() -> int: blue = 12 red = 8 bags = 4 blue_per_bag = blue / bags red_per_bag = red // bags result = (blue_per_bag, red_per_bag) return result
A company had 400 employees last year. If they hired 30 new employees and fired 20, how many employees do they have this year?
def solve() -> int: last_year_employees = 400 new_hires = 30 firings = 20 total_employees = last_year_employees + new_hires - firings result = total_employees return result
A company has a workforce of 120 employees. They pay $1000 per employee per month. They also have to pay a fixed overhead cost of $50000 per month. What is the total cost of the company every month?
def solve() -> int: num_employees = 120 cost_per_employee = 1000 fixed_cost = 50000 total_cost = (num_employees * cost_per_employee) + fixed_cost result = total_cost return result
A triangle has base 6 and height 8. What is the area of the triangle?
def solve() -> int: base = 6 height = 8 area = 0.5 * base * height result = area return result
A school has a total of 750 students. The ratio of boys to girls is 9:11. How many boys are in the school?
def solve() -> int: total_students = 750 ratio_boys_girls = 9/11 boys = total_students/(ratio_boys_girls+1)*9 result = boys return result
Max is planning to fence his chicken coop on three sides. The coop is a square with sides of 8 feet. His neighbor behind him has agreed to pay for half of their shared fence. His neighbor on the left side has agreed to pay for $36 worth of fencing for the 12 feet they share. The cost of fencing is $2.75 per foot. How m...
def solve() -> int: side_length = 8 shared_length = 12 shared_cost = 36 cost_per_foot = 2.75 remaining_length = side_length * 2 - shared_length total_cost = (remaining_length + shared_length) * cost_per_foot / 2 - shared_cost result = total_cost return result
Miranda won $750.00 at a slot machine. She decided to use half of her winnings to pay off credit card debt and used the rest to invest in a new stock. She made a 30% profit on her investment. If Miranda's stock investment earned her $225.00 in profits, how much credit card debt did she pay off?
def solve() -> int: winning_amount = 750.00 debt_payment = winning_amount / 2 investment_amount = winning_amount / 2 profit_percentage = 30 profit_amount = 225.00 total_earned = investment_amount + profit_amount original_investment = total_earned / (1 + profit_percentage / 100) ...
Max ate five more cookies today than yesterday. Yesterday, he ate eight cookies. How many cookies did Max eat in half a day?
def solve() -> int: today_cookies = 8 + 5 one_day_cookies = today_cookies + 8 half_day_cookies = one_day_cookies / 2 result = half_day_cookies return result
Jane goes to a grocery store and buys 3 packs of eggs. Each pack costs $2.75. How much did she pay in total?
def solve() -> int: price_of_one_pack = 2.75 number_of_packs = 3 total_cost = price_of_one_pack * number_of_packs result = total_cost return result
Kevin has 400 apples for his farm stand. He has already sold 75 Granny Smith and 100 Gala apples. Kevin wants to sell an even amount of Red Delicious and Honeycrisp apples for the rest. How many of each should he sell?
def solve() -> int: apples_total = 400 apples_sold_granny_smith = 75 apples_sold_gala = 100 apples_remaining = apples_total - apples_sold_granny_smith - apples_sold_gala red_delicious = apples_remaining // 2 honeycrisp = apples_remaining // 2 result = f'Red Delicious: {red_del...
A bakery sells cupcakes in packs of 6. Each cupcake requires 2 ounces of flour, 1 ounce of sugar, and 0.5 ounces of butter to make. If the baker uses 100 ounces of flour, 50 ounces of sugar, and 25 ounces of butter in one day, how many packs of cupcakes did the bakery sell?
def solve() -> int: flour_for_one_cupcake = 2 sugar_for_one_cupcake = 1 butter_for_one_cupcake = 0.5 total_flour_used = 100 total_sugar_used = 50 total_butter_used = 25 total_cupcakes = min(total_flour_used//flour_for_one_cupcake, total_sugar_used//sugar_for_one_cupcake, total_butter_used//b...
A hardware store sells 50 hammers and 35 saws per day. How many tools does it sell in 12 months if all the months have 31 days?
def solve() -> int: hammers_per_day = 50 saws_per_day = 35 tools_per_day = hammers_per_day + saws_per_day days_per_month = 31 months = 12 tools_per_month = tools_per_day * days_per_month tools_per_year = tools_per_month * months result = tools_per_year return...
Student: Ann is baking cookies for the school bake sale. She needs to bake 180 cookies and each batch yields 16 cookies. How many batches of cookies does Ann need to bake?
def solve() -> int: cookies_needed = 180 cookies_per_batch = 16 batches = cookies_needed / cookies_per_batch batches = int(batches) if batches.is_integer() else int(batches) + 1 result = batches return result
**** Tara had 40 cookies, half of them were chocolate chip and the other half were peanut butter, she gave away 1/5th of all her cookies, how many did she give away?
def solve() -> int: total_cookies = 40 chocolate_chip = total_cookies / 2 peanut_butter = total_cookies / 2 fraction_given_away = 1/5 cookies_given_away = fraction_given_away * total_cookies result = cookies_given_away return result
If a recipe calls for 2 cups of flour and makes 12 cookies, how many cookies can be made with 4 cups of flour?
def solve() -> int: flour_needed = 2 cookies_made = 12 flour_available = 4 cookies_possible = (cookies_made/flour_needed) * flour_available result = cookies_possible return result
Possible new questions and programs: Lisa has 5 bags of candies. Each bag contains 12 candies. She gives away 2 bags to her friends and eats 4 candies. How many candies does she have left?
def solve() -> int: candies_per_bag = 12 bags = 5 total_candies = candies_per_bag * bags candies_given = candies_per_bag * 2 candies_eaten = 4 candies_left = total_candies - candies_given - candies_eaten result = candies_left return result
A rectangular field has a perimeter of 120 meters and an area of 600 square meters. What are the length and width of the field?
def solve() -> int: perimeter = 120 area = 600 length = (perimeter + ((perimeter ** 2) - (16 * area)) ** 0.5) / 4 width = area / length result = (length, width) return result
Angela has a recipe to make chocolate chip cookies that calls for 2/3 cup of sugar. If she wants to make 3 times the recipe, how much sugar will she need?
def solve() -> int: sugar_per_recipe = 2/3 recipe_multiplier = 3 total_sugar = sugar_per_recipe * recipe_multiplier result = total_sugar return result
Rachel, Rose, and Rebecca went to the bookstore on Saturday. If Rose spent $80, Rebecca spent three times as much as Rose, and Rachel spent half as much as Rebecca, how much money did they spend in total?
def solve() -> int: rose_spent = 80 rebecca_spent = 3 * rose_spent rachel_spent = rebecca_spent / 2 total_spent = rose_spent + rebecca_spent + rachel_spent result = total_spent return result
Student: A shop owner bought 41 boxes of oranges, and 20 boxes of apples. If each box contains 12 pieces of fruit, how many pieces of fruit in total did the shop owner buy?
def solve() -> int: oranges_boxes = 41 apples_boxes = 20 fruit_per_box = 12 total_oranges = oranges_boxes * fruit_per_box total_apples = apples_boxes * fruit_per_box total_fruit = total_oranges + total_apples result = total_fruit return result
Julie has a collection of 600 stickers. 50% of them, Julie bought for $1 each. Of the rest, 30% were bought for $0.50. All others had a price of $0.25 each. How much did Julie spend on all the stickers in her collection?
def solve() -> int: a = 600 b = round(a * 0.5) c = round((a - b) * 0.3) d = a - b - c cost = (b * 1) + (c * 0.50) + (d * 0.25) result = cost return result
A car travels 250 miles in 5 hours. What is the speed of the car in miles per hour?
def solve() -> int: distance = 250 time = 5 speed = distance / time result = speed return result
- QuestionJason scored a 90 on his first quiz. If his average after the second quiz was an 86, what grade did he get on his second quiz?
def solve() -> int: first_quiz = 90 average = 86 second_quiz = (2 * average) - first_quiz result = second_quiz return result
Kenneth works for a pizzeria and needs to make 85 pizzas for the day. Each pizza he makes takes 15 minutes. If he has had 5 hours, how many pizzas can he make so far?
def solve() -> int: n = 85 time_per_pizza = 15 available_time = 5 * 60 max_pizzas = available_time / time_per_pizza result = max_pizzas return result
Carl is creating a garden in his backyard. The garden is composed of four animal-shaped flower beds. Each flowerbed has a length of 20 meters and a width of 12 meters. What is the total area of the garden?
def solve() -> int: num_beds = 4 length_bed = 20 width_bed = 12 area_bed = length_bed * width_bed area_garden = num_beds * area_bed result = area_garden return result
Student: A company sells a product at a 20% profit, if the cost price is 100 dollars, what is the selling price?
def solve() -> int: cost_price = 100 profit = cost_price * 0.2 selling_price = cost_price + profit result = selling_price return result
Student: Sarah has a 10% discount coupon for a $50 book, how much is the discount?
def solve() -> int: price = 50 discount = 0.1 discount_amount = price * discount final_price = price - discount_amount result = discount_amount return result
Josh has 4 quarters, 6 dimes, and 10 nickels. How much more money does he need to buy a game that costs $7.50?
def solve() -> int: quarters = 0.25 * 4 dimes = 0.1 * 6 nickels = 0.05 * 10 total_money = quarters + dimes + nickels money_needed = 7.5 - total_money result = money_needed return result
An amusement park charges $30 for admission, and $10 for parking. They sell an average of 500 admission tickets each day, and 300 parking tickets each day. How much money do they make each week?
def solve() -> int: admission_fee = 3000 parking_fee = 3000 num_admission_tickets_per_day = 500 num_parking_tickets_per_day = 300 days_per_week = 7 total_money_made_per_day = admission_fee + parking_fee total_money_made_per_day *= (num_admission_tickets_per_day + num_parking_tickets_per...
A car travels 80 miles in 2 hours. What is its speed in miles per hour?
def solve() -> int: distance = 80 time = 2 speed = distance / time result = speed return result
Question5: Sarah picked 5 buckets of oranges and each bucket had 10 oranges in it. How many oranges did she pick total?
def solve() -> int: number_oranges = 5 * 10 result = number_oranges return result
A week ago, the price of a video game was 1/2 of what it is now. If the price of the video game was $60 a week ago, how much is it now?
def solve() -> int: price_week_ago = 60 price_now = price_week_ago * 2 result = price_now return result
In nine years, Noah will be twice as old as Emily. If Noah is currently 18 years old, and Sofia, Emily's best friend, is 3/5 of Noah's current age, how old is Sofia now?
def solve() -> int: noah_current_age = 18 noah_future_age = noah_current_age + 9 emily_future_age = noah_future_age / 2 emily_current_age = emily_future_age - 9 sofia_current_age = (3/5) * noah_current_age result = sofia_current_age return result
Two boats operated in a lake. One boat maintains a speed of 20 mph and the other boat maintains a speed of 30 mph. If the boats sail for 4 hours on the lake, how far apart are they?
def solve() -> int: speed_boat1 = 20 speed_boat2 = 30 time = 4 distance_boat1 = speed_boat1 * time distance_boat2 = speed_boat2 * time distance_apart = abs(distance_boat1 - distance_boat2) result = distance_apart return result
Mia has a rectangular garden that is 6 m long and 4 m wide. She wants to plant flowers along the diagonal of the garden, leaving a 1 m gap on each side. How many flowers can she plant if each flower needs a 0.5 m space?
def solve() -> int: length = 6 width = 4 flower_space = 0.5 from math import sqrt diagonal = sqrt(length**2 + width**2) effective_diagonal = diagonal - 2 from math import floor flowers = floor(effective_diagonal / flower_space) result = flowers return result
There are 14 students in a class and the teacher wants to make 7 teams with equal members. How many students need to be in each team?
def solve() -> int: num_of_students = 14 num_of_teams = 7 students_in_each_team = num_of_students/num_of_teams result = students_in_each_team return result
A rectangular swimming pool measures 20 feet by 30 feet. Two swimmers start at opposite corners of the pool and swim directly across to the opposite corner. If they both stop when they reach the other side and immediately start walking back to where they started, what is the total distance they will cover, including bo...
def solve() -> int: d = 2*1316.2 walk_distance = (20+d/2)/4 + (30+d/2)/4 total_distance = d + 2*walk_distance result = total_distance return result
A librarian has 120 books. One-tenth of them are fiction, and one-fifth of the remaining are biographies. How many books are biographies?
def solve() -> int: books = 120 fiction = books * (1/10) remaining = books - fiction biographies = remaining * (1/5) result = biographies return result
Jaime ran a total of 40 miles for the month. If she ran 5 miles the first day, and 3 miles the second day, and then 2 miles every day after that. How many days did it take for her to reach the total miles?
def solve() -> int: total_miles = 40 first_day = 5 second_day = 3 remaining_miles = total_miles - first_day - second_day daily_miles = 2 days = remaining_miles / daily_miles + 2 result = days return result
A pizza parlor has 3 different sizes of pizzas: small, medium, and large. A small pizza costs $8, a medium pizza costs $12 and a large pizza costs $16. If a group of friends spent $56 on pizza, and they ordered two medium pizzas and one small pizza, how much did each person pay if there were 4 people in the group?
def solve() -> int: small_pizza_cost = 8 medium_pizza_cost = 12 large_pizza_cost = 16 num_people = 4 total_spent = 56 num_medium_pizzas = 2 num_small_pizzas = 1 total_cost = (small_pizza_cost * num_small_pizzas) + (medium_pizza_cost * num_medium_pizzas) cost_per_person = (total...
A teacher has 60 students and wants to divide them into groups of 5. How many groups will there be in total?
def solve() -> int: total_students = 60 students_per_group = 5 total_groups = total_students // students_per_group result = total_groups return result
Ryan and Emily are competing to see who can jump higher. They have already jumped 4 times and Ryan jumped 3 feet and 11 inches. Emily jumped 4 feet and 2 inches. If the final jump is worth the same as all the other jumps and Emily jumped the final jump and jumped 2 feet and 8 inches, what is the minimum height Ryan nee...
def solve() -> int: ryan_height = (3 * 12) + 11 emily_height = (4 * 12) + 2 total_emily_height = emily_height * 5 sum_first_4_jumps = total_emily_height - ((2 * 12) + 8) min_ryan_height = (sum_first_4_jumps / 4) + 1 result = min_ryan_height return result
The total cost of a shirt and a pair of pants is $70. If the shirt costs $35, what is the cost of the pants?
def solve() -> int: total_cost = 70 shirt_cost = 35 pants_cost = total_cost - shirt_cost result = pants_cost return result
In July 2021, Lily was born. Her older sister, Emily, is 8 years older than her. Emily's classmate, Jack, is 2/5 the age of Emily. How old is Jack?
def solve() -> int: lily_age = 0 emily_age = lily_age + 8 jack_age = (2/5) * emily_age result = jack_age return result
Possible new questions and python programs are: Alice has a rectangular garden that is 15 feet long and 10 feet wide. She wants to increase the area of her garden by adding 2 feet to each side. How much more fence does she need to buy to enclose the new garden?
def solve() -> int: new_length = 15 + 2 new_width = 10 + 2 new_area = new_length * new_width old_area = 15 * 10 area_difference = new_area - old_area new_perimeter = (new_length + new_width) * 2 old_perimeter = (15 + 10) * 2 perimeter_difference = new_perimeter - old_perimeter result...
One can of soup costs $2 and one jar of peanut butter costs $4. If Chloe buys two cans of soup and three jars of peanut butter, how much does she spend altogether?
def solve() -> int: soup_cost = 2 pb_cost = 4 num_soup = 2 num_pb = 3 total_soup_cost = num_soup*soup_cost total_pb_cost = num_pb*pb_cost total_spent = total_soup_cost + total_pb_cost result = total_spent return result
Marcy has twice as many candies as Robert. If Robert has 25 candies, how many candies does Marcy have?
def solve() -> int: candies_robert = 25 candies_marcy = candies_robert * 2 result = candies_marcy return result
For every sweater Caroline knits, she earns $9 more than she is paid for the knitting. If she earns $10 for knitting a sweater, how much money does she earn for knitting and selling 5 sweaters?
def solve() -> int: sweater_price = 10 extra_earnings = 9 number_of_sweaters = 5 total_earnings = (sweater_price + extra_earnings) * number_of_sweaters result = total_earnings return result
Mr. Chen has a rectangular garden that is 15 meters long and 10 meters wide. He wants to build a fence around the garden, leaving a gap of 1 meter on each side for a gate. He can buy fencing materials for $25 per meter. How much will he spend on the fencing materials?
def solve() -> int: perimeter = (15 - 2) + (10 - 2) + (15 - 2) + (10 - 2) cost = perimeter * 25 result = cost return result
A club has a total of 250 members. 30% of the members came to the meeting. Each member is given two accessories. How many accessories were left at the end of the meeting?
def solve() -> int: total_members = 250 accessories_per_member = 2 total_accessories = total_members * accessories_per_member came_to_meet = total_members * 0.3 accessories_given = came_to_meet * accessories_per_member accessories_left = total_accessories - accessories_given result = accesso...
A box contains 3 red balls and 5 blue balls. If two balls are drawn from the box at random without replacement, what is the probability that both balls will be red?
def solve() -> int: numerator = 3 * 2 denominator = 8 * 7 result = numerator / denominator return result
Student: A party planner must create 15 identical balloon bouquets, each with 5 balloons. If the balloons come in 3 colors (red, blue, green), and each bouquet must have 1 red, 2 blue, and 2 green balloons, how many of each color balloon is needed in total?
def solve() -> int: num_bouquets = 15 num_balloons = 5 num_red = 1 num_blue = 2 num_green = 2 total_red = num_bouquets * num_red total_blue = num_bouquets * num_blue total_green = num_bouquets * num_green result = total_red + total_blue + total_green return result
Alice and Bob are making bracelets with beads. Alice uses 3 blue beads and 2 red beads for each bracelet, while Bob uses 2 blue beads and 4 red beads for each bracelet. They have a total of 60 blue beads and 80 red beads. How many bracelets can they make in total?
def solve() -> int: alice_blue = 3 alice_red = 2 bob_blue = 2 bob_red = 4 alice_bracelets = min(60 / alice_blue, 80 / alice_red) bob_bracelets = min(60 / bob_blue, 80 / bob_red) alice_bracelets = int(alice_bracelets) bob_bracelets = int(bob_bracelets) total_bracelets = alice_...
Student: 3. If there are 28 students in a class and each student receives 5 apples, how many apples were distributed to the class in total?
def solve() -> int: num_students = 28 num_apples_per_student = 5 total_num_apples = num_students * num_apples_per_student result = total_num_apples return result
A rectangular swimming pool is 20 meters long and 12 meters wide. A tiled walkway of uniform width is built around the pool. The total area covered by the pool and walkway is 384 square meters. What is the width of the walkway?
def solve() -> int: length_of_pool = 20 width_of_pool = 12 total_area = 384 width_of_walkway = (total_area - length_of_pool*width_of_pool)/(2*(length_of_pool+width_of_pool)) result = width_of_walkway return result
Laura and Joseph went to the amusement park, and each spent 6 times as much money as Mike did. If Laura and Joseph spent a total of $198, how much money did Mike spend?
def solve() -> int: money_laura = 0 money_joseph = 0 total_money = 198 money_laura = total_money/2 money_joseph = money_laura money_mike = (money_laura+money_joseph)/6 result = money_mike return result
A store is having a 20% off sale. If an item costs $25 before the sale, what is the sale price?
def solve() -> int: discounted_price = 0.8*25 result = round(discounted_price, 2) return result
Lisa is a waitress who works 6 hours a day. During her shift, she serves 3 tables per hour, and each table leaves a tip of $10 on average. How much money does Lisa make in tips in one workday?
def solve() -> int: hours_per_day = 6 tables_per_hour = 3 tip_per_table = 10 total_tables = hours_per_day * tables_per_hour total_tips = total_tables * tip_per_table result = total_tips return result
Samantha and her friend decided to go on a weekend trip. They agreed to split the cost of the hotel room equally, but each would pay for their own meals. If the hotel room cost $200 per night and they stayed for two nights, but Samantha spent $50 on meals, how much did she spend in total?
def solve() -> int: hotel_cost_per_night = 200 number_of_nights = 2 meal_cost = 50 total_hotel_cost = hotel_cost_per_night * number_of_nights total_cost = total_hotel_cost + meal_cost result = total_cost return result
Student: What is the average of the numbers 3, 8, and 11?
def solve() -> int: num1 = 3 num2 = 8 num3 = 11 sum_of_nums = num1 + num2 + num3 average = sum_of_nums / 3 result = average return result
There are 12 white socks and six black socks in a drawer. If one-third of the white socks are lost, and half of the black socks are taken out, how many socks remain in the drawer?
def solve() -> int: white_socks = 12 black_socks = 6 lost_white_socks = white_socks / 3 remaining_white_socks = white_socks - lost_white_socks taken_out_black_socks = black_socks / 2 remaining_black_socks = black_socks - taken_out_black_socks total_socks_remaining = remaining_...
Student: Abe bought a laptop for $500. If he received a 15% discount, how much did he actually pay?
def solve() -> int: price = 500 discount = 0.15 discounted_price = price - (price * discount) result = discounted_price return result
Maria works at a coffee shop and earns $5 for every 3 cups of coffee she sells. If she sold twice as many cups of coffee this week than the previous week’s total, and she sold 6 cups of coffee the previous week, how much money did she earn this week?
def solve() -> int: previous_week_cups = 6 this_week_cups = previous_week_cups * 2 earnings_per_cup = 5 total_earnings = this_week_cups * earnings_per_cup result = total_earnings return result
A garden has a length that is 3 meters more than its width. Its area is 80 square meters. What is the length of the garden?
def solve() -> int: area = 80 length_difference = 3 width = ((4 * area) - length_difference**2)**0.5 / 2 length = width + length_difference result = length return result
A train travels at a speed of 60 km/h and another train from the opposite direction travels at a speed of 80 km/h. If they are 140 km apart, how long will it take for them to meet?
def solve() -> int: train1_speed = 60 train2_speed = 80 distance = 140 total_speed = train1_speed + train2_speed time = distance / total_speed result = time return result
Hanna needs to drive from her house to a friend's house, a distance of 125 miles. She drives for 90 minutes at an average speed of 50 mph. How many minutes per mile will Hanna's average speed be?
def solve() -> int: distance = 125 time = 90 speed = 50 speed_per_mile = time/distance result = speed_per_mile return result
10. If Ben can mow his lawn in 40 minutes and Sean can mow the same lawn in 30 minutes, how long will it take them to mow it together?
def solve() -> int: time_ben = 40 time_sean = 30 time_together = (time_ben * time_sean) / (time_ben + time_sean) result = time_together return result
A suitcase measuring 24 inches x 16 inches x 10 inches can hold up to 35 pounds of luggage. If each item of clothing weighs 3 pounds, how many items of clothing can be packed in the suitcase?
def solve() -> int: suitcase_volume = 24 * 16 * 10 item_weight = 3 max_items = 35 // item_weight items_packed = suitcase_volume // max_items result = items_packed return result
A TV costs $400. If the store offers 30% off for Black Friday, what is the new price?
def solve() -> int: price = 400 discount = price * 0.30 new_price = price - discount result = new_price return result
Summitville buries their treasure chest 50 meters underground. Canyontown buries their treasure chest 12 meters higher than double the depth of the Summitville treasure chest. How deep is Canyontown's treasure chest buried?
def solve() -> int: depth_summitville = 50 depth_canyontown = 2 * depth_summitville + 12 result = depth_canyontown return result
Olivia usually exercises on the treadmill for 5 kilometers, lifts 10 kilos, and does 20 squats regularly for a day. For today she was able to run and lift triple the distance and weight, and double the number of squats. How much more exercise did Olivia do today?
def solve() -> int: treadmill_distance = 5 lifting_weight = 10 squats = 20 new_treadmill_distance = treadmill_distance * 3 new_lifting_weight = lifting_weight * 3 new_squats = squats * 2 treadmill_difference = new_treadmill_distance - treadmill_distance lifting_difference = new...
If a wild rabbit runs at an average speed of 10 miles per hour and covers an area of 40 miles in 5 hours, how long would it take the rabbit to run 10 miles?
def solve() -> int: init_distance = 10 total_time = 5 init_speed = 10 total_distance = total_time * init_speed time_used = init_distance / init_speed new_total_time = total_time + time_used remain_distance = total_distance - init_distance time_running_remain_d...
A restaurant is adding extra fees and surcharges to the final bill without telling customers. If I went to a sushi restaurant and my total bill was $80, the tax rate is 8%, and I separately ordered Sushi rolls worth $40 and Sashimi worth $30, what will be the total amount of extra charges I will be paying?
def solve() -> int: total_bill = 80 tax_rate = 0.08 sushi_cost = 40 sashimi_cost = 30 subtotal = sushi_cost + sashimi_cost tax = subtotal * tax_rate extra_charges = total_bill - subtotal - tax result = extra_charges return result
A cylinder has radius 4 cm and height 10 cm. What is its volume?
def solve() -> int: radius = 4 height = 10 pi = 3.14 volume = pi * radius**2 * height result = volume return result
A clothing store owner buys 50 new shirts every week. After 2 months, the owner had sold 800 shirts but still had 1500 shirts in stock. How many shirts did the owner have originally?
def solve() -> int: weeks_in_2_months = 2 * 4 shirts_bought_per_week = 50 shirts_sold_in_2_months = 800 shirts_in_stock_after_2_months = 1500 total_shirts_bought = weeks_in_2_months * shirts_bought_per_week original_shirts = total_shirts_bought + shirts_in_stock_after_2_months - shirts_sold...
Student: Dennis scored 80 points in his first quiz. He scored 15% more in his second quiz and 10% less in his third quiz. What was his average score?
def solve() -> int: first_quiz = 80 second_quiz = first_quiz * 1.15 third_quiz = second_quiz * 0.9 average = (first_quiz + second_quiz + third_quiz) / 3 result = average return result
Mel’s furniture store sold 35 chairs at a 5% discount. If each chair was sold for $95, how much money did Mel make from the sale?
def solve() -> int: chairs = 35 price_chair = 95 discount_percentage = 0.05 discount = chairs*price_chair*discount_percentage final_price = chairs*price_chair - discount result = final_price return result
Student: If Sara had $200 and she spent $50 each week, how much money will she have left after 5 weeks?
def solve() -> int: initial_amount = 200 weekly_spending = 50 amount_left = initial_amount - (weekly_spending * 5) result = amount_left return result
In a race, seven runners cross the finish line in 206 seconds. How many seconds did the slowest runner take to complete the race?
def solve() -> int: total_sec = 206 num_runners = 7 speed_slowest = total_sec // num_runners result = speed_slowest return result
Alex and Ben are sharing a pizza. The pizza has 12 slices and each slice has 3 pepperoni pieces on it. Alex eats 1/3 of the pizza and Ben eats 2/5 of the pizza. How many pepperoni pieces are left on the pizza?
def solve() -> int: slices = 12 pepperoni = 3 alex_slices = slices * (1/3) ben_slices = slices * (2/5) alex_pepperoni = alex_slices * pepperoni ben_pepperoni = ben_slices * pepperoni left_slices = slices - alex_slices - ben_slices left_pepperoni = left_slices * pepperoni resu...
Student: Sean creates a frame for pictures. In the first three hours he collects 8 pieces each hour. In the fourth hour he collects 10 pieces. In the fifth hour he discovers 5 pieces won't fit so he takes them out. How many pieces are left after the fifth hour?
def solve() -> int: pieces_collected = 0 pieces_removed = 0 pieces_collected += 8 * 3 pieces_collected += 10 pieces_removed += 5 pieces_left = pieces_collected - pieces_removed result = pieces_left return result
A bar of soap can last for 30 showers. If a bottle of body wash can last twice as long as a bar of soap, then how many showers can be taken by using half of a bar of soap and half of the body wash?
def solve() -> int: soap_last = 30 bodywash_last = soap_last * 2 half_soap = soap_last / 2 half_bodywash = bodywash_last / 2 total_showers = half_soap + half_bodywash result = total_showers return result
Tom has 40 nickels. He spends 15 nickels on a soda and then earns 5 nickels for each math problem he solves correctly. He solves 6 math problems. How many nickels does Tom have now?
def solve() -> int: toms_nickels = 40 toms_nickels = toms_nickels - 15 toms_nickels = toms_nickels + (5 * 6) result = toms_nickels return result
A basketball team scored 75 points in a match. The team scored 25 field goals and the rest were free throws. If a free throws gives 1 point and a field goal gives 2 points, how many free throws did the team score?
def solve() -> int: total_field_goals = 25 points_scored = 75 total_field_goal_points = total_field_goals*2 free_throw_points = points_scored - total_field_goal_points result = f'<<<{free_throw_points}>>>' result = free_throw_points return result
John puts two books in each backpack. If he has 12 books, how many more books does he need to fill 10 backpacks?
def solve() -> int: books_per_backpack = 2 total_books = 12 backpacks = 10 books_needed = (backpacks * books_per_backpack) - total_books result = books_needed return result
Four friends, Anne, Belle, Chloe, and Daisy, decided to split the cost of a flower bouquet for their friend. The total cost was £60. Anne paid £10, Belle paid twice as much as Anne, Chloe paid three times as much as Anne, and Daisy paid four times as much as Anne. How much did Belle pay?
def solve() -> int: total_cost = 60 anne_payment = 10 belle_payment = 2*anne_payment chloe_payment = 3*anne_payment daisy_payment = 4*anne_payment total_payment = anne_payment + belle_payment + chloe_payment + daisy_payment belle_share = belle_payment / total_payment * total_cost result...
Carlos received a present he had been waiting for many months. He opened the box and found 3 identical dresses. He gave one of the dresses to his sister, and another one to his sister-in-law. What fraction of the dresses does he have now?
def solve() -> int: total_dresses_received = 3 dresses_given_away = 2 dresses_remaining = total_dresses_received - dresses_given_away fraction_of_dresses_remaining = dresses_remaining / total_dresses_received result = fraction_of_dresses_remaining return result
Student: The Candy Store sells candy in two sizes: Large (16 oz) and Small (8 oz). How many ounces of candy will John have if he buys 8 large and 12 small candies?
def solve() -> int: large_candy = 8 small_candy = 12 total_ounces = large_candy * 16 + small_candy * 8 result = total_ounces return result
If 8 years ago Ethan was half the age of his sister, and his sister is now 30 years old, how old is Ethan now?
def solve() -> int: sister_age = 30 ethan_age_8_years_ago = (sister_age - 8) / 2 ethan_age = ethan_age_8_years_ago + 8 result = ethan_age return result
Tom is employed in a bookstore. He works 6 hours every weekday and 2 hours every Saturday and Sunday. If he earns $8 per hour and earns 75% extra on weekends, how much does he earn every week?
def solve() -> int: weekday_hours = 6 weekend_hours = 2 hourly_rate = 8 weekday_earnings = weekday_hours * hourly_rate weekend_earnings = weekend_hours * hourly_rate * 1.75 total_earnings = weekday_earnings * 5 + weekend_earnings * 2 result = total_earnings return result
**** The price of 4 hamburgers is $19.95, what is the price of 8 hamburgers?
def solve() -> int: price = 19.95 n = 4 cost = price * n total_cost = cost * 2 result = total_cost return result