question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: Julia recently went on a trip and wanted to keep a record of her expenses. She spent $50 on her flight, $20 on her hotel room, and $30 on food. If she brought $150 with her, how much money does she have left?
def solve() -> int: flight_cost = 50 hotel_cost = 20 food_cost = 30 total_cost = flight_cost + hotel_cost + food_cost money_brought = 150 money_left = money_brought - total_cost result = money_left return result
In a class of 25 students, the ratio of boys to girls is 3:2. How many girls are in the class?
def solve() -> int: total_students = 25 boys_ratio = 3 girls_ratio = 2 girls_count = (girls_ratio/5)*total_students result = girls_count return result
Ethan is a painter and has agreed to paint the walls of his sister's living room. The only paint he has limited stock of is green, so he counts how many gallons he needs. Each gallon of green paint will cover 40 sq ft. Ethan decides to bring 5 gallons of green paint, each of which holds 3 gallons of green paint, and th...
def solve() -> int: gallons_of_paint = 5 gallons_per_can = 3 total_gallons = gallons_of_paint * gallons_per_can sq_ft_per_gallon = 40 total_sq_ft = total_gallons * sq_ft_per_gallon result = total_sq_ft return result
Abdullah bought 5 books. Two of them cost $10 each and the other three cost $12 each. How much did Abdullah spend in total?
def solve() -> int: num_of_books_10_dollars = 2 cost_of_books_10_dollars = 10 num_of_books_12_dollars = 3 cost_of_books_12_dollars = 12 total_cost_of_books_10_dollars = num_of_books_10_dollars * cost_of_books_10_dollars total_cost_of_books_12_dollars = num_of_books_12_dollars * cost_of_...
Find the average of the following numbers: 6, 8, 10, 12, 14.
def solve() -> int: numbers = [6, 8, 10, 12, 14] average = sum(numbers)/len(numbers) result = average return result
A pizza shop has 12 slices of pizza and 10 hungry customers. How many slices of pizza will be left?
def solve() -> int: num_pizzas = 2 num_slices_per_pizza = 6 num_customers = 10 total_slices = num_pizzas*num_slices_per_pizza slices_per_customer = total_slices // num_customers slices_left = total_slices - slices_per_customer*num_customers result = slices_left return result
Leo started a new game with 500 points. He gained 20% of his points in the first level. He lost 15% of his points in the second level. He gained 10% of his points in the third level. He decided to quit the game and exchange his points for cash. He got 1 dollar for every 50 points. How much cash did he get?
def solve() -> int: points = 500 points = points + points * 0.2 points = points - points * 0.15 points = points + points * 0.1 cash = points / 50 result = cash return result
ophia had a bakery where she sold 5 cakes at a price of $5 each and 4 cupcakes for $3 each. How much money did she get in total?
def solve() -> int: cake_sold = 5 cake_price = 5 cupcake_sold = 4 cupcake_price = 3 result = cake_sold * cake_price + cupcake_sold * cupcake_price return result
The ratio of the number of children to the number of adults on a tour bus is 2:5. If there are 40 adults on the bus, how many children are there?
def solve() -> int: adults_num = 40 children_ratio = 2/5 children_num = children_ratio * adults_num result = children_num return result
A rectangular frame has a length of 40 cm and a width of 30 cm. It has a uniform border of 5 cm width around it. What is the area of the border?
def solve() -> int: l_frame = 40 w_frame = 30 b_width = 5 a_frame = l_frame * w_frame a_border = (l_frame + 2 * b_width) * (w_frame + 2 * b_width) a_diff = a_border - a_frame result = f'The area of the border is {a_diff} square cm.' return result
Sam bought 6 cupcakes for $2 each and 4 cookies for $1 each. He also bought a carton of milk for $3. He had a $5 off coupon that he could use on any purchase over $15. He paid with a $20 bill. How much change did he receive?
def solve() -> int: cupcake_cost = 6 * 2 cookie_cost = 4 * 1 milk_cost = 3 subtotal = cupcake_cost + cookie_cost + milk_cost if subtotal > 15: total_cost = subtotal - 5 else: total_cost = subtotal change = 20 - total_cost result = change return result
Lily loves shopping for clothes. She buys five items of clothing every month at a local store. One item of clothing costs her $30. In a different store, there is a long-term promotion, during which each item of clothing costs only $20. How much would Lily save in three months if she bought her items of clothing in this...
def solve() -> int: local_store_price = 30 num_items_per_month = 5 num_months = 3 local_store_cost = local_store_price * num_items_per_month * num_months promo_store_price = 20 promo_store_cost = promo_store_price * num_items_per_month * num_months savings = local_store_c...
Ben has 7 yards of fabric to make some masks. He can make one mask with 0.5 yards of fabric. He decides to donate half of the masks he makes to a local hospital. How many yards of fabric will he use for the donation?
def solve() -> int: fabric = 7 fabric_per_mask = 0.5 donation_fraction = 0.5 masks = fabric / fabric_per_mask masks_donated = masks * donation_fraction fabric_donated = masks_donated * fabric_per_mask result = fabric_donated return result
A group of friends went to the restaurant, and the total bill was $325. They decided to split the bill equally, but two friends had to leave early and didn't want to contribute. How much do the remaining friends pay if there are 7 of them left?
def solve() -> int: total_bill = 325 number_of_payers = 7 contributing_payers = number_of_payers - 2 amount_per_payer = total_bill / contributing_payers result = amount_per_payer return result
A car can travel 80 miles per hour. If the distance is increased by 50%, how many miles can the car travel at the same speed?
def solve() -> int: speed = 80 distance = 100 new_distance = distance + (distance * 0.5) new_speed = speed new_distance = new_distance * (new_speed / speed) result = new_distance return result
If there are 60 balloons which need to be shared equally among ten people, how many balloons will each person have?
def solve() -> int: balloons = 60 people = 10 balloons_per_person = balloons / people result = balloons_per_person return result
During a city-wide event 1/4 of attendees bought food, 1/3 of attendees bought drinks, and 1/6 of attendees bought both food and drinks, if there were 1200 attendees in total, how many attendees bought nothing?
def solve() -> int: food_attendees = 1200 / 4 drink_attendees = 1200 / 3 both_attendees = 1200 / 6 buy_nothing_attendees = 1200 - (food_attendees + drink_attendees - both_attendees) result = buy_nothing_attendees return result
Student: A museum has 500 visitors per day. On Mondays, the attendance is down by 60%. How many visitors come to the museum on Mondays?
def solve() -> int: monday_visitors = 500 * 0.6 result = monday_visitors return result
Jane had 100 pens. She gave 30 pens to her sister and 20 pens to her friend. She then bought 50 more pens. If she gave away half of her pens again, how many pens did she have left?
def solve() -> int: pens = 100 pens = pens - 30 pens = pens - 20 pens = pens + 50 pens = pens // 2 result = pens return result
Lily needs to fill a pool with water. The pool has a volume of 1500 liters and the hose she is using has a flow rate of 10 liters per minute. How long, in minutes, does it take for Lily to fill the pool completely?
def solve() -> int: pool_volume = 1500 flow_rate = 10 total_time = pool_volume / flow_rate result = total_time return result
Four friends, Rachel, Olivia, Ethan, and David, went to buy a new gamingJordan caught four times as many fish as Nathan who caught five. How many fish did Jordan catch?
def solve() -> int: n = 5 jordan = 4 * n result = jordan return result
Possible questions and programs are: Kim sells candles that she makes herself. She spends $3 on materials for each candle and sells them for $5. She also pays a $10 fee for renting a stall at a farmers' market. How many candles does she need to sell to break even?
def solve() -> int: cost = 3 revenue = 5 fee = 10 x = fee / (revenue - cost) candles = round(x) result = candles return result
Jake is a basketball player. He threw the ball and it traveled 30 feet straight toward the basket. On his second turn, he threw the ball again straight toward the basketball and it traveled three-quarters of the distance of his first turn, but the ball missed the basket and fell on the ground. On his third turn, he suc...
def solve() -> int: distance_first_turn = 30 distance_second_turn = distance_first_turn * 3/4 distance_third_turn = distance_second_turn result = distance_first_turn + distance_second_turn + distance_third_turn return result
Javier is ordering pizza for his office. There are 15 people and he wants to order enough pizza for 80% of them. Each pizza costs $12. If he has $150, what percentage of his money will he spend on pizza?
def solve() -> int: num_people = 15 percent_order = 0.8 num_pizzas = num_people * percent_order cost_per_pizza = 12 total_cost = num_pizzas * cost_per_pizza percent_spent = (total_cost / 150) * 100 result = percent_spent return result
Sophia wants to increase the number of yoga poses she practices every day. On Monday she did 3 poses. On Tuesday she did 5 poses. On Wednesday she skipped a day. On Thursday, she did 4 poses. On Friday she did 6 poses. If she did a total of 20 poses last week, how many does she need to do on Saturday to exceed last wee...
def solve() -> int: monday_poses = 3 tuesday_poses = 5 wednesday_poses = 0 thursday_poses = 4 friday_poses = 6 total_poses_last_week = monday_poses + tuesday_poses + wednesday_poses + thursday_poses + friday_poses poses_needed_on_saturday = total_poses_last_week + 1 - 20 r...
In a class, there are 24 students and the teacher wants to divide the class into groups of 3 students each. How many groups will there be?
def solve() -> int: students = 24 group_size = 3 num_groups = students // group_size result = num_groups return result
Emily needs 8 eggs to make one cake, and she wants to make 5 cakes. If one carton of eggs contains 10 eggs, how many cartons of eggs will Emily need?
def solve() -> int: eggs_needed = 8 * 5 cartons_needed = eggs_needed // 10 + int(eggs_needed % 10 > 0) result = cartons_needed return result
Student: A group of 4 students shared 9 apples equally. How many apples did each student get?
def solve() -> int: num_students = 4 num_apples = 9 num_apples_per_student = num_apples // num_students remainder = num_apples % num_students result = num_apples_per_student return result
A recipe calls for 2 cups of flour for every 1 cup of sugar. If you use 3 cups of sugar, how much flour do you need?
def solve() -> int: flour_needed = 2 * 3 result = flour_needed return result
Student: Joy drives a cab and makes 8 trips a week. She earns $9 for each trip and puts 1/4 of his bi-weekly earning on his retirement fund. How much does she put in her retirement fund?
def solve() -> int: trips = 8 earnings = 9 fraction = 1/4 bi_weekly_earnings = trips * earnings * 2 retirement_fund = bi_weekly_earnings * fraction result = retirement_fund return result
Elaine is baking cupcakes. She is using 120 ml of butter. If she puts 60 ml in each cupcake, how many cupcakes can she make?
def solve() -> int: butter_each_cupcake = 60 total_butter = 120 no_of_cupcakes = total_butter / butter_each_cupcake result = no_of_cupcakes return result
If it takes 9 gardeners 6 days to mow a large lawn, how long will it take 18 gardeners to mow the same size lawn at the same rate?
def solve() -> int: gardeners_1 = 9 gardeners_2 = 18 days_1 = 6 rate_1 = 1/days_1 time_1 = 1/(gardeners_1 * rate_1) time_2 = time_1 / (gardeners_2 / gardeners_1) result = round(time_2, 2) return result
A basketball player scores an average of 15 points per game. In the last 5 games, the player scored 17, 13, 20, 19, and 16 points. What is the player's new average after these games?
def solve() -> int: total_points = 17 + 13 + 20 + 19 + 16 new_average = (total_points + (5 * 15)) / 10 result = new_average return result
Emma and Sophia just finished baking cookies. Emma has three times as many cookies as Sophia. The total weight of their cookies is 2.5 kilograms. If Emma has 60 cookies, how many cookies does Sophia have and what is their weight in grams?
def solve() -> int: emma_cookies = 60 emma_weight = 2.5 * 1000 sophia_cookies = emma_cookies / 3 sophia_weight = (emma_weight - emma_cookies * 10) / 2 result = f"Sophia has {sophia_cookies} cookies and their weight is {sophia_weight} grams." return result
Student: A company has 100 employees. If 2/5 of the employees are male and the remaining are female, how many employees are female?
def solve() -> int: total_employees = 100 male_employees = total_employees * 2/5 female_employees = total_employees - male_employees result = female_employees return result
A store is selling shirts for $15 each. If I want to buy 5 shirts, how much will it cost me?
def solve() -> int: num_shirts = 5 cost_per_shirt = 15 total_cost = num_shirts * cost_per_shirt result = total_cost return result
John has 20 marbles, and he gives away 25% of his marbles to his friend Sara. How many marbles does John have left?
def solve() -> int: marbles = 20 percentage_given_away = 0.25 marbles_given_away = marbles * percentage_given_away remaining_marbles = marbles - marbles_given_away result = remaining_marbles return result
If the price of an apple is 50 cents and the price of a pear is 80 cents, how much money do you need to buy 3 apples and 5 pears?
def solve() -> int: apple_price = 0.5 pear_price = 0.8 apples = 3 pears = 5 total_cost = (apple_price * apples) + (pear_price * pears) result = total_cost return result
A company spends $80000 on manufacturing a product. If they want to make a 35% profit, what should be the selling price of the product?
def solve() -> int: cost = 80000 profit = 0.35 total_price = cost / (1 - profit) result = total_price return result
A student has 50 marbles in a jar. They buy 30% more marbles and after that give away 15% of all the marbles to their friends. How many marbles are left with them now?
def solve() -> int: marbles_in_jar = 50 extra_marbles = marbles_in_jar * 0.3 total_marbles = marbles_in_jar + extra_marbles marbles_given_away = total_marbles * 0.15 marbles_left = total_marbles - marbles_given_away result = marbles_left return result
A car travels at a speed of 60 miles per hour. How far does it travel in 2 and a half hours?
def solve() -> int: speed = 60 time = 2.5 distance = speed * time result = distance return result
A car travels at a speed of 120 km/hr. If the journey is 360 km, how long will it take to complete the journey?
def solve() -> int: speed = 120 distance = 360 time = distance/speed result = time return result
Mary has 3 times as many stickers as Peter. Peter has 15 stickers. How many stickers do they have altogether?
def solve() -> int: peter = 15 mary = peter * 3 total = peter + mary result = total return result
Q10: It takes 11 bricks to make a wall that is 1 foot tall. How many bricks does it take to make a wall that is 4 feet tall?
def solve() -> int: num_bricks_per_foot = 11 num_feet = 4 total_bricks = num_bricks_per_foot * num_feet result = total_bricks return result
Harper has 3 less books than Ingrid does, and Ingrid has 5 times as many books as Jamal. If Jamal has 15 books, how many does Harper have?
def solve() -> int: ingrid = 15 * 5 harper = ingrid - 3 result = harper return result
Sam is painting a fence. The fence has 20 sections and each section is 6 feet long and 4 feet high. He can paint 24 square feet of fence per hour. How long will it take him to paint the entire fence?
def solve() -> int: area = 20 * 6 * 4 time = area / 24 result = time return result
When Kevin is studying, he likes to have snacks to help him focus. Each snack he eats improves his concentration by 5%. One day, he decides to have half of the 16 snacks he has as he has a particularly difficult exam to study for. By how much has he increased his concentration levels?
def solve() -> int: snacks = 16 concentration_increase = 0.05 snacks_to_have = snacks / 2 concentration_increase_amount = snacks_to_have * concentration_increase result = concentration_increase_amount return result
On his trip to the grocery store, Alex bought 3 apples and four times as many bananas as apples. Additionally, he bought twice the number of oranges as apples and 1 more than thrice as many grapes as apples. How many fruits did Alex buy?
def solve() -> int: apples = 3 bananas = 4 * apples oranges = 2 * apples grapes = 3 * apples + 1 total_fruits = apples + bananas + oranges + grapes result = total_fruits return result
Possible additional questions and programs are: - Mia and Noah wanted to buy a $36.00 backpack for their friend's birthday. Mia had $12.00 and Noah had $8.00. Mia sold 6 of her old books for $1.00 each, while Noah washed 3 cars for his neighbors, charging $4.00 per car. How much more money will Mia and Noah need to mak...
def solve() -> int: cost = 36 mia = 12 noah = 8 mia_books = 6 mia_book_price = 1 noah_cars = 3 noah_car_price = 4 mia_earned = mia_books * mia_book_price noah_earned = noah_cars * noah_car_price total_earned = mia + noah + mia_earned + noah_earned need = c...
The total surface area of a cuboid is 210cm^2 and one of its sides measure 6 cm. What is the length of the other two sides?
def solve() -> int: surface_area = 210 side_1 = 6 side_2 = (surface_area / side_1) / 2 result = side_2 return result
John wanted to purchase an ice-cream that cost $12. He gave a $100 bill to the cashier and asked for change. Calculate how much change John received.
def solve() -> int: cost_of_item = 12 cash_provided = 100 change = cash_provided - cost_of_item result = 88 return result
A train travels 250 km in 4 hours. What is the average speed of the train in kilometers per hour?
def solve() -> int: distance = 250 time = 4 speed = distance/time result = speed return result
If a recipe requires 1/3 cup of butter and you want to make 3 cups of the recipe, how many cups of butter do you need?
def solve() -> int: recipe_quantity = 3 butter_ratio = 1/3 butter = butter_ratio * recipe_quantity result = butter return result
Amy and Bob collect stamps. Amy has 5 more stamps than Bob, and together they have 125 stamps. If 40% of Amy's stamps are from Europe, and 30% of Bob's stamps are from Asia, how many stamps from Asia does Bob have?
def solve() -> int: x = (125 - 5) / 2 result = x * 0.3 return result
The ratio of apples to oranges in a grocery store is 1:3. If there are 30 apples, how many oranges are there?
def solve() -> int: ratio_apples = 1 ratio_oranges = 3 num_apples = 30 result = num_apples * ratio_oranges result = 90 return result
Student: A store is having a buy one, get one half off sale. If a shirt costs $20 and the customer buys 2 shirts, how much will they pay?
def solve() -> int: shirt_price = 20 discount = 0.5 quantity = 2 first_shirt = shirt_price second_shirt = shirt_price * discount total_price = first_shirt + second_shirt result = total_price return result
Luna's ice cream parlor has 120 flavors. She gives away 20% of them as free samples, but then has to throw away 4 because they melted. How many flavors does she have left?
def solve() -> int: flavors = 120 free_samples = flavors * 0.2 melted_flavors = 4 remaining_flavors = flavors - free_samples - melted_flavors result = remaining_flavors return result
Student: A family goes out for dinner. The total bill is $80. If they want to leave a 15% tip, how much will they pay in total?
def solve() -> int: bill = 80 tip_percentage = 0.15 tip = bill * tip_percentage total_amount = bill + tip result = total_amount return result
A rectangular garden has a length of 40 feet and a width of 30 feet. A gardener wants to plant flowers around the border of the garden, leaving a width of 5 feet between the flowers and the edge of the garden. How many square feet of the garden will be covered by flowers?
def solve() -> int: garden_area = 40 * 30 inner_length = 40 - 2 * 5 inner_width = 30 - 2 * 5 inner_area = inner_length * inner_width flower_area = garden_area - inner_area result = flower_area return result
Eric buys a laptop that has a 15% discount. He then pays a 10% sales tax on the discounted price. If the original price of the laptop was $800, what is the final price that he pays?
def solve() -> int: original_price = 800 discounted_price = original_price * 0.85 tax = discounted_price * 0.1 final_price = discounted_price + tax result = final_price return result
Leo is a baker. He buys 12 bags of flour for $8 each. He uses 3 bags of flour to make 24 loaves of bread and sells them for $3 each. He uses another 4 bags of flour to make 48 muffins and sells them for $1.5 each. How much profit does he make from his baking?
def solve() -> int: cost_of_flour = 12 * 8 revenue_from_bread = 24 * 3 revenue_from_muffins = 48 * 1.5 total_revenue = revenue_from_bread + revenue_from_muffins profit = total_revenue - cost_of_flour result = profit return result
Marco has a collection of stamps from different countries. He has 20 stamps from Canada, 15 stamps from France, 12 stamps from Italy, and 18 stamps from Japan. He wants to arrange his stamps in a rectangular grid, so that each row has the same number of stamps and each column has stamps from the same country. What is t...
def solve() -> int: total_stamps = 20 + 15 + 12 + 18 factors = [i for i in range(1, total_stamps + 1) if total_stamps % i == 0] smallest_row = min(factors) result = smallest_row return result
A restaurant has 30 tables. Each table can cater to 4 customers. If the restaurant is fully occupied, how many customers will be in the restaurant?
def solve() -> int: num_tables = 30 customers_per_table = 4 total_customers = num_tables * customers_per_table result = total_customers return result
Lily is going shopping. She needs to buy 4 shirts, 3 pants, and 2 pairs of shoes. If shirts cost $15 each, pants cost $25 each, and shoes cost $30 each, how much money will she spend?
def solve() -> int: num_shirts = 4 num_pants = 3 num_shoes = 2 cost_shirt = 15 cost_pant = 25 cost_shoe = 30 total_cost = (num_shirts * cost_shirt) + (num_pants * cost_pant) + (num_shoes * cost_shoe) result = total_cost return result
Student: Q4: Jack bought eight shirts at $4 each and two pairs of sandalsat $3 each. How much change did he get back if he gave a fifty dollar bill?
def solve() -> int: shirts = 8 price_shirts = 4 sandals = 2 price_sandals = 3 bill = 50 total_cost = shirts * price_shirts + sandals * price_sandals change = bill - total_cost result = change return result
-Write each question on a new line. Possible new questions and programs: Amy can run 5 miles in 40 minutes at 14. When she is 16, she can run 25% faster and 20% longer. How many minutes does it take her to run 8 miles when she is 16?
def solve() -> int: speed_14 = 5 / 40 time_14 = 40 speed_16 = speed_14 * 1.25 time_16 = time_14 * 1.2 time_8 = 8 / speed_16 time_8 = round(time_8, 2) result = time_8 return result
Mary has a baking recipe that uses 2 cups of flour, 1 cup of sugar, and 1/2 cup of butter. If Mary wants to make a larger batch of her recipe that is twice the volume of the original, how much flour, sugar, and butter would she need altogether?
def solve() -> int: flour = 2 sugar = 1 butter = 0.5 original_volume = flour + sugar + butter larger_volume = original_volume * 2 result = larger_volume return result
A train travels 600 kilometers in 8 hours. What is its speed in kilometers per hour?
def solve() -> int: distance = 600 time = 8 speed = distance/time result = speed return result
Student: Ben rented a car for 5 days and paid $40 per day. He also had to pay a $50 deposit, which he will get back if he returns the car with a full tank of gas. He drove 300 miles and the car has a fuel efficiency of 20 miles per gallon. Gas costs $2.5 per gallon. How much will Ben pay for the car rental in total?
def solve() -> int: days = 5 rate = 40 deposit = 50 miles = 300 efficiency = 20 gas_price = 2.5 rental_fee = days * rate gas_used = miles / efficiency gas_cost = gas_used * gas_price total_cost = rental_fee + gas_cost total_cost = total_cost - deposit result = ...
Last week, Mrs. Williams bought 30 books. This week, she bought 18 more books than last week. Two weeks ago, she bought half the number of books she bought this week. How many books did Mrs. Williams buy?
def solve() -> int: last_week_books = 30 this_week_books = last_week_books + 18 two_weeks_ago_books = this_week_books / 2 total_books = last_week_books + this_week_books + two_weeks_ago_books result = total_books return result
Ben works as a painter and he charges $25 per hour. He also spends 15% of his earnings on materials and tools. He works 6 hours a day, 5 days a week. How much does he earn in a month (assume 4 weeks)?
def solve() -> int: rate = 25 materials = 0.15 hours = 6 days = 5 weeks = 4 daily_earnings = rate * hours weekly_earnings = daily_earnings * days monthly_earnings = weekly_earnings * weeks monthly_cost = materials * monthly_earnings net_earnings ...
Mia has 5 times as many pennies as she does nickels, and accidentally loses half of her pennies and all of her nickels. How much money will she have in dollars if she originally had 40 nickels?
def solve() -> int: nickels = 40 pennies = 5 * nickels lost_pennies = pennies / 2 lost_nickels = nickels remaining_pennies = pennies - lost_pennies remaining_nickels = nickels - lost_nickels total_cents = (remaining_pennies * 1) + (remaining_nickels * 5) total_dollars = to...
Student: Mike is building a fence that is 40ft long and 7ft high. How many square feet of material does Mike need?
def solve() -> int: length = 40 height = 7 area = length * height result = area * 2 return result
Student: Sarah goes shopping for groceries every week, and she usually buys 4 bags of groceries each time she goes. If Sarah has shopped 4 times in 2 weeks, how many bags of groceries has she bought?
def solve() -> int: bags_per_trip = 4 trips_in_two_weeks = 4 total_bags = bags_per_trip * trips_in_two_weeks result = total_bags return result
David, Kate, and Peter bought 18 brownies together. Each brownie cost $1.20. If they split the costs evenly, how much did each person pay?
def solve() -> int: cost = 18 * 1.20 split_cost = cost / 3 result = split_cost return result
Jack is calculating the area of a square and he knows that the perimeter of the square is 44 cm. What is the area of the square?
def solve() -> int: perimeter = 44 side_length = perimeter / 4 area = side_length ** 2 result = area return result
Andrew bought a shirt for $35. He received a discount of 20% on the shirt. How much did he have to pay for the shirt after the discount?
def solve() -> int: original_price = 35 discount_percent = 20 discount_amount = original_price * discount_percent/100 final_price = original_price - discount_amount result = final_price return result
Laura bought a handbag that cost $250 at full price. The handbag was on sale for 40% off. She then applied a coupon that took off $20. She paid with a store credit card that gave her another 10% off the remaining amount. How many dollars did she save on the original price of the handbag?
def solve() -> int: full_price = 250 sale_percentage = 40 coupon_discount = 20 credit_card_discount = 10 sale_price = full_price - (full_price * sale_percentage / 100) final_price = sale_price - coupon_discount amount_saved = full_price - final_price result = amount_s...
A basketball player scores an average of 28 points per game. If he played 82 games in the season, how many points did he score in total?
def solve() -> int: average_points = 28 num_games = 82 total_points = average_points * num_games result = total_points return result
A company sells widgets for $10 each and gadgets for $15 each. Yesterday, the company sold 50 widgets and 25 gadgets. What was the total revenue of the company yesterday?
def solve() -> int: widget_price = 10 gadget_price = 15 num_widgets_sold = 50 num_gadgets_sold = 25 widget_revenue = widget_price * num_widgets_sold gadget_revenue = gadget_price * num_gadgets_sold total_revenue = widget_revenue + gadget_revenue result = total_revenue retu...
Cali’s family is travelling 368 miles for a vacation and they are traveling at an average speed of 72 miles per hour. How long will it take them to get to their destination?
def solve() -> int: total_distance_travelled = 368 average_speed = 72 duration = total_distance_travelled/average_speed result = duration return result
There are 600 employees of a company. Among them, 40% have chosen to work from home. The remaining employees are divided into two equal parts, with only one group physically present in the office on each day. What fraction of employees come to the office daily?
def solve() -> int: total_employees = 600 work_from_home = total_employees * 0.4 office_employees = total_employees - work_from_home office_employees_per_day = office_employees / 2 fraction_of_employees_in_office = office_employees_per_day / total_employees result = fraction_of_employees_in...
Bob mows the lawn for $15 per hour. He mows for 2.5 hours on Monday and 1.75 hours on Wednesday. How much money does he earn in total?
def solve() -> int: total_earnings = 15 * (2.5 + 1.75) result = total_earnings return result
A restaurant has 30 tables. Each table can seat 4 people. If the restaurant is full, how many people can it seat?
def solve() -> int: num_of_tables = 30 seating_per_table = 4 total_seating = num_of_tables * seating_per_table result = total_seating return result
Lisa has to bake a cake that will feed 24 people, and she has a cake mix that states it yields 24 servings. Each serving has 30g of sugar. If Lisa triples the recipe, how much sugar is needed to make the cake?
def solve() -> int: servings = 24 sugar_each = 30 triple_servings = servings * 3 triple_sugar = sugar_each * triple_servings result = triple_sugar return result
3. Mary was training for a 10 mile race. She runs 5 miles in one hour and keeps running at the same speed. How much time will it take her to finish the 10 mile race?
def solve() -> int: distance = 10 speed = 5 time = distance / speed result = time return result
Mary has $80. She spends $20 on textbooks, $25 on stationery, and the remainder equally on 2 shirts. How much money does Mary spend on each shirt?
def solve() -> int: remaining_money = 80 - 20 - 25 shirts_cost = remaining_money / 2 result = shirts_cost return result
In a school, there are 324 students. There are twice as many boys as girls. How many boys are in the school?
def solve() -> int: num_girls =... num_boys =... result = num_boys return result
Robert's jar is 1/5 full of marbles. He adds 15 marbles to fill it. How many marbles can the jar hold when full?
def solve() -> int: jar_capacity = 15 / (1/5) result = jar_capacity return result
Nina is selling lemonade at a stand. She makes 6 liters of lemonade and sells it for $1.50 per cup. Each cup is 250 milliliters. She sells all the lemonade except for one cup that she drinks herself. How much money did Nina make?
def solve() -> int: lemonade_amount = 6 cup_price = 1.50 lemonade_amount = lemonade_amount * 1000 cup_size = 250 cup_number = lemonade_amount // cup_size cup_number = cup_number - 1 total_money = cup_number * cup_price result = round(total_money, 2) return result
A chef prepares a cake using 2 cups of flour, 1 cup of sugar, and 4 eggs. If she wants to make 8 cakes, how many cups of sugar will she need?
def solve() -> int: num_cakes = 8 sugar_per_cake = 1 total_sugar = num_cakes * sugar_per_cake result = total_sugar return result
A CD takes 72 minutes to play. If the first song is 3 minutes, how many songs are on the CD?
def solve() -> int: remaining_time = 72 - 3 song_length = 5 number_of_songs = remaining_time // song_length result = number_of_songs return result
A teacher graded her student's papers and decided to give 10 extra points to each student. If the class average was 85 before the extra points, what will the new class average be?
def solve() -> int: class_average_before = 85 extra_points = 10 class_size = 30 class_total_before = class_average_before * class_size class_total_after = class_total_before + (extra_points * class_size) class_average_after = class_total_after / class_size result = class_average_after re...
Student: A concert ticket costs $35. There are 120 tickets to be sold. What is the total revenue from ticket sales?
def solve() -> int: ticket_price = 35 number_of_tickets = 120 total_revenue = ticket_price * number_of_tickets result = total_revenue return result
Student: There are 12 chairs in the living room. If each chair has 4 legs, how many legs are there in total?
def solve() -> int: chairs = 12 legs_per_chair = 4 total_legs = chairs * legs_per_chair result = total_legs return result
If a store sells 25 shirts for $200, how much does each shirt cost?
def solve() -> int: number_of_shirts = 25 total_cost = 200 cost_per_shirt = total_cost / number_of_shirts result = cost_per_shirt return result
Jaden can solve math equations at five times the speed that Lucy can. Lucy can solve math equations at one-fourth the speed that Liam can. And Liam can solve math equations at three times the speed that Ethan can. If Ethan can solve math equations in 2 minutes, how long does it take for Jaden to solve these equations?
def solve() -> int: ethan_speed = 1/2 liam_speed = 3 * ethan_speed lucy_speed = 1/4 * liam_speed jaden_speed = 5 * lucy_speed jaden_time = 1/jaden_speed * 60 result = jaden_time return result
A gardener can water one plant in one minute by hand. With a sprinkler, they can water one plant in thirty seconds. How many more plants can they water using the sprinkler in ten minutes? A river is being expanded from its current length of 400 meters up to 1,200 meters. On the first day of construction, 60 meters are ...
def solve() -> int: plants_by_hand = 10 * 1 plants_by_sprinkler = 10 * 2 diff_plants = plants_by_sprinkler - plants_by_hand meters_second_day = 60 * 2 total_meters_dug = 60 + meters_second_day meters_left = 1200 - 400 - total_meters_dug result = diff_plants, met...
The price of a computer increased by 10% from last year. The computer cost $800 last year. How much does it cost this year?
def solve() -> int: last_year_cost = 800 percent_increase = 0.1 cost_increase = last_year_cost * percent_increase this_year_cost = last_year_cost + cost_increase result = this_year_cost return result
Andy earns 8000$ a month as a software developer. Out of which, 18 percent is deducted for taxes, 10 percent for healthcare, and he has to pay 200$ for licensing fees. What is his take-home salary?
def solve() -> int: monthly_salary = 8000 taxes = monthly_salary * 0.18 healthcare = monthly_salary * 0.10 licensing_fees = 200 take_home_salary = monthly_salary - taxes - healthcare - licensing_fees result = take_home_salary return result