question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
John has some apples. He gives 3 apples to his sister and 4 apples to his brother. If he had 12 apples in the beginning, how many apples are left with him?
def solve() -> int: apples = 12 apples_given = 3 + 4 apples_left = apples - apples_given result = apples_left return result
If Sarah types 12 words a minute and takes a 3-minute break every 20 minutes, how many minutes will it take her to type 196 words?
def solve() -> int: words_per_minute = 12 break_duration = 3 break_frequency = 20 total_words = 196 typing_time = total_words / words_per_minute number_of_breaks = typing_time // break_frequency total_break_time = number_of_breaks * break_duration total_time = typing_time + tot...
Jerry wants to go on a road trip. If his car can travel 550 miles on a full tank, and the tank holds 14 gallons, how many miles per gallon can his car travel?
def solve() -> int: total_miles = 550 capacity = 14 miles_per_gallon = total_miles / capacity result = miles_per_gallon return result
Jason bought 100 shares of a stock for $10 each. He sold 50 shares for $8 each and the remaining 50 shares for $12 each. What was his overall profit or loss on the transaction?
def solve() -> int: shares_bought = 100 buy_price = 10 shares_sold_1 = 50 sell_price_1 = 8 shares_sold_2 = 50 sell_price_2 = 12 total_cost = shares_bought * buy_price total_revenue = (shares_sold_1 * sell_price_1) + (shares_sold_2 * sell_price_2) profit_or_loss = total_reve...
A kite can fly with a maximum weight of 0.5 pounds, while a hawk can carry four times the maximum weight of a kite. If there are 200 birds in a park, with one-third being kites and the rest being hawks, what is the maximum total weight they can carry?
def solve() -> int: max_weight_kite = 0.5 max_weight_hawk = 4 * max_weight_kite total_birds = 200 kites = total_birds / 3 hawks = total_birds - kites max_weight_kites = kites * max_weight_kite max_weight_hawks = hawks * max_weight_hawk max_total_weight = max_weight_kites + max_...
Mark wants to buy a new coffee maker. If the coffee maker he wants is $60, but he has a $10 off coupon, plus a 6% sales tax, how much will he end up paying?
def solve() -> int: coffee_maker_price = 60 coupon_amount = 10 tax_rate = 0.06 coffee_maker_price_after_coupon = coffee_maker_price - coupon_amount tax_amount = coffee_maker_price_after_coupon * tax_rate total_price = coffee_maker_price_after_coupon + tax_amount result = total_price ret...
ome possible new questions are: Laura runs a bakery. She makes a cake for $12. Each slice costs $0.5 to cut and package. She sells each slice for $2. She sells 100 slices a day for 6 days a week. How much profit does she make in 10 weeks?
def solve() -> int: cost_per_cake = 12 + 0.5 * 8 total_cost = cost_per_cake * 100 * 6 * 10 revenue_per_slice = 2 total_revenue = revenue_per_slice * 8 * 100 * 6 * 10 profit = total_revenue - total_cost result = profit return result
Lori has twice as many cats as Mia. Mia has three times as many cats as Lucy. If Lucy has 5 cats, how many cats do they have in total?
def solve() -> int: lucy_cats = 5 mia_cats = 3 * lucy_cats lori_cats = 2 * mia_cats total_cats = lucy_cats + mia_cats + lori_cats result = total_cats return result
If 6 workers can finish a job in 8 days, how many days will it take 8 workers to finish the same job?
def solve() -> int: rate_of_one_worker = 6/8 time_for_8_workers = 6/(8*rate_of_one_worker) result = time_for_8_workers return result
Kim has a jar of candy that contains 120 pieces. She knows that 25% of the candy is chocolate, 40% is gummy, and the rest is hard candy. How many pieces of hard candy are in the jar?
def solve() -> int: chocolate = 0.25 * 120 gummy = 0.40 * 120 hard = 120 - chocolate - gummy result = hard return result
The average monthly salary of a delivery person is $1200, the average monthly salary of a customer service representative is two times more than the delivery person and the average monthly salary of a manager is $5000. What is the average monthly salary of all the employees?
def solve() -> int: delivery_person_salary = 1200 customer_service_salary = 2 * delivery_person_salary manager_salary = 5000 total_salary = delivery_person_salary + customer_service_salary + manager_salary average_salary = total_salary / 3 result = average_salary return result...
Jake placed 5 logs that each had a length of 3 ft in a firepit. How many feet of logs did he put in the firepit?
def solve() -> int: logs = 5 length = 3 feet = logs * length result = feet return result
The ratio of boys to girls in a class is 3:5. If there are 24 boys in the class, how many girls are there?
def solve() -> int: num_boys = 24 boy_to_girl_ratio = 3 / 5 num_girls = num_boys / boy_to_girl_ratio - num_boys result = num_girls return result
A store has a 20% sale on all items. If a shirt originally costs $45, what is the price of the shirt after the discount?
def solve() -> int: original_price = 45 discount_percent = 20 discount_amount = (original_price*discount_percent)/100 final_price = original_price - discount_amount result = final_price return result
Student: John's current house is 540 sq ft. He plans to add a garage of the same size as his house as well as a larger bedroom which is two times the size of his current bedroom. What will be the new size of John's house in sq ft?
def solve() -> int: house_size = 540 garage_size = house_size bedroom_size = house_size * 2 new_house_size = house_size + garage_size + bedroom_size result = new_house_size return result
In a parking lot, the number of red cars is 1/4 of the total number of cars. If there are 30 blue cars and the parking lot has 120 cars, how many red cars are there?
def solve() -> int: total_cars = 120 blue_cars = 30 red_cars = total_cars / 4 - blue_cars result = red_cars return result
Janice opened a savings account and deposited $10,000. The account earns 3% interest compounded annually. She plans to continue adding $1,000 at the end of each year for the next 5 years. How much will she have in her account at the end of the fifth year?
def solve() -> int: principal = 10000 rate = 0.03 years = 5 compounded = 1 annual_deposit = 1000 balance = principal * (1 + rate / compounded)**(years*compounded) balance += annual_deposit * ((1 + rate / compounded)**(years*compounded) - 1) / (rate / compounded) result = balance ret...
Yesterday, Jane spent 2/3 of her money on herself, and she gave 1/4 of the remaining amount to her sister. If Jane has $128 left in her wallet, how much money did she have initially?
def solve() -> int: remaining_money = 128 money_given_to_sister = remaining_money / 4 initial_money = (remaining_money + money_given_to_sister) * 3 / 2 result = initial_money return result
A technology store sells 20 headphones for $50 each and 12 laptops for $800 each. How much revenue do they generate if they sell out all items? Registration cost for each item is $30.
def solve() -> int: headphone_price = 50 total_headphones = 20 laptop_price = 800 total_laptops = 12 registration_cost = 30 total_headphone_price = total_headphones * headphone_price total_laptop_price = total_laptops * laptop_price total_cost = (total_headphones + total_laptops) * ...
Student: A bottle containing a certain amount of liquid originally had a mass of 50 g. After the liquid is poured out and the bottle is allowed to dry, it has a mass of 20 g. If the density of the liquid is 1.2 g/mL, what's volume of the liquid that was originally in the bottle?
def solve() -> int: mass_of_bottle_and_liquid = 50 mass_of_empty_bottle = 20 density_of_liquid = 1.2 mass_of_liquid = mass_of_bottle_and_liquid - mass_of_empty_bottle volume_of_liquid = mass_of_liquid / density_of_liquid result = volume_of_liquid return result
Student: A rectangular field is 40 meters long and 20 meters wide. What is the perimeter of the field?
def solve() -> int: length = 40 width = 20 perimeter = 2 * (length + width) result = perimeter return result
A train covers a distance of 150 km in 2 hours and 15 minutes. What is its average speed in kilometers per hour?
def solve() -> int: average_speed = 150 / 2.25 result = round(average_speed, 2) return result
Student: Bruno sells handmade bracelets for $8.00 each. He spends $2.00 on materials and $1.00 on packaging for each bracelet. He sells an average of 25 bracelets per week. How much profit does Bruno make per week?
def solve() -> int: price_bracelet = 8.00 cost_materials = 2.00 cost_packaging = 1.00 num_bracelets = 25 total_cost = (cost_materials + cost_packaging) * num_bracelets total_revenue = price_bracelet * num_bracelets profit = total_revenue - total_cost result = profit return result
A car can travel 300 miles on a full tank of gas. If a gallon of gas costs $2.50 and the car has a 15-gallon tank, calculate the cost of gas to travel a distance of 900 miles.
def solve() -> int: distance = 900 tank_size = 15 mileage_per_tank = 300 price_per_gallon = 2.50 total_gallons_required = distance // mileage_per_tank * tank_size total_cost = total_gallons_required * price_per_gallon result = total_cost return result
A lawn is in the shape of a square. It covers an area of 121 square meters. What is the length of each side of the lawn?
def solve() -> int: area = 121 side_length = area ** 0.5 result = side_length return result
John scored 78, 82, 84 and 86 in his English exams out of 100. What is John's average score?
def solve() -> int: score1 = 78 score2 = 82 score3 = 84 score4 = 86 total_score = score1 + score2 + score3 + score4 average_score = total_score / 4 result = average_score return result
Sophie went to a flower shop with $70 and bought 3 bouquets. Then her friend called her and asked her to buy twice as much as she already bought. Each bouquet of flowers costs $15. Finally, she also bought a third of a pound of roses, and 1 pound of roses costs $20. How much money does Sophie have remaining?
def solve() -> int: bouquet_cost = 15 roses_cost = 20 initial_money = 70 bouquets_bought = 3 additional_bouquets = bouquets_bought * 2 roses_bought = 1/3 total_bouquet_cost = (bouquets_bought + additional_bouquets) * bouquet_cost total_roses_cost = roses_bought * roses_cost ...
Alex usually travels 100 kilometers by train, and it takes him 1.5 hours. This time he misses his stop and has to backtrack for 20 km. If he maintains the same speed, how much time will the entire journey take?
def solve() -> int: distance = 100 + 20 time = 1.5 * (distance/100) result = time return result
A triangle has a base of 12cm and a height of 6cm. What is the area of the triangle?
def solve() -> int: base = 12 height = 6 area = 0.5 * base * height result = area return result
Student: Question7: Alan has two rabbits. Each week, each rabbit eats half a kilo of grass. How much grass does Alan have to provide in a month?
def solve() -> int: rabbits = 2 grass_per_week = 0.5 months = 4 total_grass = rabbits * grass_per_week * months result = total_grass return result
There are 30 students in a class, and the teacher wants to distribute 150 pencils evenly among them. How many pencils will each student get?
def solve() -> int: num_students = 30 num_pencils = 150 pencils_per_student = num_pencils / num_students result = pencils_per_student return result
A rectangle has a width of 8 meters and an area of 64 square meters. What is the length of the rectangle?
def solve() -> int: width = 8 area = 64 length = area / width result = length return result
A jogger runs 6 km east, turns around and runs 3 km west, and then continues 5 km east. How far is the jogger from the starting point?
def solve() -> int: current_distance = 0 current_distance = current_distance + 6 current_distance = current_distance - 3 current_distance = current_distance + 5 result = current_distance return result
Ron is planning to repaint the walls of his rectangular-shaped room. The sum of lengths of the four walls is 40ft. The width of the room is 10ft and the height is 8ft. How many square feet of wall space does he need to paint?
def solve() -> int: w = 10 h = 8 P = 40 l = (P/2) - w s = 2*h*(w+l) result = s return result
A train travels at a speed of 80 km/h. How long will it take for the train to travel 240 km?
def solve() -> int: distance = 240 speed = 80 time = distance/speed result = time return result
A school has 300 students. 12% of them are absent. How many students are present?
def solve() -> int: total_students = 300 absent_percent = 0.12 absent = total_students * absent_percent present = total_students - absent result = present return result
In his first month, Jack read twice as many books as Jill. Jill read 5 more books than John in the same period. If John read 8 books, how many books did the three of them read altogether?
def solve() -> int: john = 8 jill = john + 5 jack = 2 * jill total = john + jill + jack result = total return result
ally is baking a cake for her friend's birthday. She needs 3 cups of flour for the cake batter, 2 cups of flour for the frosting, and 1 cup of flour for the decorations. She has a 5-pound bag of flour that contains 20 cups of flour. How many cups of flour will she have left after she finishes baking the cake?
def solve() -> int: cake_batter = 3 frosting = 2 decorations = 1 bag = 20 cups_left = bag - (cake_batter + frosting + decorations) result = cups_left return result
A total of twenty-four computers are available for sale in three stores. If each store has the same number of computers to sell, determine how many computers each store has.
def solve() -> int: total_computers = 24 num_stores = 3 computers_per_store = total_computers // num_stores result = computers_per_store return result
John is creating a painting with different colors. He has 3 gallons of red paint, 2 gallons of blue paint, 1 gallon of yellow paint, and 4 gallons of white paint. What is the average amount of each color used in the painting?
def solve() -> int: red_paint = 3 blue_paint = 2 yellow_paint = 1 white_paint = 4 total_paint = red_paint + blue_paint + yellow_paint + white_paint average_red_paint = red_paint / total_paint average_blue_paint = blue_paint / total_paint average_yellow_paint = yellow_paint / total_p...
Liam has 8 toy cars to give to his cousins. Realizing that this won't be enough, he goes to the store to buy 4 more toy cars. If he ends up giving 12 toy cars in total, how many cars does Liam have left?
def solve() -> int: initial_cars = 8 bought_cars = 4 total_cars = initial_cars + bought_cars given_cars = 12 left_cars = total_cars - given_cars result = left_cars return result
Emily is taking a 2-hour bus ride from Las Vegas to Phoenix. She spends 30 minutes sleeping, 45 minutes watching a comedy show, 10 minutes eating a fruit, 15 minutes planning her itinerary, and 20 minutes listening to a podcast. How many minutes does she have left to read a magazine?
def solve() -> int: total_time = 2 * 60 sleep_time = 30 comedy_time = 45 fruit_time = 10 itinerary_time = 15 podcast_time = 20 used_time = sleep_time + comedy_time + fruit_time + itinerary_time + podcast_time remaining_time = total_time - used_time result = remaining_time ...
If Maria spent $40 on $2.00 textbooks and bought 5 times as many textbooks as James, and James bought triple the amount of textbooks as Peter, how many textbooks did Maria and James buy altogether?
def solve() -> int: maria_spent = 40 textbook_price = 2.00 maria_textbooks = maria_spent / textbook_price james_textbooks = maria_textbooks / 5 peter_textbooks = james_textbooks / 3 total_textbooks = maria_textbooks + james_textbooks result = total_textbooks return result
Student: There are 40 students in a debate team and each person must speak for 3 minutes. How long will it take for all of the students to finish speaking?
def solve() -> int: num_students = 40 time_per_student = 3 total_time = num_students * time_per_student result = total_time return result
Student: There are 10 students in a class and each student has 11 textbooks. How many textbooks are there in total?
def solve() -> int: students = 10 textbooks_per_student = 11 total_textbooks = students * textbooks_per_student result = total_textbooks return result
A school has 500 students and 25 teachers. Each teacher teaches 2 classes of 20 students each. The principal wants to give each student a pen and each teacher a notebook as a gift. A pen costs 0.5 dollars and a notebook costs 2 dollars. How much money does the principal need to buy all the gifts?
def solve() -> int: pens_needed = 500 notebooks_needed = 25 pen_cost = pens_needed * 0.5 notebook_cost = notebooks_needed * 2 total_cost = pen_cost + notebook_cost result = total_cost return result
A store is having a sale where everything is 30% off. If a shirt's original price is $20, how much will it cost during the sale?
def solve() -> int: original_price = 20 discount = 0.3 sale_price = original_price - original_price*discount result = sale_price return result
Jayden has four boxes. Each box can fit 1/5 as many books as Riley's box, which can fit 125 books. How many books can Jayden's boxes fit together?
def solve() -> int: riley_box = 125 jayden_box = riley_box / 5 num_boxes = 4 result = jayden_box * num_boxes return result
A triangle has a base of length 10 and a height of length 8. What is the area of the triangle?
def solve() -> int: triangle_base = 10 triangle_height = 8 triangle_area = (triangle_base * triangle_height) / 2 result = triangle_area return result
David is counting the number of birds in a tree. 70% of the birds are blue jays and 30% are robins. If there are 21 blue jays, how many robins are there?
def solve() -> int: total_birds = 100 blue_jays = 21 robins_percentage = 100 - 70 robins = (robins_percentage / 100) * total_birds total_birds = blue_jays + robins robins = total_birds - blue_jays result = robins return result
Emily is preparing guacamole. She knows that each serving requires 1 avocado and she has 16 guests. She plans to make 4 bowls of guacamole, which each contain 8 servings. If all the guacamole is demolished, what is the average number of avocados per guest?
def solve() -> int: num_guests = 16 num_servings = 8 * 4 num_avocados = num_servings avocados_per_guest = num_avocados / num_guests result = avocados_per_guest return result
If there are 9 ice cream balls in a 2.5 lbs box and the ice cream balls each have a weight of 2oz, how many kilograms is the entire box of ice cream balls?
def solve() -> int: ball_oz = 2 ball_num = 9 box_lbs = 2.5 box_kg = box_lbs * 0.453592 ball_grams = ball_oz * 28.3 grams_total = ball_grams * ball_num kg_total = grams_total / 1000 result = box_kg + kg_total return result
A school has 360 students and 18 teachers. Each teacher teaches a class of 20 students. The school needs to order textbooks for each student and teacher. Each textbook costs $12. The school has a budget of $5000 for textbooks. How many textbooks can the school order and how much money will be left in the budget?
def solve() -> int: textbooks_needed = (360 + 18) * 1 cost = textbooks_needed * 12 textbooks_ordered = min(textbooks_needed, 5000 // 12) money_left = 5000 - textbooks_ordered * 12 result = None return result
Ashley earned $400 last month working part-time, after deductions for taxes she received $320. What was the approximate percent of her earnings that were paid in taxes?
def solve() -> int: gross_earnings = 400 tax_deductions = 400 - 320 tax_percentage = (tax_deductions/gross_earnings) * 100 result = round(tax_percentage) return result
A tank can hold 5000 liters of water. It is filled at a rate of 20 liters per minute. It is emptied at a rate of 15 liters per minute. How long does it take to fill the tank completely?
def solve() -> int: net_rate = 20 - 15 time = 5000 / net_rate result = time return result
Student: Alex bought 9 packages of gum that cost $10 each and 4 boxes of candy that cost $20 each. How much did he spend in total?
def solve() -> int: gum_packages = 9 candy_boxes = 4 gum_cost = 10 candy_cost = 20 total_gum_cost = gum_packages * gum_cost total_candy_cost = candy_boxes * candy_cost total_cost = total_gum_cost + total_candy_cost result = total_cost return result
Possible questions and programs: In a zoo, the entrance fee is $15 for adults and $10 for children. A family of two adults and three children has a coupon that gives them 20% off the total fee. How much does the family pay to enter the zoo?
def solve() -> int: total_fee = 15 * 2 + 10 * 3 final_fee = 0.8 * total_fee result = final_fee return result
Michael baked 20 cookies. He ate 6 cookies and gave 2 cookies to his brother. The remaining cookies were each split into 4 smaller cookies. His friends ate 1/2 of a small cookie each. How many small cookies were left?
def solve() -> int: cookies_baked = 20 cookies_eaten = 6 cookies_given = 2 remaining_cookies = cookies_baked - cookies_eaten - cookies_given small_cookies = remaining_cookies * 4 cookies_eaten_by_friends = small_cookies / 2 small_cookies_left = small_cookies - cookies_eaten_by_friends ...
Student: Ava is 9 years younger than Ethan, and Ava is three-fifths as old as Olivia. If Ethan is 27 years old, how old are Ava and Olivia together?
def solve() -> int: ava = 0 ethan = 27 olivia = 0 ava = ethan - 9 olivia = ava * 5 / 3 result = ava + olivia return result
A car can travel 24 miles per gallon of gas. If the car travels 120 miles, how many gallons of gas did it use?
def solve() -> int: miles_per_gallon = 24 miles_traveled = 120 gallons_used = miles_traveled / miles_per_gallon result = gallons_used return result
Alex wants to paint the walls of his bedroom. The room has 4 walls, each 10 feet long and 8 feet tall. If a gallon of paint can cover 400 square feet of wall, how many gallons of paint will Alex need?
def solve() -> int: length = 10 height = 8 area_per_wall = 2 * length * height total_area = 4 * area_per_wall gallons = total_area / 400 result = gallons return result
Jill wants to divide $800 between herself and her two friends, Alex and Bill, such that she gets three times as much as Alex and twice as much as Bill. Find the amount (in dollars) Jill gives to Alex.
def solve() -> int: total_money = 800 jill_share = 5 alex_share = 1 bill_share = 2 jill_money = total_money * jill_share / (jill_share + alex_share + bill_share) alex_money = jill_money / 3 bill_money = jill_money / 2 result = alex_money return result
Kim owes Lisa $1000, which is half what Tom owes Lisa. Kim decides to pay 80% of her debt to Lisa, and Tom pays Lisa 50% of his debt. If Lisa had $3000 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 now.
def solve() -> int: kim_debt = 1000 tom_debt = kim_debt * 2 kim_payment = kim_debt * 0.8 tom_payment = tom_debt * 0.5 total_savings = 3000 + kim_payment + tom_payment result = total_savings return result
In a hexagon, the sum of the six angles equals 720. The third angle is triple the size of the second angle, and the second angle is 45 degrees. What is the value of the third angle?
def solve() -> int: angle_2 = 45 angle_3 = angle_2 * 3 sum_of_angles = 720 sum_of_other_angles = sum_of_angles - angle_2 sum_of_other_angles -= angle_3 sum_of_other_angles /= 4 result = angle_3 + sum_of_other_angles return result
Harry had 9.4 ounces of pecans and 3.1 cups of flour and was planning to make a cake. How many ounces of flour did he need?
def solve() -> int: amount_pecans = 9.4 amount_flour = 3.1 * 8 needed = amount_pecans + amount_flour result = needed - amount_pecans return result
John, who earns $100,000 per year, is offered a new job that pays 20% more. However, the new job requires him to move to a city where the cost of living is 30% higher. Will he be better off with the new job?
def solve() -> int: annual_salary = 100000 percent_raise = 0.20 new_salary = annual_salary * (1 + percent_raise) higher_cost_of_living = 0.30 new_expenses = annual_salary + (annual_salary * higher_cost_of_living) better_off = new_salary > new_expenses result = int(better_off) return resu...
Student: A printer can print 20 pages per minute. It uses 0.5 ml of ink per page. How much ink will it use in 2 hours?
def solve() -> int: pages_per_minute = 20 ink_per_page = 0.5 hours = 2 pages = pages_per_minute * hours * 60 ink = ink_per_page * pages result = ink return result
Jennifer wants to become a professional photographer. It takes her 2 weeks to learn how to operate the camera properly. It then takes her 35 times that long to become proficient enough to shoot weddings and events. After that, she focuses all her energy on photography and spends 95 times as much time as the combined ti...
def solve() -> int: weeks_to_learn_camera = 2 weeks_to_become_proficient = weeks_to_learn_camera * 35 weeks_to_start_business = (weeks_to_learn_camera + weeks_to_become_proficient) * 95 total_time = weeks_to_learn_camera + weeks_to_become_proficient + weeks_to_start_business result = total...
Rohan sold two-thirds of his bags of chips for $1.50 each and the rest for $1.20 each. How much money did he make if he sold all 15 bags?
def solve() -> int: price1 = 1.50 price2 = 1.20 number1 = 15 * (2/3) number2 = 15 * (1/3) total = price1 * number1 + price2 * number2 result = total return result
Tom, the chef, takes 4 hours to prepare a fancy dinner. It usually takes him 1 hour to chop the ingredients, 2 hours to cook the meal, and another hour to plate it. One day, the oven was slow and it took twice as long to cook the main course. How long did it take Tom to prepare that dinner?
def solve() -> int: chop_time = 1 cook_time = 2 plate_time = 1 normal_cook_time = 2 slow_cook_time = normal_cook_time * 2 total_time = chop_time + cook_time + plate_time + slow_cook_time result = total_time + 1 return result
Tim is organizing a school event. Each table needs 5 chairs and 1 tablecloth. If Tim needs to set up 20 tables and has 90 chairs but only 12 tablecloths, how many more tablecloths does he need to buy?
def solve() -> int: tables = 20 chairs_per_table = 5 tablecloths_per_table = 1 total_chairs = tables * chairs_per_table total_tablecloths = tables * tablecloths_per_table remaining_tablecloths = total_tablecloths - 12 result = remaining_tablecloths return result
Alex has twice as many marbles as Ben. Ben has 20 marbles. How many marbles do the two have together?
def solve() -> int: ben_marbles = 20 alex_marbles = 2 * ben_marbles total_marbles = ben_marbles + alex_marbles result = total_marbles return result
Student: A farmer had to buy a total of 170 cows at a price of $345 each, but partway through the purchase the price of the cows increased by $98 each. How much more money does the farmer need to pay for the remaining cows?
def solve() -> int: total_cows = 170 price_per_cow = 345 increase_per_cow = 98 cost_first_batch = total_cows * price_per_cow num_first_batch = total_cows num_remaining_cows = total_cows - num_first_batch cost_remaining_cows = num_remaining_cows * (price_per_cow + increase_per_cow) total_...
Jake is a landscaper in charge of maintaining three lawns. Lawn A is 500 square feet, Lawn B is 750 square feet, and Lawn C is 1000 square feet. If mowing Lawn A requires 30 minutes, mowing Lawn B requires 45 minutes, and mowing Lawn C requires 60 minutes, what percentage of the total mowing time will be spent on Lawn ...
def solve() -> int: lawn_A = 500 lawn_B = 750 lawn_C = 1000 time_A = 30 time_B = 45 time_C = 60 total_time = time_A + time_B + time_C percentage_C = (time_C/total_time)*100 result = percentage_C return result
Tom has 5 times as many stamps as Jerry. Tom then loses 8 stamps in a trade. If Jerry has 6 stamps, how many does Tom have in total?
def solve() -> int: tom_stamps = 6 * 5 tom_loses = 8 tom_left = tom_stamps - tom_loses result = tom_left return result
A bakery bakes 2 different types of cakes. Each cake has 3 different flavors. If they bake 10 cakes of each type every day, how many servings can they offer each day?
def solve() -> int: num_cake_types = 2 num_flavors = 3 num_cakes_per_type = 10 total_cakes = num_cake_types * num_cakes_per_type total_servings = total_cakes * num_flavors result = total_servings return result
Student: The drama club is selling tickets to their play to raise money for costumes. They want to make $300 from the ticket sales. They sell adult tickets for $10 each and student tickets for $5 each. They have sold 15 adult tickets and 25 student tickets so far. How many more adult tickets do they have to sell to rea...
def solve() -> int: adult_ticket_price = 10 student_ticket_price = 5 adult_tickets_sold = 15 student_tickets_sold = 25 goal = 300 total_revenue_so_far = adult_ticket_price * adult_tickets_sold + student_ticket_price * student_tickets_sold remaining_revenue = goal - total_revenue_so_far r...
A bike rental service has 20 bicycles and 8 tandem bikes (bikes for two people). How many wheels and seats are there in total in the bike rental service?
def solve() -> int: bicycles_wheels = 20 * 2 tandem_wheels = 8 * 2 bicycle_seats = 20 * 1 tandem_seats = 8 * 2 result = bicycles_wheels + tandem_wheels + bicycle_seats + tandem_seats return result
A group of 6 friends go out to eat. Four of them order entrees that cost $12 each, and two order entrees that cost $15 each. They also split a $20 appetizer evenly. What is the total bill including tax and a 15% tip?
def solve() -> int: entree_cost = 4*12+2*15 appetizer_cost_per_person = 20/6 total_cost = entree_cost + appetizer_cost_per_person tax = total_cost*0.08 tip = total_cost*0.15 final_bill = total_cost + tax + tip result = final_bill return result
An investor invested $70,000 in a business that made a profit of 25%. If the investor's profit was $5,000, calculate his initial investment.
def solve() -> int: profit_percentage = 25 profit_amount = 5000 total_investment = profit_amount / (profit_percentage / 100) result = round(total_investment, 2) return result
In a group of 50 people, the average age is 30. If 6 people leave the group, the average age becomes 28. What is the average age of the 6 people who left?
def solve() -> int: num_people = 50 before = 30 after = 28 num_left = num_people - 6 lost = (before - after) * num_people lost_age = lost / 6 result = lost_age return result
At a movie theater, it costs $8 per movie ticket and $4 for a small popcorn. If a group of 4 people go to the movies, buy 2 bags of popcorn to share and each person gets a ticket, how much did they spend altogether?
def solve() -> int: num_people = 4 ticket_cost = 8 num_popcorns = 2 popcorn_cost = 4 total_cost = (num_people * ticket_cost) + (num_popcorns * popcorn_cost) result = total_cost return result
A shop sells items in packs of 5. If the shop has 96 items, how many packs can be formed?
def solve() -> int: items_num = 96 items_in_pack = 5 packs_total = items_num / items_in_pack result = packs_total return result
A restaurant has a total of 500 customers in a day and 80% of them are served lunch. How many customers are served breakfast or dinner?
def solve() -> int: total_customers = 500 lunch_percentage = 80 lunch_customers = total_customers * (lunch_percentage / 100) breakfast_or_dinner_customers = total_customers - lunch_customers result = breakfast_or_dinner_customers return result
Zoe and Emma were painting pictures for a art show. Zoe painted 6 more pictures than 2 times the number of pictures that Emma painted. If Emma painted 9 pictures, how many did Zoe paint?
def solve() -> int: zoe = 0 emma = 9 zoe = 2 * emma + 6 result = zoe return result
For a bridal shower, Emily is serving shrimp cocktail with crackers and sauce. She buys 2 boxes of crackers for $2.50 each and tops each cracker piece with some sauce that costs $1.50 and then the $80.00 shrimp. This appetizer will serve 12 people. How much will this appetizer cost per person?
def solve() -> int: num_boxes = 2 price_per_box = 2.50 num_people = 12 price_per_sauce = 1.50 price_per_shrimp = 80.00 total_price = (num_boxes * price_per_box) + (num_people * price_per_sauce) + price_per_shrimp price_per_person = total_price / num_people result = price_per_pe...
A store is having a sale. Everything is 30% off its original price. If a shirt originally costs $20, what is the sale price?
def solve() -> int: original_price = 20 discount_percent = 30 discount_amount = original_price * discount_percent / 100 sale_price = original_price - discount_amount result = sale_price return result
Michelle has to read 7 books for her summer reading list. Each book takes her 10 hours to read. The final book takes 40% longer than each of the first six. Writing the book reports took half the length of time as it took to read the books. How many hours did Michelle spend on summer reading?
def solve() -> int: num_books = 7 hours_per_book = 10 total_hours_first_six_books = num_books * hours_per_book extra_time_last_book = 0.4 * hours_per_book total_hours_last_book = hours_per_book + extra_time_last_book total_hours_reading = total_hours_first_six_books + total_hours_last_book t...
Nicole wants to save $1500 in 10 months. She already has $380 saved. How much money does she need to save every month to reach her goal?
def solve() -> int: savings_goal = 1500 current_savings = 380 months_left = 10 amount_to_save = (savings_goal - current_savings) / months_left result = amount_to_save return result
Lisa and her friends are out shopping, and they decide to split the bill. The total cost of their items is $120. In addition, they have to pay 15% sales tax, and they decide to give a $10 tip. How much is the final amount they have to pay, including tax and tip?
def solve() -> int: item_cost = 120 tax_rate = 0.15 tax_amount = item_cost * tax_rate tip = 10 total_cost = item_cost + tax_amount + tip result = total_cost result return result
In a wildlife park, the number of visitors varied greatly in one week. On Monday, the park had 500 visitors, on Tuesday they had 800, on Wednesday they had 300, on Thursday they had 1000, on Friday they had 600, and on Saturday they had 200 visitors. What was their average daily number of visitors for that week?
def solve() -> int: monday_visitors = 500 tuesday_visitors = 800 wednesday_visitors = 300 thursday_visitors = 1000 friday_visitors = 600 saturday_visitors = 200 total_visitors = monday_visitors + tuesday_visitors + wednesday_visitors + thursday_visitors + friday_visitors + saturday_visi...
Carlos walked 500 meters west to the supermarket and then 400 meters north to the library. How far is the library from Carlos' starting position?
def solve() -> int: distance_west = 500 distance_north = 400 total_distance = (distance_west**2 + distance_north**2)**0.5 result = total_distance return result
A box containing colored pens has a ratio of red pens to green pens to blue pens of 2:3:4. If there are 120 green pens, how many pens are there in total?
def solve() -> int: green_pens = 120 ratio_red_to_green_to_blue = 2/3/4 total_pens = green_pens/ratio_red_to_green_to_blue*9 result = total_pens return result
A grocery store has a discount of 10% on purchases of $50 or more. If a customer buys $60 worth of groceries, how much will they save?
def solve() -> int: total_purchase = 60 discount_threshold = 50 discount_rate = 0.10 if total_purchase >= discount_threshold: discount_amount = total_purchase * discount_rate else: discount_amount = 0 result = discount_amount return result
If Jack needs 900 paint brushes to paint his school’s art club mural, and he can buy half of them for a discount of 35% each at $1.25 per brush, how much will he spend on all the paint brushes?
def solve() -> int: discounted_price = 1.25 * 0.65 half_quantity = 900 / 2 total_cost = discounted_price * half_quantity result = total_cost return result
Tyler works 6 hours a day, 4 days a week, 4 weeks a month. His assistant, Jack, works half the number of hours that Tyler works every day. Tyler earns $30 per hour while Jack earns $15 per hour. What is their total monthly income?
def solve() -> int: tyler_hours_per_day = 6 jack_hours_per_day = tyler_hours_per_day / 2 days_per_week = 4 weeks_per_month = 4 tyler_hourly_rate = 30 jack_hourly_rate = 15 tyler_total_hours = tyler_hours_per_day * days_per_week * weeks_per_month jack_total_hours = jack_hours_per_day...
A tank can hold 2000 liters of water. If it is currently 60% full, how many liters of water are in the tank?
def solve() -> int: tank_capacity = 2000 percent_full = 60 water_in_tank = tank_capacity * (percent_full/100) result = water_in_tank return result
If 6 sandwiches are made with 8 slices of bread, how many slices of bread would be needed to make 10 sandwiches?
def solve() -> int: num_sandwiches = 10 slices_per_sandwich = 8 total_slices = num_sandwiches * slices_per_sandwich result = total_slices return result
A bag contains 4 red marbles, 5 blue marbles, and 7 green marbles. If a marble is selected at random, what is the probability that it is not red?
def solve() -> int: total_marbles = 4+5+7 red_marbles = 4 non_red_marbles = total_marbles - red_marbles probability = non_red_marbles/total_marbles result = "The probability of selecting a non-red marble is "+str(round(probability,2)) return result
In a school, the ratio of girls to boys in the seventh grade is 5:4. There are 140 students in the seventh grade. How many boys are there?
def solve() -> int: girls = 140 * 5 / 9 boys = 140 - girls result = boys return result