question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A fruit vendor sells 40 watermelons for $5 each. The cost of producing those watermelons was $120. How much profit does the fruit vendor make?
def solve() -> int: num_watermelons = 40 price_per_watermelon = 5 revenue = num_watermelons * price_per_watermelon cost = 120 profit = revenue - cost result = profit return result
Maria wants to buy a new bike that costs $400. She has already saved $200. If she can save $25 per week, how long will it take her to save enough money to buy the bike?
def solve() -> int: bike_cost = 400 current_savings = 200 savings_per_week = 25 needed_savings = bike_cost - current_savings weeks_to_save = needed_savings / savings_per_week result = weeks_to_save return result
A bag of candy has 100 pieces. If you eat 25% of them, how many pieces of candy are left?
def solve() -> int: candy = 100 candy *= 0.25 candy = 100 - candy result = candy return result
A ladder leans against a wall. The ladder is 10 meters long and the top of the ladder is 8 meters up the wall. How far away from the wall is the bottom of the ladder?
def solve() -> int: distance = ((10 ** 2) - (8 ** 2)) ** 0.5 result = distance return result
A bookstore has 200 books. They sold 60% of the books for $15 each and the rest for $10 each. How much money did they earn in total?
def solve() -> int: price_of_60_percent_books = 0.6 * 200 * 15 price_of_40_percent_books = 0.4 * 200 * 10 total_earnings = price_of_60_percent_books + price_of_40_percent_books result = f'<<<{total_earnings}>>>' result = total_earnings return result
A rectangular plot of land measures 50 feet by 25 feet. If you want to put a fence around the entire plot, how many feet of fencing do you need to purchase?
def solve() -> int: length = 50 width = 25 perimeter = 2 * (length + width) result = perimeter return result
A car travels a distance of 120 km in 2 hours. What is the average speed of the car in km per hour?
def solve() -> int: distance = 120 time = 2 average_speed = distance / time result = average_speed return result
A man went to a store and bought some pencils. Each pencil costs 50 cents. If he had $5 before, he has $1.50 after buying the pencils. How many pencils did he buy?
def solve() -> int: cost = 0.50 initial_money = 5 final_money = 1.50 pencils = (initial_money - final_money) // cost result = pencils return result
Carl was hired to do maintenance on his neighbor's car by Mrs. Adams. The time it took him to change the oil was three times the time it took him to change the spark plugs. It took him 2 hours in total, and Mrs. Adams paid him $30 per hour. Calculate the total amount of money Mrs. Adams paid him for the car maintenance...
def solve() -> int: oil_time = 3 spark_plugs_time = 1 total_time = 2 oil_cost_per_hour = 30 spark_plugs_cost_per_hour = 30 oil_cost = oil_time * oil_cost_per_hour spark_plugs_cost = spark_plugs_time * spark_plugs_cost_per_hour total_cost = oil_cost + spark_plugs_cost ...
Student: Alex has $500 in his bank account, and he saves $50 every week. How much money will he have in 6 months (26 weeks)?
def solve() -> int: initial_amount = 500 weekly_saving = 50 weeks = 26 final_amount = initial_amount + weekly_saving * weeks result = final_amount return result
The length of a rectangle is three times its width. If the perimeter of the rectangle is 96, what is its length?
def solve() -> int: w = 96 / (2 * (3+1)) l = 3 * w result = l return result
In a pack of candy, there are 3 pieces of blue candy for every 7 pieces of green candy. If there are 27 pieces of candy, how many green candies are in the pack?
def solve() -> int: green_candies = 0 total_candies = 27 blue_candy_ratio = 3 green_candies = total_candies * (blue_candy_ratio / (blue_candy_ratio + 7)) result = green_candies return result
Two pizza shops I and J, are selling pizza slices. Shop I sells a slice for $2 and shop J sells a slice for $2.5. Shop I was able to sell 800 and shop J 600 slices. How much more money did one shop make from the other?
def solve() -> int: revenue_I = 2 * 800 revenue_J = 2.5 * 600 difference = abs(revenue_I - revenue_J) result = difference return result
Alice swam for 40 minutes at a speed of 2 meters per second, then rested for 20 minutes, and finally swam at a speed of 3 meters per second for 30 minutes. How far did Alice swim in total?
def solve() -> int: distance1 = 2 * 40 * 60 distance2 = 0 distance3 = 3 * 30 * 60 total_distance = distance1 + distance2 + distance3 result = total_distance return result
Lucy has a lemonade stand where she sells each cup for 50 cents. She bought 12 lemons for 3 dollars and 4 liters of water for 2 dollars. She can make 20 cups of lemonade with one lemon and one liter of water. How much profit will she make if she sells all her lemonade?
def solve() -> int: lemons = 12 lemon_cost = 3 water = 4 water_cost = 2 cups_per_lemon = 20 cups_per_liter = 20 cup_price = 0.5 total_cost = lemon_cost + water_cost total_cups = min(lemons * cups_per_lemon, water * cups_per_liter) total_revenue = total_cups * c...
Sophie and Jackson are playing basketball. Sophie has made 25 shots out of 50 attempts, while Jackson has made 20 shots out of 40 attempts. Who has a higher shooting percentage?
def solve() -> int: sophie_shots_made = 25 sophie_attempts = 50 jackson_shots_made = 20 jackson_attempts = 40 sophie_percentage = (sophie_shots_made / sophie_attempts) * 100 jackson_percentage = (jackson_shots_made / jackson_attempts) * 100 if sophie_percentage > jackson_percentage...
am collected a total of 121 coins, some of which were dimes and the rest were pennies. He had 10 times as many dimes as pennies. How many dimes does Sam have?
def solve() -> int: dimes = 0 pennies = 0 total = 121 dimes = total - pennies pennies = total - (dimes * 10) result = dimes return result
A recipe calls for 2 cups of flour to make 12 cookies. How many cups of flour are needed to make 30 cookies?
def solve() -> int: cookies_recipe = 12 flour_recipe = 2 desired_cookies = 30 flour_needed = (desired_cookies/cookies_recipe)*flour_recipe result = flour_needed return result
In a jar of marbles, the ratio of red marbles to blue marbles is 3:2. If there are 50 total marbles, how many red marbles are in the jar?
def solve() -> int: total_marbles = 50 red_to_blue_ratio = 3/2 num_red_marbles = total_marbles / (1 + red_to_blue_ratio) * red_to_blue_ratio result = num_red_marbles return result
Jane is making some lemonade and needs 60 lemons to make 5 gallons of lemonade. How many lemons does she need for every gallon of lemonade?
def solve() -> int: total_lemons = 60 total_gallons = 5 lemons_per_gallon = total_lemons / total_gallons result = lemons_per_gallon return result
Nate is filling his bird feeder. The feeder can hold 3 cups of birdseed. Nate's scoop can normally hold 1/4 cup of birdseed, but due to an empty birdseed container, it can only hold 1/6 as much right now. How many times will Nate need to fill the scoop to fill the feeder?
def solve() -> int: scoop_capacity = 1/4 current_scoop_capacity = 1/6 feeder_capacity = 3 scoop_fillings_needed = feeder_capacity / (current_scoop_capacity * scoop_capacity) result = scoop_fillings_needed return result
An apple is sold at $1.20 each. John bought 5 apples and paid with a $10 note. How much change did he receive?
def solve() -> int: price = 1.2 quantity = 5 total_price = price * quantity payment = 10 change = payment - total_price result = change return result
A rectangle has a length of 20 cm and a width of 12 cm. What is its area in m²?
def solve() -> int: length_cm = 20 width_cm = 12 length_m = length_cm / 100 width_m = width_cm / 100 area_m = length_m * width_m result = area_m return result
Student: A standard bag of cement can fill up a volume of 0.014 cubic meters. Calculate the number of bags of cement needed to fill up a rectangular base of length 8 meters, width 4 meters, and a height of 2 meters.
def solve() -> int: length = 8 width = 4 height = 2 volume = length * width * height bags_of_cement = volume / 0.014 result = bags_of_cement return result
John drives to work every day and the distance between his home and workplace is 25 kilometers. If he works for 5 days a week, how many kilometers does he drive in a month?
def solve() -> int: days_per_week = 5 weeks_per_month = 4 distance_per_day = 25 total_distance_per_month = days_per_week * weeks_per_month * distance_per_day result = total_distance_per_month return result
A car has 3 tanks of fuel. The first tank contains 40 liters, the second tank contains 50 liters and the third tank contains 60 liters of petrol. What is the average amount of petrol in each tank?
def solve() -> int: total_petrol = 40 + 50 + 60 num_tanks = 3 average_petrol_per_tank = total_petrol / num_tanks result = average_petrol_per_tank return result
am has 24 crayons. He wants to divide them into equal groups of 6. How many groups can he make? How many crayons are left over?
def solve() -> int: crayons = 24 crayons_per_group = 6 groups = crayons // crayons_per_group remainder = crayons % crayons_per_group result = "Sam can make " + str(groups) + " groups. He has " + str(remainder) + " crayons left over." return result
Student: Sam sells lemonade for $0.50 a cup at a stand. He sells 30 cups on the first day, 25 cups on the second day, and 40 cups on the third day. Then he decides to raise the price to $0.75 a cup and sells 20 cups on the fourth day, 15 cups on the fifth day, and 25 cups on the sixth day. How much money has he made ov...
def solve() -> int: price_per_cup = 0.50 cups_sold_day1 = 30 cups_sold_day2 = 25 cups_sold_day3 = 40 total_money_day1_3 = (price_per_cup * cups_sold_day1) + (price_per_cup * cups_sold_day2) + (price_per_cup * cups_sold_day3) price_per_cup = 0.75 cups_sold_day4 = 20 cups_sold_day5 = 15 ...
A pile of bricks is 33 feet high. If the bricks are stacked 2 feet high, how many stacks of bricks are there?
def solve() -> int: height_of_bricks = 33 stack_height = 2 num_of_stacks = height_of_bricks // stack_height result = num_of_stacks return result
Amy is making cookies for a bake sale. She needs 3 cups of flour, 2 cups of sugar, 1 cup of butter, and 2 eggs for each batch. She can buy a 5-pound bag of flour for $3, a 4-pound bag of sugar for $2, a pound of butter for $4, and a dozen eggs for $3. She wants to make 10 batches of cookies. How much does she spend on ...
def solve() -> int: flour_needed = 3 * 10 sugar_needed = 2 * 10 butter_needed = 1 * 10 eggs_needed = 2 * 10 flour_cost = 3 * (flour_needed // 20) sugar_cost = 2 * (sugar_needed // 16) butter_cost = 4 * (butter_needed // 8) egg_cost = 3 * (eggs_needed // 12) total_co...
Alex has 40 coins. He separates out a quarter of them for the vending machine and then spends 7. After finding 10 more on the ground, how many coins does Alex have now?
def solve() -> int: coins = 40 vend = coins * 0.25 coins -= vend coins -= 7 coins += 10 result = coins return result
Possible questions and programs: You can buy 3 pencils or 2 erasers for the same price. You bought 60 items evenly split between notebooks, pencils and erasers, and the price of 1 notebook is $1.20. How much does 1 eraser cost if your total bill was $108?
def solve() -> int: notebooks = 60 // 3 pencils = notebooks erasers = pencils notebook_cost = notebooks * 1.20 remaining_cost = 108 - notebook_cost common_price = remaining_cost / (pencils / 3 + erasers / 2) eraser_price = common_price / 2 result = eraser_price return result
Alice is baking cookies for a party. She has enough ingredients to make 60 cookies. She wants to make two types of cookies: chocolate and vanilla. She has already made 15 chocolate cookies and 12 vanilla cookies. How many more vanilla cookies does she need to make if she wants to have the same number of chocolate and v...
def solve() -> int: made_cookies = 15 + 12 left_cookies = 60 - made_cookies vanilla_cookies = left_cookies / 2 result = vanilla_cookies return result
Ryan observed a group of 5 birds, each with 2 legs. There are also 2 cats and a dog, each with 4 legs. Additionally, there is a pair of roller skates and a scooter. How many legs are there in total?
def solve() -> int: birds = 5 * 2 cats = 2 * 4 dog = 1 * 4 roller_skates = 2 * 0 scooter = 1 * 0 total_legs = birds + cats + dog + roller_skates + scooter result = total_legs return result
10. Eric begins from the Park Office and has to walk to the Little Shop. From the Little Shop, he has to walk to the Viewing Deck, which takes him 10 minutes. How much time it will take Eric to walk from the Park Office to the Viewing Deck?
def solve() -> int: walk_time = 10 result = walk_time return result
A recipe for a cake requires 3 eggs, 2 cups of flour, and 1 cup of sugar. How many cakes can you make with 12 eggs, 10 cups of flour, and 6 cups of sugar?
def solve() -> int: cakes_with_eggs = 12 // 3 cakes_with_flour = 10 // 2 cakes_with_sugar = 6 // 1 cakes = min(cakes_with_eggs, cakes_with_flour, cakes_with_sugar) result = cakes return result
Nathan bought a new house. The width of the house was 40 feet long, and the length was 60 feet long. In order to paint the outside walls, he needs to purchase paint at 10sq-ft per can. Each can of paint covers 500 sq-ft of walls. How many cans of paint does Nathan need to buy?
def solve() -> int: num_can = 0 width = 40 length = 60 can_size = 500 area = width * length num_can = area / can_size result = num_can return result
A store sells three types of fruits: apples, bananas, and oranges. 30% of their fruits are apples, and 20% of those are organic. If there are 24 organic apples, how many fruits does the store sell?
def solve() -> int: apple_ratio = 0.3 organic_apple_ratio = 0.2 organic_apples = 24 total_fruits = organic_apples / (apple_ratio * organic_apple_ratio) result = total_fruits return result
Student: A company produces 56 chairs per day with a production cost of $10 per chair. They sell each chair for $50. In a month, how much revenue will they have after the cost of production if they work 7 days per week?
def solve() -> int: production_cost = 10 selling_price = 50 chairs_per_day = 56 days_per_week = 7 total_chairs_per_month = chairs_per_day * days_per_week * 4 total_cost_of_production = production_cost * total_chairs_per_month total_revenue = selling_price * total_chairs_per_month net_rev...
A toy costs $20 and is discounted by 25%. How much is the toy after the discount?
def solve() -> int: discounted_price = 20 * (1 - 0.25) result = discounted_price return result
A hardware store is giving a 15% discount to anyone who purchases supplies over $200.00. Tim bought supplies for $180.00, $210.00, $150.00, $220.00, $245.00, and $199.00. How much did he pay for supplies?
def solve() -> int: price1 = 180.00 price2 = 210.00 price3 = 150.00 price4 = 220.00 price5 = 245.00 price6 = 199.00 total_price = price1 + price2 + price3 + price4 + price5 + price6 if total_price > 200.00: discount = total_price * 0.15 final_price = total_price...
In a room, there are 90 chairs and three times as many tables as chairs. How many tables are there in the room?
def solve() -> int: chairs = 90 tables = chairs * 3 result = tables return result
Jake took 12 supplements a day for 10 days. Of these 12 supplements, 5 supplements cost $2.75 each, and the other supplements each cost $4.25 more. How much did he spend in total on the supplements?
def solve() -> int: num_supplements = 12 num_days = 10 cost_supplement1 = 2.75 cost_supplement2 = cost_supplement1 + 4.25 total_cost_supplement1 = num_supplements * cost_supplement1 total_cost_supplement2 = (num_supplements - 5) * cost_supplement2 total_cost = total_cost_supplement...
A train travels at 80 km/hour. How long will it take to travel a distance of 240 km?
def solve() -> int: speed = 80 distance = 240 time = distance/speed result = time return result
Student: Kim is on a field trip with her classmates. They find 4 apples under a tree, and 5 oranges. How many fruits did they find?
def solve() -> int: apples = 4 oranges = 5 total_fruits = apples + oranges result = total_fruits return result
Student: If Frank can finish a work in 4 days and Grace can finish 2 works in the same time it takes Frank to finish 1 work, how long will it take for both of them to finish 10 works together?
def solve() -> int: f = 1 / 4 g = 2 / f n = 10 c = f + g t = n / c result = t return result
In Kevin's science club there were 18 members. 50% of the members were girls, and 33% of the girls had brown hair. If 66% of the girls with brown hair wore braces, then how many girls with brown hair and braces were in Kevin's science club?
def solve() -> int: girls = 0.5 * 18 brown = 0.33 * girls braces = 0.66 * brown result = int(braces) return result
Student: A meat store has 120 kg of beef. They sell 16% of it on the first day and 25% of the remaining on the next day. How much beef do they have left?
def solve() -> int: beef = 120 sold_first_day = beef * 0.16 remaining_after_first_day = beef - sold_first_day sold_second_day = remaining_after_first_day * 0.25 remaining_after_second_day = remaining_after_first_day - sold_second_day result = remaining_after_second_day return result
Rachel has $44. She gives away one-fifth of her money to a homeless person. The person buys a sandwich for $6. If the person has $22 left, how much money did Rachel originally have?
def solve() -> int: rachel_money = 44 money_given_away = rachel_money / 5 sandwich_cost = 6 person_money_left = 22 rachel_money -= money_given_away person_money_left += sandwich_cost rachel_money += person_money_left result = rachel_money return result
If a small candy bar costs $0.25 and a large candy bar costs $0.60, what is the price per ounce of the box with the better value (lowest price per ounce)? Assume the small candy bar is 2 ounces and the large candy bar is 5 ounces.
def solve() -> int: small_bar_price_per_ounce = 0.25/2 large_bar_price_per_ounce = 0.60/5 if small_bar_price_per_ounce < large_bar_price_per_ounce: result = round(small_bar_price_per_ounce, 2) else: result = round(large_bar_price_per_ounce, 2) return result
A rectangular soccer field has a length of 80 yards and a width of 50 yards. What is the total area of the soccer field?
def solve() -> int: length = 80 width = 50 area = length * width result = area return result
If a recipe requires 2 cups of flour to make 36 cookies, how many cups of flour would be needed to make 60 cookies?
def solve() -> int: cookies = 60 flour_for_36_cookies = 2 flour_per_cookie = flour_for_36_cookies / 36 flour_for_60_cookies = flour_per_cookie * cookies result = flour_for_60_cookies return result
A company is planning a budget for the next quarter. The company has calculated that the total revenue for next quarter will be $100,000. The company has decided to allocate 40% of the revenue to salaries and 25% of the revenue to marketing. The rest of the revenue will be used for miscellaneous expenses. How much of t...
def solve() -> int: total_revenue = 100000 salary_distribution = 0.40 marketing_distribution = 0.25 misc_distribution = 1 - (salary_distribution + marketing_distribution) misc_expense = misc_distribution * total_revenue result = misc_expense return result
Student: Nancy wants to put flags in a row and she has some red flags, blue flags and yellow flags. She wants to put 7 flags in line and she must have the same number of flags from each color. How many of each color flag does she need?
def solve() -> int: total_flags = 7 colors = 3 flags_per_color = 0 flags_per_color = total_flags // colors result = flags_per_color return result
Emily has a jar with 35 beads. 25% are green and the rest are red. Her friend will trade her five red beads for every green one. If Emily keeps 4 green beads, how many total beads does she have after trading with her friend?
def solve() -> int: beads_in_jar = 35 green_beads = beads_in_jar * 0.25 red_beads = beads_in_jar - green_beads traded_green_beads = 4 traded_red_beads = traded_green_beads * 5 remaining_green_beads = green_beads - 4 remaining_red_beads = red_beads + traded_red_beads total_beads...
Emily has a 256GB external hard drive. She has used up 100GB of storage for her photos. If each photo takes up 5MB of space, how many more photos can she store on the hard drive?
def solve() -> int: total_storage = 256 * 1024 used_storage = 100 photo_size = 5 remaining_storage = total_storage - used_storage remaining_photos = remaining_storage // photo_size result = remaining_photos return result
John invested $4000 in a savings account for 4 years at an annual interest rate of 5%. What will be John's total earnings at the end of the 4 years?
def solve() -> int: principal = 4000 rate = 0.05 time = 4 interest = principal * rate * time total_amount = principal + interest result = total_amount return result
Jake purchased 15 burgers for $30. If he sells each burger for $3.50, what profit in dollars will he make on each burger?
def solve() -> int: burgers_purchased = 15 total_cost = 30 cost_per_burger = total_cost / burgers_purchased selling_price = 3.50 profit_per_burger = selling_price - cost_per_burger result = profit_per_burger return result
The ratio of boys to girls in a class is 3:5. If there are 36 boys in the class, what is the total number of students in the class?
def solve() -> int: boys = 36 boys_percentage = 3/(3+5) class_size = boys/boys_percentage result = class_size return result
Benjamin wants to buy a new watch, but first, he has to pay his monthly car payment. The watch costs $1,000, and his car payment is $500/month. Knowing that Benjamin has saved $150/month for 1 year, how much money will he have left after paying his car payment?
def solve() -> int: watch_cost = 1000 car_payment = 500 monthly_savings = 150 months_saved = 12 total_savings = monthly_savings * months_saved money_left = total_savings - car_payment result = money_left return result
Andrew committed to read for 1 hour each day for a week. However, he failed to read for a whole hour on Monday and Tuesday. So, in order to stay on track, he read for 1 hour and 30 minutes on Wednesday, Thursday, and Friday. How many minutes did Andrew read in total for that week?
def solve() -> int: monday = 0 tuesday = 0 wednesday = 90 thursday = 90 friday = 90 total_minutes = monday + tuesday + wednesday + thursday + friday result = total_minutes + (5 * 60) return result
A recipe calls for 2/3 cup milk and 1/4 cup sugar. If you want to triple the recipe, how many cups of each ingredient will you need?
def solve() -> int: milk = 2/3 sugar = 1/4 recipe_multiplier = 3 total_milk = milk * recipe_multiplier total_sugar = sugar * recipe_multiplier result = (total_milk, total_sugar) return result
A bag contains 80 red and green candies. If 16 candies are green, how many candies are red?
def solve() -> int: total_candies = 80 green_candies = 16 red_candies = total_candies - green_candies result = red_candies return result
Student: 5. Henry has 79 pencils. If he gives away 21 pencils, how many pencils does he have left?
def solve() -> int: pencils = 79 give_away = 21 pencils_left = pencils - give_away result = pencils_left return result
A shoe store had 300 pairs of shoes five years ago. Two years ago, they received a shipment of 200 pairs of shoes. Last year, they added 50 more pairs of shoes than the previous year. This year, they sold 100 pairs of shoes. How many pairs of shoes does the store have now?
def solve() -> int: shoes_five_years_ago = 300 shoes_two_years_ago = shoes_five_years_ago + 200 shoes_last_year = shoes_two_years_ago + 50 shoes_this_year = shoes_last_year - 100 result = shoes_this_year return result
Sarah bought a new computer for $3k. She paid a $1k deposit on the computer, and pays the rest using a loan that is spread out over 3 years. Sarah makes equal payments every month and at the end of the 3 years, the entire balance will be paid off. How much, in thousands of dollars, does Sarah pay each month?
def solve() -> int: total_cost = 3 deposit = 1 loan_amount = total_cost - deposit num_years = 3 num_months = num_years * 12 monthly_payment = loan_amount / num_months result = monthly_payment return result
A bag contains 12 red and 15 blue balls. If two balls are drawn at random without replacement, what is the probability that both balls will be blue?
def solve() -> int: total_balls = 12 + 15 total_blue_balls = 15 prob_first_ball_blue = total_blue_balls / total_balls prob_second_ball_blue = (total_blue_balls - 1) / (total_balls - 1) prob_both_blue = prob_first_ball_blue * prob_second_ball_blue result = prob_both_blue return result
A painter mixed 4 L of blue paint and 2 L of white paint to make a light blue paint. He then used 3 L of the light blue paint to paint a wall. What fraction of the light blue paint did he use?
def solve() -> int: light_blue_paint = 4 + 2 fraction_used = 3 / light_blue_paint result = fraction_used return result
There are 24 students in a class. If each student gets 4 pencils, how many pencils are needed in total?
def solve() -> int: num_students = 24 num_pencils_per_student = 4 total_pencils_needed = num_students * num_pencils_per_student result = total_pencils_needed return result
There are 12 cats in a house and each cat has 5 toys. How many toys are there in the house altogether?
def solve() -> int: number_of_cats = 12 toys_of_each_cat = 5 total_toys = number_of_cats * toys_of_each_cat result = total_toys return result
Student: - Ben is counting the stars that he can see in the sky. All the stars are either red, blue, or white. He sees 90 stars and 10 planets. A fifth of the stars are red, and another 60% are blue. If he picks one planet at random, what is the percentage chance it's either Mars or Venus, rounded to the nearest intege...
def solve() -> int: stars = 90 planets = 10 red_stars = stars * 0.2 blue_stars = stars * 0.6 mars_venus = 2 result = round((mars_venus / planets) * 100) return result
Emma bought 150 flowers for her garden. Unfortunately, only 30% of them were healthy. After removing 10 flowers that were too wilted, how many flowers does Emma have left?
def solve() -> int: total_flowers = 150 healthy_flowers = total_flowers * 0.3 remaining_flowers = healthy_flowers - 10 result = remaining_flowers return result
Rachel spends 7 hours gardening and 6 times as long on the rest of her hobbies. How long does she spend on hobbies in total?
def solve() -> int: hours_gardening = 7 hours_hobbies = 6 * hours_gardening total_hours = hours_gardening + hours_hobbies result = total_hours return result
2. Amy has six times more apples than oranges. She has 30 apples. How many oranges does she have?
def solve() -> int: apples = 30 oranges = apples/6 result = oranges return result
A car starts at 50 mph, and then travels for 3 hours. The driver takes a 30 minute rest, and then speeds up to 70 mph for the next 2 hours. What is the average speed of the car for the entire trip in mph?
def solve() -> int: distance1 = 50 * 3 distance2 = 70 * 2 total_distance = distance1 + distance2 total_time = (3 + 2.5) average_speed = total_distance / total_time result = average_speed return result
Matt has saved $800 to buy a new laptop that costs $1,200. He then receives a 20% discount on the laptop. How much does he have left in savings after he buys the laptop?
def solve() -> int: savings = 800 laptop_cost = 1200 discount = 0.2 discounted_price = laptop_cost * (1 - discount) spent = discounted_price left_in_savings = savings - spent result = left_in_savings return result
Mr. Lee bought four times as many pencils as Mr. Tan. If Mr. Tan bought 20 pencils, how many pencils did Mr. Lee buy?
def solve() -> int: tan_pencils = 20 lee_pencils = tan_pencils * 4 result = lee_pencils return result
Student: A library has 1000 books. If 325 of them are fiction and 250 of them are non-fiction, how many books are neither fiction nor non-fiction?
def solve() -> int: total_books = 1000 fiction_books = 325 non_fiction_books = 250 neither_books = total_books - fiction_books - non_fiction_books result = neither_books return result
Christian is setting up a home theater. He needsIn the bookstore, the bulk price of books is $15 per book and the minimum spend is $100 before tax. The books are taxed at $2 per book. If Tom has paid $350 for books, by how many books has Tom’s purchase exceeded the minimum spend?
def solve() -> int: bulk_price = 15 minimum_spend = 100 tax_per_book = 2 total_paid = 350 amount_spent_before_tax = (total_paid - minimum_spend) / (1 + tax_per_book/bulk_price) num_books = round(amount_spent_before_tax / bulk_price) num_books_exceeding_minimum = num_books - (m...
5 people can run 16 kilometers in 2 hours. If they increase their speed by 30% percent, how much could 2 people run in 4 hours?
def solve() -> int: people1 = 5 distance1 = 16 time1 = 2 speed1 = distance1 / (people1 * time1) speed2 = speed1 * 1.3 people2 = 2 time2 = 4 distance2 = people2 * speed2 * time2 result = distance2 return result
During a back-to-school sale, Joe's store bought extra school supplies to prepare for an increase in customers. If he bought 5967 backpacks, sold 2165 backpacks that day, and has 3500 backpacks left in his store, how many backpacks did he originally have before the sale?
def solve() -> int: backpacks_bought = 5967 backpacks_sold = 2165 backpacks_left = 3500 backpacks_original = backpacks_bought + backpacks_sold + backpacks_left result = backpacks_original return result
Emily is studying for her final exams. On the first day, she studies for 4 hours. On the second day, she studies three times the amount she did on the first day. On the third day, she studies for 2 hours less than she did on the second day. How many hours did Emily study over the 3 days?
def solve() -> int: first_day = 4 second_day = 3 * first_day third_day = second_day - 2 total_hours = first_day + second_day + third_day result = total_hours return result
Student: Sarah has 3 bags of candy, and each bag has 25 pieces of candy. How many pieces of candy does Sarah have in total?
def solve() -> int: bag_1 = 25 bag_2 = 25 bag_3 = 25 total_pieces = bag_1 + bag_2 + bag_3 result = total_pieces return result
Alexis, Mark and Tanya want to buy a $45 dinner for all of them. If Alexis pays $15, Mark pays $20 and Tanya pays $10, how much will the remaining balance to be paid?
def solve() -> int: dinner_cost = 45 alexis_payment = 15 mark_payment = 20 tanya_payment = 10 total_payment = alexis_payment + mark_payment + tanya_payment remaining_balance = dinner_cost - total_payment result = remaining_balance return result
am worked 35 hours last week. He spent 1/4 of his time on a biology report, 1/3 of his time on chemistry assignments, and the rest of his time on physics homework. How many hours did Sam spend on physics homework last week?
def solve() -> int: hours_worked = 35 bio = 1/4 * hours_worked chem = 1/3 * hours_worked physics = hours_worked - bio - chem result = physics return result
Nate wants to save $400 for twelve weeks. In the first week, he saved $10 and he plans to save an amount that is twice as much as the savings from the previous week. How much will he save in the twelfth week to reach his goal?
def solve() -> int: week = 1 savings = 10 while week < 12: savings *= 2 week += 1 result = savings return result
Brian had an equal number of socks and gloves. If he had 60 socks and gave 6 gloves and 4 socks to each of his six friends and kept the rest for himself, how many socks and gloves did he have left?
def solve() -> int: socks = 60 gloves = socks gloves_given = 6 * 4 socks_given = 6 * 6 gloves_left = gloves - gloves_given socks_left = socks - socks_given result = f'Socks left: {socks_left}, Gloves left: {gloves_left}' return result
Student: Jack has 25 apples and gave 3 of them to his sister. How many apples does Jack have left?
def solve() -> int: jack_apples = 25 sister_apples = 3 jack_apples_left = jack_apples - sister_apples result = jack_apples_left return result
Mia purchased 400 flowers for her sister's wedding. After realizing that 35% of them were damaged, she tossed those away. If she then distributed the good flowers equally, how many flowers did each table get?
def solve() -> int: total_flowers = 400 damaged_percent = 35 damaged_flowers = total_flowers * (damaged_percent / 100) good_flowers = total_flowers - damaged_flowers num_tables = 10 flowers_per_table = good_flowers / num_tables result = flowers_per_table ...
Ethan owns a delivery company and he needs to deliver 46 packages that weigh 11 lb each. If his truck can carry up to 780 lb, how many trips will Ethan need to make to deliver all of the packages?
def solve() -> int: total_weight = 46 * 11 capacity = 780 num_trips = int(total_weight / capacity) remaining_weight = total_weight % capacity if remaining_weight > 0: result = num_trips + 1 else: result = num_trips return result
A hardware store charges fifty dollars per tool rented by its customers. On June 1st, Mark rented four tools from the store. If he returned three tools on June 15th and kept one tool until the end of the month, calculate the total amount of money that he paid to rent the tools from the hardware store.
def solve() -> int: tool_price = 50 total_tools = 4 returned_tools = 3 remaining_tools = total_tools - returned_tools remaining_days = 30 - 15 total_cost = (returned_tools * tool_price) + (remaining_tools * tool_price * remaining_days) result = total_cost return result
Harry can lift a maximum of 200 pounds of weights in the gym. He wants to make sure to stay 35% under the limit. If he already lifted a total weight of 90 pounds, what is the maximum weight he can lift in one more go?
def solve() -> int: max_weight = 200 under_limit = 0.35 lifted_weight = 90 remaining_weight = max_weight - lifted_weight max_lift_weight = remaining_weight * (1 - under_limit) result = max_lift_weight return result
Q4: At a movie theater, a person paid $7.50 for a movie ticket. If the person wanted to buy 5 tickets, how much would they cost altogether?
def solve() -> int: num_tix = 5 pr_tix = 7.50 cost = num_tix * pr_tix result = cost return result
Ashley acquired 156 markers in her art class. She wanted to put them into 8 boxes. How many markers needed to be put in each box?
def solve() -> int: total = 156 boxes = 8 result = total//boxes return result
Peter can walk a distance of 100 meters in 1 minute. If he increases his pace by 40%, how much distance will he walk in 1 minute? If he walks a distance of 120 meters and decreases his pace by 20%, how long will he take?
def solve() -> int: pace = 100 increase = 40 distance = pace + (pace * increase / 100) result = distance distance = 120 decrease = 20 pace = distance / (1 - decrease / 100) result = pace return result
Emily's flower shop has 300 flowers left after yesterday's sales. Ten customers came in and bought 20 flowers each. How many flowers are left in Emily's shop?
def solve() -> int: flowers_left = 300 customers = 10 flowers_bought_per_customer = 20 total_flowers_bought = customers * flowers_bought_per_customer flowers_left -= total_flowers_bought result = flowers_left return result
A team has 15 players. If 60% of them are male, how many players are female?
def solve() -> int: total_players = 15 male_players = int(total_players * 60/100) female_players = total_players - male_players result = female_players return result
Alice can bake 12 cookies in the morning and 18 in the afternoon. This evening, she baked 4 cookies fewer than she did in the morning. If she gave some cookies to her friends and has only 10 left, what was her revenue if each cookie costs 75 cents?
def solve() -> int: morning_cookies = 12 afternoon_cookies = 18 evening_cookies = morning_cookies - 4 total_cookies = morning_cookies + afternoon_cookies + evening_cookies cookies_given = total_cookies - 10 revenue = cookies_given * 0.75 result = revenue return result
ara wants to buy a bike for her business. The bike cost $325 and Sara has $400 saved up. How much money does she have left after buying the bike?
def solve() -> int: money_left = 0 amount_saved = 400 cost_bike = 325 money_left = amount_saved - cost_bike result = money_left return result
Maria and her family order pizza. Large pizzas cost $16 and small pizzas cost $9. If Maria wants to give a 18% tip, how much will it be?
def solve() -> int: num_large_pizzas = 2 num_small_pizzas = 3 cost_large_pizza = 16 cost_small_pizza = 9 tip_percentage = 0.18 total_cost_pizzas = (num_large_pizzas * cost_large_pizza) + (num_small_pizzas * cost_small_pizza) tip_amount = total_cost_pizzas * tip_percentage total_cost...