question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Wes get 500 MB of cell phone data each month. He spends 5/7 of what she has on Facebook and the remaining 1/2 on Skype. How much data does he have left?
def solve() -> int: Initial_data = 500 Used_Data_Facebook = 5/7 Remaining_data_Skype = 1/2 Final_Remaining_Data = Initial_data - Used_Data_Facebook Final_Remaining_Data = Final_Remaining_Data - Remaining_data_Skype result = Final_Remaining_Data return result
John owes Emma $800, which is three times what Sarah owes Emma. John decides to pay 75% of his debt to Emma, and Sarah pays Emma 60% of her debt. If Emma had $400 in her savings account and adds the money she's been paid by her debtors to the savings account, calculate the total amount of money in her savings account n...
def solve() -> int: debt_john=800 debt_sarah=debt_john/3 paid_john=debt_john*0.75 paid_sarah=debt_sarah*0.60 savings_start=400 savings_end=savings_start+paid_john+paid_sarah result = savings_end return result
A company received 300 job applications. After reviewing them, they invited 20% of the candidates for an interview. How many candidates were invited for an interview?
def solve() -> int: num_applications = 300 percent_invited = 20 num_invited = num_applications * (percent_invited/100) result = num_invited return result
A recipe calls for 3/4 cups of sugar to make 24 cookies. How much sugar would you need to make 60 cookies?
def solve() -> int: cookies_needed = 60 cookies_in_recipe = 24 sugar_in_recipe = 3/4 sugar_per_cookie = sugar_in_recipe/cookies_in_recipe sugar_needed = sugar_per_cookie * cookies_needed result = sugar_needed return result
Olivia wants to finish a language learning series before the final session in 11 days. The series contains 4 sessions, with each session lasting 90 minutes. How many minutes per day does Olivia need to learn to finish the series before the final session? Madison has a fitness goal of running a total of 25 miles. For th...
def solve() -> int: total_sessions = 4 session_length = 90 total_time = total_sessions * session_length days_left = 11 minutes_per_day = total_time / days_left goal_distance = 25 current_distance = 1.5 distance_increase = 0.5 days = 1 while current_distance < goal_dista...
A fabric is sold at a price of $7.50 per meter. If the fabric costs $48.75 in total, how many meters were purchased?
def solve() -> int: meters_purchased = 48.75 / 7.50 result = meters_purchased return result
In a class, the ratio of boys to girls is 4:7. If there are a total of 165 students, and the boys get $2600 to share, how much money does each boy receive?
def solve() -> int: total_students = 165 boys_ratio = 4 girls_ratio = 7 boys_share = 2600 total_ratio = boys_ratio + girls_ratio boys_count = (boys_ratio / total_ratio) * total_students girls_count = (girls_ratio / total_ratio) * total_students money_per_boy = boys_share / boys...
A triangle has a base of 18cm and a height of 10cm. What is the area of the triangle?
def solve() -> int: base = 18 height = 10 area = 0.5 * base * height result = area return result
A store sells shirts for $20 each or two shirts for $35. You want to buy 5 shirts. What is the cheapest way to buy them?
def solve() -> int: num_shirts = 5 price_1 = 20*num_shirts price_2 = (num_shirts//2)*35 + (num_shirts%2)*20 cheapest_price = min(price_1, price_2) result = cheapest_price return result
Natalie is a waitress and earns $9.25 an hour. Last week she worked 42 hours and earned $78 in tips. How much did she earn last week in total?
def solve() -> int: hourly_rate = 9.25 hours_worked = 42 tips_earned = 78 total_earnings = (hourly_rate * hours_worked) + tips_earned result = total_earnings return result
A movie theater has 5 theaters, each with 100 seats. If an average ticket sells for $8, how much will the theater make if they sell out all 5 theaters?
def solve() -> int: theaters = 5 seats_per_theater = 100 ticket_price = 8 total_earnings = theaters * seats_per_theater * ticket_price result = total_earnings return result
The ratio of the angles in a triangle is 2:3:5. What is the size of the smallest angle?
def solve() -> int: ratio_sum = 2 + 3 + 5 angle_ratio = [2, 3, 5] smallest_angle_ratio = min(angle_ratio) total_angle = 180 smallest_angle = (smallest_angle_ratio/ratio_sum) * total_angle result = smallest_angle return result
Emma works as a babysitter for 3 hours on Monday and 4 hours on Wednesday. She charges $12 per hour on weekdays and $15 per hour on weekends. She works 5 hours on Saturday and 6 hours on Sunday. How much money does she earn in a week?
def solve() -> int: weekdays_money = (3 + 4) * 12 weekends_money = (5 + 6) * 15 total_money = weekdays_money + weekends_money result = total_money return result
If Josh's coach wants him to practice for an extra hour on Friday, how much total time would he spend practicing soccer?
def solve() -> int: soccer_practice_duration = 2 total_time_spent = (soccer_practice_duration * 2) + 1 result = total_time_spent return result
David has a specific amount of pencils in a container in the morning. Throughout the day, he adds 4 more pencils after losing 7. By nighttime, he has 34 pencils left. How many pencils were in the container in the morning?
def solve() -> int: total = 34 pencils_lost = 7 pencils_added = 4 initial_pencils = total - pencils_lost + pencils_added result = initial_pencils return result
A rectangular garden measures 15 meters by 30 meters. A 1-meter wide path is to be built around the garden. What is the area of the path?
def solve() -> int: area_of_garden = 15 * 30 area_of_garden_with_path = (15+2)*(30+2) area_of_path = area_of_garden_with_path - area_of_garden result = area_of_path return result
If you add 5 to a number and then multiply by 3, then that's 75 more than the original number. What's the original number?
def solve() -> int: num = 0 result = 0 num += 5 num *= 3 result = num - 75 return result
Tom has 9 Lego sets. He gives 3 of them to his friends and receives 2 new sets from his parents. Then he gives away 1 more set to his little brother. How many Lego sets does Tom have left now?
def solve() -> int: lego_sets = 9 friends_sets = 3 parents_sets = 2 brother_sets = 1 lego_sets -= friends_sets lego_sets += parents_sets lego_sets -= brother_sets result = lego_sets return result
Student: 2. Sonya had 240 pennies. She gave away 40% of them. How many pennies did she keep?
def solve() -> int: pennies = 240 percent = 40 pennies_gave = percent * pennies / 100 pennies_kept = pennies - pennies_gave result = pennies_kept return result
Felix drives 100 miles daily. His vehicle gets 23 miles per gallon. If gas costs $2.50 a gallon, how much will he spend on gas monthly?
def solve() -> int: miles_daily = 100 mpg = 23 gas_price = 2.5 gallons_daily = miles_daily / mpg monthly_gas_cost = gallons_daily * gas_price * 30 result = round(monthly_gas_cost, 2) return result
A father is three times as old as his son. After eight years, he will be twice as old as his son. What is the current age of father?
def solve() -> int: current_age_sum = 4 father_age_ratio = 3 son_age_ratio = 1 after_years = 8 future_age_sum = 2*current_age_sum + 2*after_years father_future_age_ratio = 2 son_future_age_ratio = 1 father_current_age_ratio = father_future_age_ratio - after_years/current_age_sum cur...
Student: Aiden is saving money for a new bike. He earns $5 for each hour he works at his neighbor's house. He also gets $10 for each week he does his chores at home. He has already saved $120. The bike costs $300. How many more hours does he need to work at his neighbor's house to buy the bike?
def solve() -> int: hours_worked = 0 chores_done = 0 money_saved = 120 cost_of_bike = 300 hours_needed = (cost_of_bike - money_saved) / 5 result = hours_needed return result
Lily has collected 120 stamps in her album. She wants to arrange them in rows of equal length. If she can fit 8 stamps in one row, how many rows, in number, will she need?
def solve() -> int: total_stamps = 120 stamps_per_row = 8 rows_needed = total_stamps // stamps_per_row result = rows_needed return result
At the Sunny School, there are 1654 students, 78 teachers, and 12 staff members. How many more students are there than teachers and staff members together?
def solve() -> int: students = 1654 teachers = 78 staff = 12 teachers_and_staff = teachers + staff difference = students - teachers_and_staff result = difference return result
Brianne works at a restaurant and earns $10 per hour. Last week, she worked 35 hours. How much did she earn last week?
def solve() -> int: hourly_wage = 10 hours_worked = 35 earnings = hourly_wage * hours_worked result = earnings return result
A group of six students share a rental car equally for a weekend road trip. If the car rental costs $330 and one student pays $60, how much does each student pay for the rental car?
def solve() -> int: car_rental_cost = 330 one_student_payment = 60 number_of_students = 6 total_payment = number_of_students * one_student_payment each_student_payment = car_rental_cost / number_of_students result = each_student_payment return result
If 11 books cost $77, how much would 7 books cost?
def solve() -> int: books = 11 cost = 77 books_buy = 7 result = cost * (books_buy / books) return result
Student: 6. John is buying a new sofa. He finds one for $1,000 and pays $600 upfront. He wants to finance the rest and decides to take out a loan, but it requires him to pay 10% of the loan upfront. How much does he have to pay upfront?
def solve() -> int: sofa_price = 1000 upfront_payment = 600 loan_rate = 0.1 loan_amount = sofa_price - upfront_payment loan_upfront_payment = loan_rate * loan_amount total_upfront_payment = upfront_payment + loan_upfront_payment result = total_upfront_payment return result
A classroom has 25 students. The teacher gave a test and the average score was 80. If 5 students scored 100, and the rest scored 75, what was the total score of the class?
def solve() -> int: total_students = 25 average_score = 80 top_students = 5 top_score = 100 rest_score = 75 total_top_score = top_students * top_score total_rest_score = (total_students - top_students) * rest_score total_score = total_top_score + total_rest_score result = total_score...
Leo reads 6 25-page chapters of a book and 3 10-page articles of a magazine. How many pages does he read in total?
def solve() -> int: chapters_pages = 6 * 25 articles_pages = 3 * 10 result = chapters_pages + articles_pages return result
Mason and Owen share a jar of 60 gumballs. However, Mason has 5 more gumballs than Owen. How many gumballs does Owen have?
def solve() -> int: total_gumballs = 60 x = (total_gumballs - 5) / 2 x = int(x) result = x return result
Mark spends 3/4 as much time collecting wood for a fire as he does collecting cooking supplies. He spends 2 1/2 hours collecting leaves for the fire. How many hours has he spent collecting cooking supplies?
def solve() -> int: time_wood = 2.5 time_cooking = 0 time_cooking = time_wood * 4/3 result = time_cooking return result
A company has 120 employees, of which 30% are part-time. How many full-time employees does the company have?
def solve() -> int: total_employees = 120 part_time_percentage = 0.3 part_time_employees = total_employees * part_time_percentage full_time_employees = total_employees - part_time_employees result = full_time_employees return result
A room is 3 meters by 4 meters by 3 meters. A construction company wants to break down the room into 120 cubic cm bricks. How many bricks can be made?
def solve() -> int: length = 3 width = 4 height = 3 brick_volume = 120 room_volume = length * 100 * width * 100 * height * 100 num_bricks = room_volume / brick_volume result = int(num_bricks) return result
A store has a sale of 15% off of the original price of an item. If the original price is $100, what is the sale price?
def solve() -> int: discount_percentage = 15 / 100 discount_amount = discount_percentage * 100 sale_price = 100 - discount_amount result = sale_price return result
Mia has some coins. She has 6 more nickels than quarters and 2 less dimes than nickels. If she has 4 quarters, how much money does she have?
def solve() -> int: nickels = 4 + 6 dimes = nickels - 2 pennies = 0 penny_value = pennies * 1 nickel_value = nickels * 5 dime_value = dimes * 10 quarter_value = 4 * 25 total_value = penny_value + nickel_value + dime_value + quarter_value result = total_value / 100 ...
Possible questions and programs are: Benjamin has $7 in his pocket and wants to buy some candies. Each candy costs $0.5 and he gets a discount of $1 for every 10 candies he buys. How many candies can he buy with his money?
def solve() -> int: money = 7 cost = 0.5 discount = 1 candies = 0 while money >= cost: candies += 1 money -= cost if candies % 10 == 0: money += discount result = candies return result
If a rectangle has a width of 5 cm and a length of 12 cm, what is its perimeter?
def solve() -> int: width = 5 length = 12 perimeter = 2*width + 2*length result = perimeter return result
A construction company can lay 20 yards of concrete per hour or build 15ft of walls in the same amount of time. How long would it take the company to lay 100 yards of concrete and build 120ft of walls?
def solve() -> int: concrete_laid_per_hour = 20 walls_built_per_hour = 15 concrete_needed = 100 walls_needed = 120 hours_for_concrete = concrete_needed / concrete_laid_per_hour hours_for_walls = walls_needed / walls_built_per_hour total_hours = hours_for_concrete + hours_for_walls ...
Dikembe is baking cookies for a party and needs 4 cups of flour to make 24 cookies. He wants to make enough batter to make 60 cookies. How many cups of flour does he need?
def solve() -> int: cookies = 60 cookies_per_flour = 24 flour_per_cookies = 4/24 total_flour = cookies * flour_per_cookies result = total_flour return result
At the bakery, every day, there are 150 muffins made for sale. Each muffin costs $2. The bakery is open from 8:00 a.m. to 4:00 p.m. In the first hour, 25 muffins are sold. In the second hour, 20% more muffins are sold than in the first hour. In the third hour, 10% fewer muffins are sold than in the second hour. In the ...
def solve() -> int: muffins = 150 muffins_sold_1 = 25 muffins_sold_2 = muffins_sold_1 * (1 + 0.2) muffins_sold_3 = muffins_sold_2 * (1 - 0.1) muffins_sold_4 = muffins_sold_3 muffins_sold_5 = muffins_sold_4 - 5 muffins_sold_6 = muffins_sold_5 - 5 muffins_sold_7 = muffins_sold_6 - 5 mu...
Student: Sam has $50 in his piggy bank. He gets an allowance of $7 every two weeks. If Sam puts 1/4 of his allowance into his piggy bank every two weeks, how much money will he have in his piggy bank after 8 weeks?
def solve() -> int: sam_money = 50 allowance = 7 fraction = 1/4 weeks = 8 times = weeks // 2 total_allowance = allowance * fraction * times result = sam_money + total_allowance return result
Harper donated 20 books to the local library. His neighbor, Jackson, donated 7 fewer books. How many books did they donate in total?
def solve() -> int: harper_books = 20 jackson_books = harper_books - 7 total_books = harper_books + jackson_books result = total_books return result
In an MLB game, a player gets a total of 40 hits and misses. There are four times as many hits as misses. How many hits and misses are there?
def solve() -> int: hits =0 misses = 0 total_hits_and_misses = 40 hits = total_hits_and_misses *3/4 misses = total_hits_and_misses / 4 result = [hits, misses] return result
Sally has a 15% discount coupon and wants to buy a shirt that costs $25. What is the final cost of the shirt after applying the discount?
def solve() -> int: original_price = 25 discount_rate = 0.15 final_price = original_price * (1 - discount_rate) result = round(final_price, 2) return result
A car travels 280 miles in 4 hours. At the same rate, how long will it take the car to travel 350 miles?
def solve() -> int: distance1 = 280 time1 = 4 rate = distance1 / time1 distance2 = 350 time2 = distance2 / rate result = time2 return result
Diana can knit a sweater in 6 hours while Brian can knit the same sweater in 8 hours. If they have to knit 3 sweaters, how many hours ahead will Diana finish completing the sweaters than Brian?
def solve() -> int: diana_hours = 6 brian_hours = 8 sweaters = 3 diana_total_hours = diana_hours * sweaters brian_total_hours = brian_hours * sweaters hours_ahead = brian_total_hours - diana_total_hours result = abs(hours_ahead) return result
A store bought 100 books for $2000. The storekeeper decided to sell each book at a profit of $5. Calculate the total amount she would get if she sold all the books.
def solve() -> int: number_of_books = 100 total_cost = 2000 profit_per_book = 5 selling_price_per_book = (total_cost/number_of_books) + profit_per_book total_revenue = selling_price_per_book * number_of_books result = total_revenue return result
A box contains 8 red balls and 4 blue balls. Two balls are randomly drawn from the box without replacement. What is the probability that both balls are red?
def solve() -> int: total_balls = 12 red_balls = 8 prob_first_red = red_balls/total_balls prob_second_red = (red_balls-1)/(total_balls-1) prob_both_red = prob_first_red * prob_second_red result = prob_both_red return result
Oliver is packing boxes. It takes 15 books and 6 toys to fill one box. Each of his 12 teammates can pack 30 items per hour and will work for 4 hours today. How many boxes can Oliver fill with the items gathered today, provided that he has twice as many books as toys?
def solve() -> int: books = 15 toys = books / 2 items_per_box = books + toys teammates = 12 items_per_hour = 30 hours_worked = 4 total_items = teammates * items_per_hour * hours_worked boxes_filled = total_items // items_per_box result = boxes_filled return result
Gina the giraffe has 21 leaves. The other giraffe, Gary has 9 less than three times the amount of leaves as Gina. The final giraffe, Grace has two more than half the amount of leaves as Gary. How many leaves are there?
def solve() -> int: gina = 21 gary = 3 * gina - 9 grace = gary // 2 + 2 result = gina + gary + grace return result
Q6: If it takes 25 quarters to buy two packs of juice, then how many quarters are needed to buy 8 packs of juice?
def solve() -> int: quar_per_juice = 25/2 quarters = 8 * quar_per_juice result = quarters return result
Alan is making iced tea. His recipe calls for 2 lemons per bottle, and Alan has 3 bottles. How many lemons does Alan need for all his bottles?
def solve() -> int: num_bottles = 3 lemons_per_bottle = 2 total_lemons = num_bottles * lemons_per_bottle result = total_lemons return result
Lisa has three friends who share their books with her. She started with 12 books. Her first friend had 6 more books than Lisa. Her second friend had half as many books as Lisa. Her third friend had the same number of books as Lisa. They all decided to exchange books equally, so that each of them would have the same num...
def solve() -> int: books = 12 first = books + 6 total = books + first second = books // 2 total = total + second third = books total = total + third share = total // 4 result = share return result
Ryan decided to buy a new bicycle that costs $300. He sold his old bicycle for $150 which was a 25% reduction from its original cost. How much money did he have to pay from his pocket to get the new bicycle?
def solve() -> int: old_bicycle_cost = 150 / (1 - 0.25) money_paid = 300 - old_bicycle_cost result = money_paid return result
If the perimeter of a rectangle is 30cm and its length is twice its width. What is the area of the rectangle?
def solve() -> int: width = 30 / (2 + 2 * 2) length = 2 * width area = width * length result = area return result
A math book has 340 pages. If a student reads 20 pages per day, how many days will it take to finish the book?
def solve() -> int: days_to_finish = 340 / 20 result = days_to_finish return result
Student: A store sells a jacket for one price and makes a total profit of 25%. If the cost of the jacket is $80, what is the selling price?
def solve() -> int: cost = 80 profit_percentage = 25 total_profit = cost * (profit_percentage/100) selling_price = cost + total_profit result = selling_price return result
A store sells three types of pizzas—large, medium, and small. The prices for each pizza are $15 for large, $10 for medium, and $8 for small. Paula asked her friends to buy her a total of 600 grams of pizza. She wanted twice as much large pizza as medium pizza and one-third less small pizza than large pizza. How much wi...
def solve() -> int: l = 15 m = 10 s = 8 L = 600 * (2/3) M = 600 * (1/3) S = 600 * (1/6) result = (L*l) + (M*m) + (S*s) return result
A fruit basket contains 3 apples, 4 oranges, and 2 bananas. If one fruit is selected at random, what is the probability that it is an orange?
def solve() -> int: total_fruits = 3 + 4 + 2 orange_fruits = 4 probability = orange_fruits/total_fruits result = probability return result
Jenna has been filling up her car with 16 gallons of gas every week for the past 4 years. If gas costs $3.50 per gallon, how much has Jenna spent on gas?
def solve() -> int: gallons_per_week = 16 weeks_per_year = 52 years = 4 cost_per_gallon = 3.50 total_gallons = gallons_per_week * weeks_per_year * years total_cost = total_gallons * cost_per_gallon result = total_cost return result
Jennifer has a rectangular garden which is 4m by 9m. She wants to divide her garden into 3 equal parts using 2 parallel fences. How much fence will she need to buy?
def solve() -> int: width = 4 length = 9 width_fence = width / 3 length_fence = length total_fence_length = (2 * width_fence) + (2 * length_fence) result = total_fence_length return result
A group of six people played games for 7 hours, then they went out for coffee. Vicky spends one-fourth as much money on coffee as Mark. Mark and Lila drink coffee of the same price. If Lila had coffee worth $18, what is the cost of coffee for all six?
def solve() -> int: hours_played = 7 vicky_coffee = 0 mark_coffee = 0 lila_coffee = 18 mark_coffee = lila_coffee vicky_coffee = mark_coffee / 4 total_coffee_cost = (vicky_coffee + mark_coffee + lila_coffee) * 6 result = total_coffee_cost return result
A concert hall has two types of tickets - VIP tickets for $100 and Regular tickets for $45. If 20 VIP tickets and 55 regular tickets are sold, how much money will the concert hall earn from ticket sales?
def solve() -> int: VIP_cost = 100 reg_cost = 45 VIP_qty = 20 reg_qty = 55 total_sales = (VIP_qty * VIP_cost) + (reg_qty * reg_cost) result = total_sales return result
A factory has 15 machines that can produce 100 units of product each hour. The factory operates for 8 hours each day. How many units of product can the factory produce each day?
def solve() -> int: num_machines = 15 units_per_hour = 100 hours_per_day = 8 total_units_per_day = num_machines * units_per_hour * hours_per_day result = total_units_per_day return result
An amusement park ride costs $8. A day pass costs $60. What's the minimum number of amusement park rides you will need to take every day so that the day pass is strictly cheaper per ride?
def solve() -> int: ride_cost = 8 day_pass_cost = 60 rides_per_day = 1 total_cost_per_ride = day_pass_cost / rides_per_day while total_cost_per_ride >= ride_cost: rides_per_day += 1 total_cost_per_ride = day_pass_cost / rides_per_day result = rides_per_day retu...
A bottle of soda holds 1.5 liters. If James drinks 350 ml and Tim drinks 450 ml, how much is left in the bottle?
def solve() -> int: soda_volume = 1.5 james_drinks = 0.35 tim_drinks = 0.45 soda_left = soda_volume - james_drinks - tim_drinks result = soda_left return result
A barber shop charges $3 for a haircut and $2 for a shave. Henry spent $17 at the barber shop. How many haircuts and shaves did Henry get?
def solve() -> int: price_haircut = 3 price_shave = 2 paid_total = 17 max_num_haircuts = paid_total // price_haircut remaining_balance = paid_total - (max_num_haircuts * price_haircut) num_shaves = remaining_balance // price_shave result = (max_num_haircuts, num_shaves) ...
Jack is 5 years older than Mia. If Jack is currently 18, how old is Mia today?
def solve() -> int: a = 18 b = a - 5 result = b return result
David is buying video games. He pays $25 for each of the first 6 games and gets a discount of $4 for every game over 6. If he buys 10 video games, how much does he pay?
def solve() -> int: games = 10 price_per_game = 25 discount_per_game = 4 if games <= 6: total_cost = games * price_per_game else: total_cost = (6 * price_per_game) + ((games - 6) * (price_per_game - discount_per_game)) result = total_cost return result
Jessica has 40 books. She wants to divide them into groups of three. How many groups of three books can she create?
def solve() -> int: no_of_books = 40 books_per_group = 3 groups = no_of_books // books_per_group result = groups return result
Anthony takes 4 pills a day, and each pill costs $2.5. If his insurance provider covers 50% of the cost, how much does he need to pay in a week?
def solve() -> int: pills_per_day = 4 cost_per_pill = 2.5 insurance_coverage = 0.5 pills_per_week = pills_per_day * 7 total_cost_per_week = pills_per_week * cost_per_pill insurance_payment = total_cost_per_week * insurance_coverage amount_to_pay = total_cost_per_week - insurance_payment...
A shopping mall has 4 floors, and each floor is 1000 square meters. However, on the top floor, there is an open-air cafe that occupies 200 square meters. If the mall decides to build a roof for the cafe, how much extra material and money does the mall need to spend?
def solve() -> int: floor_area = 1000 cafe_area = 200 roof_area = cafe_area total_area = floor_area * 4 new_total_area = total_area - cafe_area + roof_area extra_material = roof_area extra_money = extra_material * 50 result = extra_material + extra_money return re...
Student: The area of a triangle is 48 square units and the base of the triangle is 12 units. What is the height of the triangle?
def solve() -> int: area = 48 base = 12 height = area / base result = height return result
Student: Jackson started with 10 pieces of fruit. He ate twice as many as he had at first. How many pieces of fruit did he eat?
def solve() -> int: initial_fruit = 10 ate_fruit = initial_fruit * 2 result = ate_fruit return result
Lisa is baking cookies for a fundraiser. She can make 24 cookies with one batch of dough. The ingredients for one batch of dough cost $6 and she sells each cookie for $0.5. How much profit will she make if she bakes and sells 10 batches of cookies?
def solve() -> int: cookies = 10 * 24 revenue = cookies * 0.5 cost = 10 * 6 profit = revenue - cost result = profit return result
Katie walks up a steep concrete hill that is 200 yards long. Each yard she travels equals 2 steps. If she climbs for 150 yards, how many steps will she have taken?
def solve() -> int: yards_per_step = 2 hill_length = 200 distance_climbed = 150 steps_taken = distance_climbed * yards_per_step result = steps_taken return result
A grocery store has 10 aisles, and each aisle has five sections. If each section has three shelves, how many shelves are there in the grocery store?
def solve() -> int: aisles = 10 sections_per_aisle = 5 shelves_per_section = 3 total_shelves = aisles * sections_per_aisle * shelves_per_section result = total_shelves return result
The CN Tower in Toronto is 1,815 feet tall with 147 floors. If each of the first 146 floors have height equal to 12 feet, how high is the 147th floor?
def solve() -> int: height_of_tower = 1815 number_of_floors = 147 height_of_first_146_floors = 146 * 12 height_of_147th_floor = height_of_tower - height_of_first_146_floors result = height_of_147th_floor return result
To make cookies for his friends and family, Zak bought 420 bags of sugar and 420 bags of flour. If he distributed 60 bags of sugar and flour to each of his 7 friends, how many bags did Zak keep for himself?
def solve() -> int: num_sugar_bought = 420 num_flour_bought = 420 num_sugar_given = 60 num_flour_given = 60 num_friends = 7 total_sugar_given = num_sugar_given * num_friends total_flour_given = num_flour_given * num_friends num_bags_kept = (num_sugar_bought + num_flour_bought) - (to...
Jacob has 5 pieces of candy. One piece of candy has 4 grams of sugar and another has 6 more grams of sugar than the first. The two remaining pieces of candy have a total of 12 grams of sugar. How many grams of sugar are in all of Jacob's candy?
def solve() -> int: candy1 = 4 candy2 = candy1 + 6 candy3 = 12 - candy1 - candy2 total_sugar = candy1 + candy2 + candy3 result = total_sugar return result
A cylindrical tank contains 1000 liters of water. If the radius of the tank is 2 meters, what is the height of the tank?
def solve() -> int: volume = 1000 radius = 2 height = volume / (3.14 * radius**2) result = height return result
Ava, Aiden and Adam have 640 candies total. Ava has 3 times as many candies as Aiden, and Aiden has double the number of candies that Adam has. How many candies does Ava have?
def solve() -> int: aiden_candies = 640 / (1 + 1 + 3) ava_candies = 3 * aiden_candies result = ava_candies return result
The sum of two numbers is 20 and their difference is 6. What are the two numbers?
def solve() -> int: sum_of_numbers = 20 difference_of_numbers = 6 x = (sum_of_numbers + difference_of_numbers) / 2 y = (sum_of_numbers - difference_of_numbers) / 2 result = x, y return result
Student: 6. The apple tree has 32 apples at the start. 33 apples were harvested the next day. How many apples were harvested in total?
def solve() -> int: start_apples = 32 harvested_apples = 33 total_apples = start_apples + harvested_apples result = total_apples return result
A pizza place charges $10 for a large pizza with unlimited toppings. A customer orders a large pizza with 3 toppings, and each additional topping costs $1.50 extra. If there is a 8% sales tax, how much does the customer have to pay in total?
def solve() -> int: pizza_cost = 10 + (3 * 1.5) subtotal = pizza_cost for i in range(7): subtotal += 1.5 tax = subtotal * 0.08 total_cost = subtotal + tax result = total_cost return result
Student: How many bananas can Joe buy if he has $30 and banana costs 50 cents each?
def solve() -> int: money = 30 price = 0.5 num_bananas = money // price remaining_money = money % price result = num_bananas return result
Student: If an airplane travels at 400 miles per hour for 2.5 hours with a headwind of 50 miles per hour, how far does it travel?
def solve() -> int: speed = 400 time = 2.5 headwind = 50 distance = speed * time - headwind * time result = distance return result
Student: Mya bought 5 plants in the first week, 7 plants in the second week, and 11 plants in the third week. If Mya's goal is to buy 30 plants, how many more should she buy?
def solve() -> int: plants_bought_week1 = 5 plants_bought_week2 = 7 plants_bought_week3 = 11 total_plants_bought = plants_bought_week1 + plants_bought_week2 + plants_bought_week3 plants_left_to_buy = 30 - total_plants_bought result = plants_left_to_buy return result
Lisa needs to transport 180 pineapples to the farmer's market. She is taking her truck which can hold 15 pineapples per box. She drives to the market and is able to fit 12 boxes in the truck. How many pineapples are left over?
def solve() -> int: Number_of_boxes_in_truck = 12 Pineapples_per_box = 15 Total_pineapples = 180 Total_boxes = Total_pineapples / Pineapples_per_box result = Total_pineapples - Total_boxes * Pineapples_per_box return result
David buys 1000 books for $4000. The cost of shipping and distribution is 20% more than that. If each book is priced at $10, how much profit did he make?
def solve() -> int: books = 1000 book_cost = 4000 / books shipping_cost = book_cost * 1.2 total_cost = book_cost + shipping_cost selling_price = 10 profit_per_book = selling_price - total_cost total_profit = profit_per_book * books result = total_profit return result
Ben has 3 times as many toys as Jim, who has 10 toys. If Sarah has half as many toys as Ben, how many toys does she have?
def solve() -> int: jim = 10 ben = jim * 3 sarah = ben / 2 result = sarah return result
Jen collects stamps and has already accumulated 32 stamps from various countries. She visits a stamp store that day and buys 23 more stamps. How many stamps does Jen have in total?
def solve() -> int: start = 32 bought = 23 total = start + bought result = total return result
Brandon’s kite string is 80 meters long; it is 20 times as long as Samantha’s kite string. Together, what is the total length of the kite strings?
def solve() -> int: samantha_kite_string = 80 / 20 total_length = samantha_kite_string + 80 result = total_length return result
A box has 50 chocolates. If Jake eats 8 of them and Olivia eats 15 of them, how many are left?
def solve() -> int: chocolates = 50 chocolates -= 8 chocolates -= 15 result = chocolates return result
Qime works at the store and gets paid $7/hour. He works for 4 hours each day and each week he works for 5 days. How much does Qime make in total for one week?
def solve() -> int: hourly_rate = 7 hours_per_day = 4 days_per_week = 5 weekly_pay = hourly_rate * hours_per_day * days_per_week result = weekly_pay return result
``` A bag contains 20 red marbles and 30 blue marbles. What percent of marbles are red?
def solve() -> int: total_marbles = 20+30 percent_red = (20/total_marbles)*100 result = percent_red return result
John has 28 cherries. He eats half of them and puts the other half in a bottle. He then shares the cherries in the bottle among his 3 friends equally. How many cherries does John have left?
def solve() -> int: cherries_left = 28 cherries_left = cherries_left / 2 cherries_left = cherries_left - (cherries_left / 3) result = cherries_left return result
Calvin sells bananas for $1.50 each and mangos for $2 each. He sold 40 bananas and 30 mangos in the morning and 45 bananas and 35 mangos in the afternoon. How much did he earn in the day?
def solve() -> int: banana_sales_morning = 40 * 1.5 mango_sales_morning = 30 * 2 banana_sales_afternoon = 45 * 1.5 mango_sales_afternoon = 35 * 2 total_sales = banana_sales_morning + mango_sales_morning + banana_sales_afternoon + mango_sales_afternoon result = total_sales return result...
Student: A restaurant has a total revenue of $450 from 30 customers. If each customer spends the same amount, how much does each customer spend on average?
def solve() -> int: total_revenue = 450 num_customers = 30 result = total_revenue / num_customers return result