question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Leo has 24 marbles of different colors. He decides to sort them into 4 equal groups by color. He then gives one group to his friend Mia, who already has 12 marbles. His other friend Noah, who has twice as many marbles as Mia, also sorts his marbles into 4 equal groups and gives one group to Leo. How many marbles do Leo...
def solve() -> int: leo_marbles = 24 - 24 // 4 mia_marbles = 12 + 24 // 4 noah_marbles = 2 * mia_marbles noah_marbles = noah_marbles - noah_marbles // 4 leo_marbles = leo_marbles + noah_marbles // 4 total_marbles = leo_marbles + noah_marbles result = total_marbl...
Student: The total cost of buying a dozen of oranges is $10.56. If the cost of 3 oranges is $0.99, how much does Fred have to pay if he wants to buy 7 oranges?
def solve() -> int: total_cost = 10.56 dozen = 12 cost_3 = 0.99 num_oranges = 7 cost_1 = cost_3 / 3 cost_7 = cost_1 * num_oranges result = cost_7 return result
Amanda makes a smoothie with 5 bananas and splits it between 5 people. If a banana has 100 calories, how many calories does each person get?
def solve() -> int: bananas = 5 people = 5 calories_per_banana = 100 total_calories = bananas * calories_per_banana calories_per_person = total_calories / people result = calories_per_person return result
Student: Travis has 10 quarters, 6 dimes, and 5 nickels. His mother gives him 5 more quarters, 15 dimes, and 4 times as many nickels as he has. How many coins does he have altogether?
def solve() -> int: quarters = 10 dimes = 6 nickels = 5 more_quarters = 5 more_dimes = 15 more_nickels = 4 * nickels total_quarters = quarters + more_quarters total_dimes = dimes + more_dimes total_nickels = nickels + more_nickels total_coins = total_quarters + total_dimes + tota...
A bottle of juice costs as much as two cups of yogurt. Eight bottles of juice cost $16. If Cara wants to buy five bottles of juice and three cups of yogurt, how much change will she get from $20?
def solve() -> int: bottle_of_juice = 16 / 8 cup_of_yogurt = bottle_of_juice / 2 total_cost = 5 * bottle_of_juice + 3 * cup_of_yogurt change = 20 - total_cost result = change return result
There are 48 toys in a box. 14 of the toys are cars, and the rest are dolls. If there are three times as many dolls as cars, how many dolls are in the box?
def solve() -> int: toys = 48 cars = 14 dolls = 3 * cars dolls = toys - cars result = dolls return result
James reads 5 pages per minute for 20 minutes. Then he reads 3 pages per minute for 10 minutes. How many pages did he read in total?
def solve() -> int: pages_per_minute_1 = 5 minutes_1 = 20 pages_per_minute_2 = 3 minutes_2 = 10 total_pages_1 = pages_per_minute_1 * minutes_1 total_pages_2 = pages_per_minute_2 * minutes_2 total_pages = total_pages_1 + total_pages_2 result = total_pages return result
2. Jake is a chef who works at a restaurant every day. It takes him 20 minutes to drive there and 10 minutes to prepare his ingredients. 4 days of the week he has a 30-minute lunch break and the other day he has a 45-minute lunch break. How long does he spend on all these activities in a week with 5 work days?
def solve() -> int: drive_time = 20 prep_time = 10 short_lunch_time = 30 long_lunch_time = 45 time_4_days = (drive_time + prep_time + short_lunch_time) * 2 time_1_day = (drive_time + prep_time + long_lunch_time) * 2 time_week = time_4_days + time_1_day result =...
A city's population increases exponentially every year. After 10 years, the population is 80,000. If the initial population was 10,000, what is the growth factor? If John gets paid $14.50 per hour and works for 9 hours in a day, how much money will he earn in a day?
def solve() -> int: initial_population = 10000 final_population = 80000 years = 10 growth_factor = final_population / initial_population ** (1/years) result = growth_factor hourly_rate = 14.50 hours_worked = 9 daily_earnings = hourly_rate * hours_worked result = daily_...
Student: Three stones have been selected from a bag containing 11 red stones and 3 green stones. Calculate the probability of selecting one green stone if these stones are drawn randomly from the bag?
def solve() -> int: red_stones = 11 green_stones = 3 total_stones = red_stones + green_stones probability = green_stones / total_stones result = probability return result
A pen costs $2 less than a pencil. The pencil is 40% more expensive than a $0.50 eraser. How much does the pen cost?
def solve() -> int: increase = 0.5 * 0.4 pencil = 0.5 + increase pen = pencil - 2 result = pen print (f'<<<{result}>>>') return result
arah is saving up to buy a new bike. She can save $15 per week. If the bike costs $200, at least how many weeks does she need to save?
def solve() -> int: savings_needed = 200 weekly_savings = 15 weeks = savings_needed // weekly_savings if savings_needed % weekly_savings!= 0: weeks += 1 result = weeks return result
A grocery store has 200 boxes of strawberries to sell for the day. If each box has 12 strawberries and each strawberry that is not sold by the end of the day is thrown out, how many strawberries will be thrown out if the store sells 75% of the boxes?
def solve() -> int: total_boxes = 200 boxes_sold = total_boxes*0.75 strawberries_per_box = 12 total_strawberries = total_boxes*strawberries_per_box strawberries_sold = boxes_sold*strawberries_per_box strawberries_thrown_out = total_strawberries - strawberries_sold result = strawberries_throw...
A librarian has 60 books. He bought 15 more and gave 8 books to his colleague. If he receives 20 more books by the end of the week, how many books will he have in his library?
def solve() -> int: books = 60 books += 15 books -= 8 books += 20 result = books return result
A company's profit last year was $100,000. They plan to give a bonus to their employees that is equal to 5% of the profit. The remaining profit will be split between the company's shareholders. If there are 3 shareholders, what is the amount of profit each shareholder will receive?
def solve() -> int: previous_profit = 100000 bonus_percentage = 0.05 num_shareholders = 3 bonus_amount = previous_profit * bonus_percentage remaining_profit = previous_profit - bonus_amount shareholder_profit = remaining_profit / num_shareholders result = shareholder_profit return result...
Every 4 minutes, a faucet drips 3 ml of water. How much water will the faucet drip in one hour?
def solve() -> int: water_per_drip = 3 minutes_per_hour = 60 drips_per_hour = minutes_per_hour / 4 water_per_hour = water_per_drip * drips_per_hour result = water_per_hour return result
Student: The sum of two numbers is 15. The first number is 6 less than the second number. What are the two numbers?
def solve() -> int: num1 = 0 num2 = 0 num2 = 15 - num1 num1 = num2 - 6 result = num1 + num2 return result
In a group of 12 people, some were men and the rest were women. If there were 7 men, how many women were in the group?
def solve() -> int: total_people = 12 number_of_men = 7 number_of_women = total_people - number_of_men result = number_of_women return result
Maya started on the first page of a book. She read 50 pages then went back and reread 10 pages. She then read another 70 pages and found that she is 30 pages away from the end of the book. How long is the book in total?
def solve() -> int: start_page = 1 read_1 = 50 reread = 10 read_2 = 70 remaining = 30 total_pages = start_page + read_1 + reread + read_2 + remaining result = total_pages return result
Daniel is a sprinter. From the starting line, he sprints 100 meters in his first attempt. On his second, he runs double the length, but comes up 5 meters short of the finish line. On his final attempt, he runs three-quarters of the distance he ran in his second attempt. How far, in meters, was he from the finish line a...
def solve() -> int: first_attempt = 100 second_attempt = first_attempt * 2 - 5 third_attempt = second_attempt * 0.75 distance_from_finish = 100 - third_attempt result = distance_from_finish return result
Student: A company employs 10 people who each work 8 hours a day. If each employee earns $15 per hour, what is the total weekly payroll for the company?
def solve() -> int: num_employees = 10 hours_per_day = 8 pay_per_hour = 15 total_hours_per_week = num_employees * hours_per_day total_weekly_payroll = total_hours_per_week * pay_per_hour result = total_weekly_payroll return result
A store sells pencils for 15 cents each and erasers for 25 cents each. A customer buys 12 pencils and 8 erasers. He pays with a 10-dollar bill and gets some change. How much change does he get?
def solve() -> int: pencil_cost = 12 * 0.15 eraser_cost = 8 * 0.25 total_cost = pencil_cost + eraser_cost change = 10 - total_cost result = change return result
A team of six students planned to participate in a robotics competition. The participation fee was $1500, which would be split equally among all. They raised $300 by hosting a bake sale. However, Samantha decided not to participate in the competition. What would be the new cost per person?
def solve() -> int: num_students = 6 participation_fee = 1500 raised_money = 300 new_num_students = num_students - 1 total_cost = participation_fee - raised_money new_cost_per_person = total_cost / new_num_students result = new_cost_per_person return result
A marketing manager who has worked for 5 years and makes $7,500 per month just received a 4% salary increase. What is their new monthly salary?
def solve() -> int: years_worked = 5 current_salary = 7500 salary_increase_percentage = 4 salary_increase = current_salary * (salary_increase_percentage / 100) new_salary = current_salary + salary_increase result = new_salary return result
Possible additional questions are: A baker made 36 muffins and divided them equally among 4 boxes. He sold 2 boxes at the morning market and half of the remaining muffins at the afternoon market. How many muffins does he have left?
def solve() -> int: muffins = 36 muffins_per_box = muffins // 4 muffins -= 2 * muffins_per_box muffins_sold = muffins // 2 muffins -= muffins_sold result = muffins return result
You have $500 that earns 2% interest each year. How much money will you have after 5 years?
def solve() -> int: principal = 500 interestRate = 0.02 time = 5 interestEarned = principal*(1+interestRate)**time - principal finalAmount = principal + interestEarned result = finalAmount return result
Christopher is planning a vacation to Hawaii that will cost $4,500. He has saved $3,200 so far, but he needs to pay a deposit of $500 to secure his flight and hotel reservation. How much more money does Christopher need to save up for his vacation?
def solve() -> int: vacation_cost = 4500 savings = 3200 deposit = 500 total_needed = vacation_cost - savings + deposit result = total_needed return result
If a 6-pack of soda costs $5, how much would it cost to buy 48 cans of soda?
def solve() -> int: num_cans_in_pack = 6 price_pack = 5 num_packs_needed = 48 // num_cans_in_pack + (48 % num_cans_in_pack > 0) total_price = num_packs_needed * price_pack result = total_price return result
Jacob has ten towels that he uses at the pool. He washes them once every two weeks. If he missed laundry day last week, how many days at the pool will he have to use dirty towels? Mary wants to read 60 books before the end of the year. She plans to read one book every day for 5 days, and then rest for 2 days. After doi...
def solve() -> int: towels = 10 laundry_frequency = 2 missed_weeks = 1 dirty_towels = towels * (missed_weeks % laundry_frequency) result = dirty_towels books_goal = 60 books_per_round = 5 rest_days_per_round = 2 rounds_completed = 10 books_read = books_per_round * ...
At the beginning of the rainy season, a tank was already filled with 4/5 liters of water. On the first day, 1/3 liter of water more was added into the tank. On the second day, 1/2 liter of water more was added into the tank. On the third day, the tank was already filled. How many liters of water were collected on the t...
def solve() -> int: water_filled_day1 = 4/5 water_additional_day1 = 1/3 water_additional_day2 = 1/2 total_water = 1 water_filled_total = water_filled_day1 + water_additional_day1 + water_additional_day2 water_collected_day3 = total_water - water_filled_total result = water_collecte...
If an online store charges $3.99 for shipping and an item costs $25.99, what is the total cost of the item including shipping?
def solve() -> int: shipping_cost = 3.99 item_cost = 25.99 total_cost = shipping_cost + item_cost result = total_cost return result
Charlie sells lemonade at a stand. He charges 50 cents for a small cup and 75 cents for a large cup. He sold 25 small cups and 15 large cups in one day. How much money did he make in total?
def solve() -> int: small_cups_money = 25 * 0.5 large_cups_money = 15 * 0.75 total_money = small_cups_money + large_cups_money result = total_money return result
Student: A rectangle has a length of 12 cm and a width of 8 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 12 width = 8 perimeter = 2 * (length + width) result = perimeter return result
Ali invested $900 in Cardano. In the first month, it lost 10% in value. In the second month, it gained 25% of the new value. In the third month, it gained 15% of the new value. How much is his investment worth now?
def solve() -> int: investment = 900 investment = investment * 0.9 investment = investment * 1.25 investment = investment * 1.15 result = investment return result
After six months of saving her allowance, Sarah has saved $200. She wants to buy her friend a $50 birthday gift plus keep at least $100 in her savings account, how much money should she spend on herself?
def solve() -> int: total_savings = 200 gift = 50 minimum_savings = 100 self_spending = total_savings - gift - minimum_savings result = self_spending return result
Student: My sister is 5 years younger than me. If I am 20 years old now, how old was my sister when I turned 10?
def solve() -> int: my_age = 20 sister_age = my_age - 5 my_age_at_10 = 10 sister_age_at_10 = my_age_at_10 - 5 sister_age_when_I_turned_10 = sister_age - sister_age_at_10 result = sister_age_when_I_turned_10 return result
Kevin commenced his adventure by driving to the city. Then from there, he traveled three times the distance he'd just traveled to the second destination. The third point on his journey was 60 miles away, which was one-quarter the distance he traveled from his starting point to his first destination. The fourth destinat...
def solve() -> int: distance1 = 60 * 4 distance2 = distance1 * 3 distance3 = 60 distance4 = (distance1 + distance2 + distance3) * 2 total_distance = distance1 + distance2 + distance3 + distance4 result = total_distance return result
A restaurant has 80 tables. If each table can seat 4 people, how many people can the restaurant serve at once?
def solve() -> int: total_tables = 80 seats_per_table = 4 total_seating = total_tables * seats_per_table result = total_seating return result
A bookshelf has 5 shelves with 10 books on each shelf. The store is having a buy-one-get-one-free sale. How much would it cost to buy all the books on the shelf?
def solve() -> int: num_shelves = 5 books_per_shelf = 10 book_price = 8.99 total_books = num_shelves * books_per_shelf total_price = (total_books / 2) * book_price result = total_price return result
Samantha is cooking breakfast. She makes pancakes using 3/4 cup of flour, 1/2 cup of milk, and 1/4 cup of maple syrup. She also cooks bacon with 200 calories and drinks 100 calories worth of orange juice. If Samantha eats 1/2 of the pancakes, 1/4 of the bacon, and drinks all the juice, how many calories does she consum...
def solve() -> int: flour = 3/4 milk = 1/2 maple_syrup = 1/4 bacon_calories = 200 orange_juice_calories = 100 pancakes = 1/2 * (flour + milk + maple_syrup) bacon = 1/4 * bacon_calories juice = orange_juice_calories total_calories = pancakes + bacon + juice result =...
Gina had $41 in the bank. She then withdrew $8, and deposited $9. What is the new balance in her bank account?
def solve() -> int: total = 41 total = total - 8 total = total + 9 result = total return result
Mary buys 8 pieces of apples. Each apple is 3.5 kg. How much does Mary buy in total?
def solve() -> int: total_weight = 8 * 3.5 result = total_weight return result
If 6 people are sent to the shop to buy 8 items and the shopkeeper gives them a 10% discount, how much money will they save?
def solve() -> int: people = 6 items = 8 discount = 0.1 cost_before_discount = people*items cost_after_discount = cost_before_discount * (1-discount) result = cost_before_discount - cost_after_discount return result
Possible questions and programs are: Luke baked 18 cupcakes for his birthday party. He gave 4 cupcakes to his best friend, 3 cupcakes to his neighbor, and 2 cupcakes to his teacher. He wants to share the rest of the cupcakes equally among his 6 family members. How many cupcakes will each family member get?
def solve() -> int: cupcakes_left = 18 - 4 - 3 - 2 cupcakes_per_family = cupcakes_left // 6 result = cupcakes_per_family return result
A classroom has 14 students and each of them needs to share 5 chocolates. How many chocolates will each student get?
def solve() -> int: students = 14 chocolates = 5 each_student = 0 each_student = chocolates / students result = each_student return result
Mr. Lee is a swimming instructor. Twenty students enrolled in his class last month, but he had to give a refund to seven students who didn't show up for the session. If he triples the enrollments next month, how many swimmers would he be teaching?
def solve() -> int: students_last_month = 20 refund = 7 students_this_month = students_last_month - refund enrollments_next_month = students_this_month * 3 result = enrollments_next_month return result
Lisa has a collection of stickers. She has 40 animal stickers, 32 flower stickers, and 28 star stickers. She wants to give some stickers to her friends. She gives 8 animal stickers to Amy, 6 flower stickers to Ben, and 10 star stickers to Cindy. How many stickers does she have left in her collection?
def solve() -> int: animal_stickers = 40 - 8 flower_stickers = 32 - 6 star_stickers = 28 - 10 total_stickers = animal_stickers + flower_stickers + star_stickers result = total_stickers return result
Pam had three baskets of fruits, one basket contained 5 oranges, a second basket had 4 times as many apples than oranges, and a third basket had 3 times as many bananas than apples. How many fruits did Pam have in total?
def solve() -> int: numberOranges = 5 numberApples = numberOranges * 4 numberBananas = numberApples * 3 totalFruits = numberOranges + numberApples + numberBananas result = totalFruits return result
9. The store has erasers and markers, erasers cost 35 cents each while markers cost 1/5 of the price of erasers. If the store sold 30 erasers and earned $10.50, how much do markers cost?
def solve() -> int: from sympy import Symbol, solve x = Symbol('x') expr = 0.35*30 - 0.2*x result = solve(expr) print (result) return result
Student: A room is 15 feet long and 12 feet wide. What is the area of the room in square feet?
def solve() -> int: length = 15 width = 12 area = length * width result = area return result
Susan has 60 books to read over the course of a year. If she wants to read the same number of books each month and has already read 10 books in the first two months, how many books does she need to read each month for the rest of the year?
def solve() -> int: books_left = 60 - 10 months_left = 12 - 2 books_per_month = books_left / months_left result = books_per_month return result
A group of friends are sharing a pizza. If each slice is 1/8 of the pizza and there are 6 slices left, what fraction of the pizza is left?
def solve() -> int: slice_size = 1/8 remaining_slices = 6 remaining_pizza = (1 - slice_size)*remaining_slices result = f'<<<{remaining_pizza}>>>' result = remaining_pizza return result
A pizza shop sells two sizes of pizzas: small and large. The small pizza has a diameter of 10 inches and costs $8, while the large pizza has a diameter of 14 inches and costs $12. How many large pizzas should the shop sell to make the same amount of money as selling 20 small pizzas?
def solve() -> int: small_diameter = 10 small_price = 8 large_diameter = 14 large_price = 12 small_area = 3.14 * (small_diameter / 2)**2 large_area = 3.14 * (large_diameter / 2)**2 area_ratio = small_area / large_area large_equivalent = area_ratio * 20 large_price_equivalent = (small...
A hexagonal prism has a base side length of 3 cm and a height of 8 cm. What is the volume of the prism?
def solve() -> int: from math import sqrt side_length = 3 height = 8 base_area = 3/2*sqrt(3)*side_length**2 volume = base_area * height result = volume return result
A fruit stand sells baskets of apples, which each contain 8 apples, and baskets of oranges, which each contain an equal amount of oranges. The fruit stand sells 25 baskets of apples and 15 baskets of oranges today. If the fruit stand has sold 320 fruits in total today, how many oranges are in each basket of oranges?
def solve() -> int: apple_number = 25 * 8 orange_number = 320 - apple_number orange_per_basket = orange_number / 15 result = orange_per_basket return result
Sarah works as a web developer. For the first month, she earns $500 for developing 2 websites. For the next month, she earns twice the amount for developing 3 websites. For the third month, she develops the same number of websites as the previous month but only gets paid every other week. How much money did she earn ov...
def solve() -> int: websites_first_month = 2 salary_first_month = 500 salary_per_website_first_month = salary_first_month / websites_first_month websites_second_month = 3 salary_per_website_second_month = salary_per_website_first_month * 2 salary_second_month = salary_per_website_second_mon...
A group of six coworkers agreed to split the cost of a gift for their boss. The total cost of the gift was $120 and they contributed equally. If one coworker paid $25, how much did the gift cost in total?
def solve() -> int: total_cost = 120 num_coworkers = 6 one_coworker_payment = 25 total_contribution = one_coworker_payment * num_coworkers gift_cost = total_contribution result = gift_cost return result
Possible questions and programs: Brian works as a landscaper and charges $30 per hour for his services. He spends 4 hours each week mowing lawns and 2 hours each week trimming hedges. If he works for 40 weeks in a year, how much money does he earn in a year from landscaping?
def solve() -> int: hourly_rate = 30 mowing_hours = 4 trimming_hours = 2 weeks = 40 total_hours = (mowing_hours + trimming_hours) * weeks money_earned = hourly_rate * total_hours result = money_earned return result
ophia bought 5 packs of candies with 25 pieces in each pack. If she gave 35 pieces of candies to her friends, how many candies does she have left?
def solve() -> int: packs = 5 pieces_per_pack = 25 total_candies = packs * pieces_per_pack candies_given_away = 35 candies_left = total_candies - candies_given_away result = candies_left return result
John invested $2000 at an annual interest rate of 4.5% for 5 years. Find the compound interest he earned.
def solve() -> int: P = 2000 r = 0.045 t = 5 A = P * (1 + r)**t interest = A - P result = interest return result
In 9 years, Alex will be three times as old as Max. If Max is currently 10 years old, how old is Alex now?
def solve() -> int: max_age = 10 years_to_add = 9 max_age_in_9_years = max_age + years_to_add alex_age_in_9_years = 3 * max_age_in_9_years alex_age_now = alex_age_in_9_years - years_to_add result = alex_age_now return result
Student: A school has 300 students. 60% of them play soccer, and the rest play basketball. How many students play basketball?
def solve() -> int: total_students = 300 soccer_ratio = 0.6 soccer_students = total_students * soccer_ratio basketball_students = total_students - soccer_students result = basketball_students return result
Jason has 15 pencils and 20 pens. He wants to equally divide them into 4 bags. How many pencils and pens will each bag contain?
def solve() -> int: number_of_pencils = 15 number_of_pens = 20 number_of_bags = 4 pencils_per_bag = number_of_pencils // number_of_bags pens_per_bag = number_of_pens // number_of_bags result = (pencils_per_bag, pens_per_bag) return result
A carnival charges $5 per ride. If a family of 4 goes on a total of 10 rides, find the total cost for the family. Assume they get no discount.
def solve() -> int: ride_cost = 5 family_num = 4 ride_num = 10 total_cost = ride_cost * family_num * ride_num result = total_cost return result
James sends his daughter to a boarding school. It costs $26,000 per semester. There are 3 semesters in a year. How much will James spend to send his daughter to the school for 10 years?
def solve() -> int: cost_per_semester = 26000 semesters_per_year = 3 years = 10 total_cost = cost_per_semester * semesters_per_year * years result = total_cost return result
Student: Mary has 35 yellow markers and 11 fewer brown markers than yellow markers. She has 10 more green markers than brown markers. How many markers does Mary have in total?
def solve() -> int: yellow = 35 brown = yellow - 11 green = brown + 10 total = yellow + brown + green result = total return result
Adam buys a house for $300,000. He gets his sister a house that is twice as much and sells his own house for a third of its value. How much is he out of pocket?
def solve() -> int: house_price = 300000 sister_house_price = 2 * house_price sold_house_price = house_price / 3 out_of_pocket = sister_house_price - sold_house_price - house_price result = out_of_pocket return result
There are 40 cookies in a jar. Half of them have chocolate chips, and the rest have raisins. One-third of the cookies have nuts, and the rest have no nuts. If 8 cookies with raisins have nuts, how many cookies with chocolate chips have no nuts?
def solve() -> int: chocolate = 40 / 2 raisins = 40 - chocolate nuts = 40 / 3 no_nuts = 40 - nuts raisins_nuts = 8 chocolate_nuts = nuts - raisins_nuts chocolate_no_nuts = chocolate - chocolate_nuts result = chocolate_no_nuts return result
A department store had 4500 customers in a week. If each customer buys an average of 3 items, how many items were sold in a week?
def solve() -> int: customers_in_week = 4500 items_per_customer = 3 total_items_sold = customers_in_week * items_per_customer result = total_items_sold return result
Student: Charlie is buying a new pair of shoes worth $80. The store offers a 20% discount on the marked price but charges sales tax at a rate of 6%. How much will Charlie have to pay in total?
def solve() -> int: price = 80 discount = 0.2 tax_rate = 0.06 discounted_price = price * (1 - discount) tax = discounted_price * tax_rate result = discounted_price + tax return result
A man buys a car for $20,000 and sells it for $25,000. If he has to pay a commission of 10% on the sale of the car, what is his total profit?
def solve() -> int: car_cost = 20000 car_sale_price = 25000 commission_rate = 0.1 car_profit = car_sale_price - car_cost commission_paid = car_sale_price * commission_rate total_profit = car_profit - commission_paid result = total_profit return result
Emily works in a retail store that pays $12 per hour on weekdays and $15 per hour on weekends. She worked 25 hours on weekdays and 10 hours on weekends. How much money did she earn in total?
def solve() -> int: weekday_earnings = 25 * 12 weekend_earnings = 10 * 15 total_earnings = weekday_earnings + weekend_earnings result = total_earnings return result
If a garden has 200 flowers and 40 of them are roses, what is the percentage of the garden that is made up of roses?
def solve() -> int: total_flowers = 200 roses = 40 percentage_roses = (roses / total_flowers) * 100 result = percentage_roses return result
The ratio of the length of three pencils is 2:3:4. If the sum of their lengths is 45cm, find the length of the longest pencil.
def solve() -> int: pencil1 = 2 pencil2 = 3 pencil3 = 4 total_length = 45 total_pencil_length = pencil1 + pencil2 + pencil3 longest_pencil = (pencil3/total_pencil_length)*total_length result = longest_pencil return result
Student: If a rectangle's length is 5 larger than its width and its area is 84, what are the rectangle's dimensions?
def solve() -> int: length = 0 width = 0 area = 84 result = (length, width) return result
A supermarket has a 2-for-1 offer on apples that cost $0.60 each. If a customer buys 10 apples, how much do they pay?
def solve() -> int: apple_price = 0.6 num_apples = 10 num_offers = num_apples // 2 total_price = (num_apples - num_offers) * apple_price result = total_price return result
If it takes David twice as long to perform coding as testing, and he spent 360 minutes coding and testing today, how many minutes did he spend testing?
def solve() -> int: coding_time = 360 testing_time = coding_time / 3 result = testing_time return result
If x, y, and z are consecutive even integers and their sum is 78, what are the values of x, y, and z?
def solve() -> int: total = 78 z = total // 3 x = z - 4 y = z - 2 result = x, y, z return result
Liam has 3 quarters, 2 dimes, and 5 pennies in his pocket. He wants to buy a soda that costs $1.25. How many more cents does he need to buy the soda?
def solve() -> int: total_value = 3 * 25 + 2 * 10 + 5 * 1 difference = 125 - total_value result = difference return result
Lisa worked at a café for 8 hours. She gets $10 per hour for the first 6 hours and $12 per hour for the remaining 2 hours. How much money did she earn working the entire shift?
def solve() -> int: pay_per_hour1 = 10 hours1 = 6 pay_per_hour2 = 12 hours2 = 2 total_pay = (pay_per_hour1 * hours1) + (pay_per_hour2 * hours2) result = total_pay return result
In a grocery store, there are three kind of fruits sold. Apples cost $0.5 each, oranges cost $0.4 each and bananas cost $0.2 each. If the store sold 150 apples, 80 oranges, and 100 bananas, what was the total revenue made by the store?
def solve() -> int: fruits = {'apples': 0.5, 'oranges': 0.4, 'bananas': 0.2} total_apple_sales = 150 * fruits['apples'] total_orange_sales = 80 * fruits['oranges'] total_banana_sales = 100 * fruits['bananas'] total_sales = total_apple_sales + total_orange_sales + total_banana_sales result = tota...
During a survey on color preferences, a paint store asks its customers two questions. The first question was whether they prefer bright or pastel colors, and the second question was whether they prefer interior or exterior paint. Of the 300 customers that participated in the survey, 20% chose pastel colors and interior...
def solve() -> int: pastel_interior = 0.2 * 300 bright_exterior = 0.4 * 300 pastel_bright = 300 - pastel_interior - bright_exterior result = pastel_bright return result
Alyssa has 15 more marbles than Bella does. If Bella has 25 marbles, how many more marbles will Bella have than Alyssa if they join their marble collection and then divide them equally?
def solve() -> int: bella_marbles = 25 alyssa_marbles = bella_marbles + 15 total_marbles = bella_marbles + alyssa_marbles equal_share = total_marbles / 2 bella_share = equal_share - bella_marbles result = bella_share return result
A rectangular field is 60 feet long and 40 feet wide. If a fence costs $5 per foot, how much will it cost to fence around the field?
def solve() -> int: length = 60 width = 40 cost_per_foot = 5 perimeter = 2*length + 2*width total_cost = perimeter * cost_per_foot result = total_cost return result
Karen eats 2 slices of pizza and 3 times as many breadsticks, and each slice has 450 calories and each breadstick has 1/4 that many calories, how many calories are in all the food?
def solve() -> int: pizza_slices = 2 breadsticks = 3 * pizza_slices calories_per_slice = 450 calories_per_breadstick = calories_per_slice / 4 total_calories = (pizza_slices * calories_per_slice) + (breadsticks * calories_per_breadstick) result = total_calories return result
Student: Lisa can paint a wall at 6 square feet/minute and Jane can paint a wall at 4 square feet/minute. How long does it take them to paint a 120 square foot wall together?
def solve() -> int: lisa_speed = 6 jane_speed = 4 wall_area = 120 total_speed = lisa_speed + jane_speed time = wall_area / total_speed result = time return result
A student has a test with 50 questions and scored 38. What percentage did the student score?
def solve() -> int: total_questions = 50 scored_questions = 38 percentage_scored = (scored_questions / total_questions) * 100 result = percentage_scored return result
Student: A train traveled 345 miles in 5 hours. What was the speed of the train in miles per hour?
def solve() -> int: distance = 345 time = 5 speed = distance / time result = speed return result
A student got 85, 90, 92, and 87 in his quizzes. What is the average score of the student?
def solve() -> int: quiz1 = 85 quiz2 = 90 quiz3 = 92 quiz4 = 87 average = (quiz1 + quiz2 + quiz3 + quiz4) / 4 result = average return result
Ella is sorting books. She has 200 books in total, of which 80 are fiction, 60 are non-fiction, and the rest are comics. She puts 40 fiction books, 30 non-fiction books, and 10 comics on a shelf. She puts the rest of the books in a box. How many books are in the box, and what is the ratio of fiction to non-fiction book...
def solve() -> int: total = 200 fiction = 80 nonfiction = 60 comics = total - (fiction + nonfiction) shelf_fiction = 40 shelf_nonfiction = 30 shelf_comics = 10 box_fiction = fiction - shelf_fiction box_nonfiction = nonfiction - shelf_nonfiction box_comics = comics - shelf_comics ...
Three friends share a pizza equally. The pizza has 8 slices. How many slices of pizza does each person get?
def solve() -> int: pizza_slices = 8 num_friends = 3 slices_per_person = pizza_slices / num_friends result = slices_per_person return result
ven more than one-sixth of the number of birds on the fence is 17. How many birds are on the fence?
def solve() -> int: birds = 0 result = 0 while result!= 17: birds = birds + 1 result = (birds/6) + 7 if result==17: print ("The number of birds is", birds) return result
At his toy store, Tom sells hot wheels and lego kits by the set. The Hot Wheels set costs $10 and has 6 cars. The Lego kit costs $20 and has 50 pieces. If Tom sells 12 hot wheel sets and 5 Lego sets, how much money did he make from his sales today?
def solve() -> int: hot_wheels_price = 10 hot_wheels_cars = 6 lego_price = 20 lego_pieces = 50 hot_wheels_sets_sold = 12 lego_sets_sold = 5 hot_wheels_total_price = hot_wheels_price * hot_wheels_cars * hot_wheels_sets_sold lego_total_price = lego_price * lego_pieces * lego_sets...
A train leaves from station A at 11:00 AM and arrives at station B at 3:30 PM. What is the duration of the train journey?
def solve() -> int: start_time = 11.00 end_time = 3.30 duration = end_time - start_time result = f"The duration of the train journey is {duration} hours." return result
Susan's blender can blend three cups of smoothie at once. How many times does Susan need to blend to make 9 cups of smoothie?
def solve() -> int: cups_per_blend = 3 total_cups = 9 blends_needed = total_cups // cups_per_blend result = blends_needed return result
A bird flies above a forest and is joined by a flock of 7 sparrows. 4 butterflies join each sparrow and 2 fireflies join each butterfly. How many animals are flying above the forest in total?
def solve() -> int: bird = 1 sparrows = 7 butterflies = sparrows * 4 fireflies = butterflies * 2 total_animals = bird + sparrows + butterflies + fireflies result = total_animals return result
Fiona has 10 times more books than her sister, Emily. If Emily has 35 books, how many books does Fiona have?
def solve() -> int: emily_books = 35 fiona_books = 10 * emily_books result = fiona_books return result
If Miguel's age is thrice that of his sister's age, and his sister is 9 years old today, how old will Miguel be in 12 years?
def solve() -> int: sister_age = 9 miguel_age = 3 * sister_age miguel_age_in_12_years = miguel_age + 12 result = miguel_age_in_12_years return result
Student: Bob needs to buy 10 lamp bulbs, each bulb costing $15, and 7 lamp shades, each shade costing $25. How much money will he spend in total?
def solve() -> int: num_bulbs = 10 cost_bulb = 15 num_shades = 7 cost_shade = 25 total_cost = num_bulbs * cost_bulb + num_shades * cost_shade result = total_cost return result
A plumber can fix a sink in 2 hours. How many sinks can the plumber fix in an 8-hour workday?
def solve() -> int: sinks_per_hour = 1/2 total_sinks = sinks_per_hour * 8 result = total_sinks return result