question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Jack needs to buy 40 items from the store. Each item cost $6. How much will Jack spend in total?
def solve() -> int: total_cost = 6 * 40 result = total_cost return result
At a restaurant there are 52 people present and only 24 of them ordered drinks. What percentage of the people ordered drinks?
def solve() -> int: n_people = 52 n_ordered_drinks = 24 percentg_ordered_drinks = n_ordered_drinks * 100 / n_people result = percentg_ordered_drinks return result
Jacob has some fruits. He has 4 more apples than oranges and 2 more bananas than apples. If he has 2 oranges, how many bananas does he have?
def solve() -> int: apples = 2 + 4 bananas = apples + 2 result = bananas return result
Tom is playing a game of Jenga with a friend. Each successful block they pull earns them 2 points, but every time the tower falls they lose 5 points. If Tom and his friend haveMrs. Johnson lives 2 kilometers from the grocery store. On her way to the store, she walks 1 kilometer and remembers she forgot her wallet at ho...
def solve() -> int: distance_to_store = 2 distance_to_home = 1 total_distance = (distance_to_store + distance_to_home) * 2 result = total_distance return result
A math test was taken by Angela and David. Angela got 20% of the items wrong while David got 9 mistakes. If there were 45 questions in the test, how many more correct answers did Angela get than David?
def solve() -> int: total_questions = 45 angela_wrong = total_questions * 0.2 david_wrong = 9 angela_correct = total_questions - angela_wrong david_correct = total_questions - david_wrong difference = angela_correct - david_correct result = difference return result
A recipe calls for 2 cups of sugar to make 12 cupcakes. How many cups of sugar are needed to make 30 cupcakes using this recipe?
def solve() -> int: sugar_cups = 2 cupcakes = 12 new_cupcakes = 30 sugar_needed = sugar_cups * (new_cupcakes/cupcakes) result = sugar_needed return result
``` If a cake recipe calls for 2 cups of flour and you want to make 3 times the recipe, how much flour do you need to make the cake?
def solve() -> int: flour = 2 recipe_multiplier = 3 total_flour = flour * recipe_multiplier result = total_flour return result
A car travels 40 miles to a destination at a speed of 50 miles per hour. On the way back, the speed is reduced by 20%. What is the average speed for the round trip?
def solve() -> int: distance = 40 speed1 = 50 speed2 = speed1 * 0.8 time1 = distance / speed1 time2 = distance / speed2 total_distance = distance * 2 total_time = time1 + time2 average_speed = total_distance / total_time result = average_speed return result
Student: If Tom's salary was increased by 25%, he would earn $30,000. What is his current salary?
def solve() -> int: new_salary = 30000 increase_percentage = 25 current_salary = new_salary / (1 + increase_percentage/100) result = current_salary return result
A farmer wants to plant 8 rows of corn. Each row will have 45 corn stalks. How many corn stalks will the farmer need to plant?
def solve() -> int: rows = 8 stalks_per_row = 45 total_stalks = rows * stalks_per_row result = total_stalks return result
Alex is running at a steady pace. He is on the 7th lap of his 21 lap race. An hour ago, he was on the 4th lap. How many hours will it take Alex to complete his race?
def solve() -> int: laps_completed = 7 total_laps = 21 laps_remaining = total_laps - laps_completed laps_per_hour = laps_completed - 4 hours = laps_remaining / laps_per_hour result = hours return result
``` The area of a rectangle is 320 square meters. If the length of the rectangle is 16 meters, find the width of the rectangle.
def solve() -> int: area = 320 length = 16 width = area / length result = width return result
Possible new questions and programs are: David collects stamps and buys some new ones every week. On Monday he had 54 stamps in his album. On Tuesday he bought 12 more stamps and added them to his album. On Wednesday he traded 4 stamps with his friend and got 6 different ones in return. On Thursday he found out that 3 ...
def solve() -> int: stamps = 54 stamps = stamps + 12 stamps = stamps - 4 + 6 stamps = stamps - 3 stamps = stamps + 15 result = stamps return result
A restaurant has 10 tables and each table can seat 4 people. If they add 3 more tables that can seat 6 people each, how many people can the restaurant seat now?
def solve() -> int: num_tables = 10 table_capacity = 4 new_tables = 3 new_table_capacity = 6 new_total_capacity = (num_tables * table_capacity) + (new_tables * new_table_capacity) result = new_total_capacity return result
``` Mia has 120 books. 55% of the books are paperback and 75% of the paperback books are fiction. How many paperback books are not fiction?
def solve() -> int: books = 120 paperback = books * 55/100 fiction = paperback * 75/100 not_fiction = paperback - fiction result = not_fiction return result
Lisa has a number of books. Each book contains 12 pages and she gives away 8 pages each time. How many times can she give away pages?
def solve() -> int: times_can_give = 0 for num_books in range (1, 9): times_can_give += 12 // 8 result = times_can_give return result
A recipe calls for 3 cups of flour for every 2 cups of milk. If you want to make 8 cups of flour, calculate the required amount of milk.
def solve() -> int: flour = 8 milk = (flour * 2) / 3 result = milk return result
Zoe is 10 years younger than Mason. Mason is twice as old as Emily. If Emily is 15, how old is Zoe?
def solve() -> int: mason = 15 * 2 zoe = mason - 10 result = zoe return result
A shirt costs 30 dollars but is on sale for 20% off. The sales tax is 7%. How much does the shirt cost altogether?
def solve() -> int: original_price = 30 discount = 0.2 sale_price = original_price - original_price * discount tax = 0.07 total = sale_price + sale_price * tax result = total return result
A box contains 24 chocolates. If 8 chocolates are eaten, how many chocolates are left in the box?
def solve() -> int: chocolates_in_box = 24 chocolates_eaten = 8 chocolates_left = chocolates_in_box - chocolates_eaten result = chocolates_left return result
A delivery boy has to ride his bike for five rounds about a block that measures 120 meters by 80 meters. What is the total distance he will ride, in meters?
def solve() -> int: length = 120 width = 80 perimeter = 2 * (length + width) distance_per_round = perimeter total_distance = 5 * distance_per_round result = total_distance return result
Possible questions and programs: Tom wants to make some juice. He needs 2 oranges, 3 apples and 1 lemon for each liter of juice. Oranges cost $0.5, apples cost $0.4 and lemons cost $0.6. If Tom makes 5 liters of juice, what is the total cost of the fruits he used in dollars?
def solve() -> int: oranges_per_liter = 2 apples_per_liter = 3 lemons_per_liter = 1 orange_price = 0.5 apple_price = 0.4 lemon_price = 0.6 total_oranges = oranges_per_liter * 5 total_apples = apples_per_liter * 5 total_lemons = lemons_per_liter * 5 total_orange_cost = total_orang...
Jordan has 7 pairs of shoes and 3 hats to purchase for her wardrobe. The shoes are $100 per pair and the hats are half that cost. How much does she spend in total? Benny wants to buy a new computer. He spends $500 on the hard drive, and $300 on the processor. If he has $200 left to spend on RAM and a graphics card, how...
def solve() -> int: num_shoes = 7 shoe_cost = 100 num_hats = 3 hat_cost = shoe_cost / 2 total_shoe_cost = num_shoes * shoe_cost total_hat_cost = num_hats * hat_cost total_cost = total_shoe_cost + total_hat_cost hard_drive_cost = 500 processor_cost = 300 remaining_money ...
In a classroom, there were 20 boys and 15 girls. If the teacher adds 10 more girls to the classroom, what percentage of the students in the classroom would be boys?
def solve() -> int: boys = 20 girls = 15 total_students = boys + girls new_girls = 10 total_students += new_girls percentage_boys = (boys / total_students) * 100 result = percentage_boys return result
Yesterday, the bakery sold 100 pastries. Today, the bakery sold 50 more pastries than yesterday. How many pastries did the bakery sell today?
def solve() -> int: yesterday_sales = 100 today_sales = yesterday_sales + 50 result = today_sales return result
Student: In a classroom, there are 17 students and 5 are absent. How many students are present?
def solve() -> int: students_total = 17 students_absent = 5 students_present = students_total - students_absent result = students_present return result
A loaf of bread has 20 slices with 80 calories each. Max makes a sandwich with 2 slices of bread and 2 slices of cheese. Each slice of cheese has 100 calories. How many calories are in Max's sandwich?
def solve() -> int: calories_bread = 2 * 80 calories_cheese = 2 * 100 calories_sandwich = calories_bread + calories_cheese result = calories_sandwich return result
Lily deposited $700 into her bank account. The deposit increased her account balance by 60%. How much money did Lily have in her account before depositing the money?
def solve() -> int: deposit = 700 increase_percentage = 60 increase_amount = deposit * (increase_percentage / 100) previous_balance = deposit - increase_amount result = previous_balance return result
In a backyard, Sofia watered 20 plants with 4 buckets of water. If each bucket had the same amount of water, how many plants did Sofia water with each bucket?
def solve() -> int: plants_each_bucket = 20 / 4 result = plants_each_bucket return result
Student: A DVD costs $20 and has a running time of 120 minutes. If Jaydon needs to watch a 3-hour movie, how much will it cost him?
def solve() -> int: cost_per_dvd = 20 running_time_per_dvd = 120 total_running_time_needed = 3 * 60 num_dvds_needed = total_running_time_needed // running_time_per_dvd total_cost = num_dvds_needed * cost_per_dvd result = total_cost return result
A pizza costs $8.50 plus $0.75 for each additional topping. If Joe orders a pizza with 3 toppings, how much does he need to pay?
def solve() -> int: total_cost = 8.50 + 3*0.75 result = total_cost return result
Dianne has 90 coins, 3/4 of them are copper, 1/2 of them are silver, and the remaining are gold. If she randomly picks three coins, what are the odds none of them are silver (expressed as a percentage)?
def solve() -> int: total_coins = 90 total_copper = 67.5 total_silver = 45 total_gold = 22.5 total_silver_picked = total_silver / total_coins * 100 total_silver_picked_three_times = total_silver_picked * total_silver_picked * total_silver_picked no_silver_coins = 100 - total_s...
Emma bought an air conditioner for $600. She gets a 15% discount on it and then pays a down payment of $100. The remaining balance will be paid in five equal monthly installments. What is the amount of a monthly payment?
def solve() -> int: discounted_price = 600 - (600 * 0.15) remaining_balance = discounted_price - 100 monthly_payment = remaining_balance / 5 result = monthly_payment return result
Rachel went to a store and bought 2 shirts at $20 each and a pair of shoes at $50. The store was offering a 10% discount on purchases over $75. Did Rachel qualify for the discount and how much did she save?
def solve() -> int: shirt_cost = 20 shoe_cost = 50 num_shirts = 2 subtotal = (shirt_cost * num_shirts) + shoe_cost if subtotal > 75: discount = subtotal * 0.10 saved = discount else: discount = 0 saved = discount result = (discount, saved) return result
A store offers a 20% discount on all items. If a shirt costs $25 before the discount, how much does it cost after the discount?
def solve() -> int: original_price = 25 discount = 0.2 new_price = original_price - (original_price * discount) result = new_price return result
arah works 40 hours a week at her job. If she gets paid $15 an hour, how much money does she make in a week before taxes are taken out?
def solve() -> int: hours_worked = 40 hourly_wage = 15 total_pay = hours_worked * hourly_wage result = total_pay return result
- Mia had a lemonade stand and wanted to earn $20. She sold each cup of lemonade for $0.5 and spent $0.1 on each lemon. She started with 10 lemons and made 5 cups of lemonade from each lemon. She sold all the cups she made in the first hour. Then she bought more lemons with the money she earned and repeated the process...
def solve() -> int: cup_price = 0.5 lemon_price = 0.1 lemon_cups = 5 initial_lemons = 10 target_earnings = 20 initial_earnings = cup_price * lemon_cups * initial_lemons initial_expenses = lemon_price * initial_lemons initial_profit = initial_earnings - initial_expenses ...
If a car can travel 35 miles on a gallon of gas, and gas costs $3.50 per gallon, how much does it cost to travel 245 miles?
def solve() -> int: mpg = 35 distance = 245 gas_price = 3.50 gallons_needed = distance / mpg cost = gallons_needed * gas_price result = cost return result
Emily baked 36 cupcakes. She wants to divide the cupcakes equally among 6 different plates. How many cupcakes will be on each plate?
def solve() -> int: cupcakes_in_plate = int(36/6) result = cupcakes_in_plate return result
Possible new questions and python programs: A bakery made 24 pies on Monday and sold half of them. On Tuesday, it made 18 more pies and sold two-thirds of the total pies it had. On Wednesday, it made one-fourth the number of pies it made on Monday and sold all of them. How many pies did the bakery sell by Wednesday?
def solve() -> int: pies_made_Monday = 24 pies_sold_Monday = pies_made_Monday / 2 pies_left_Monday = pies_made_Monday - pies_sold_Monday pies_made_Tuesday = 18 pies_total_Tuesday = pies_left_Monday + pies_made_Tuesday pies_sold_Tuesday = pies_total_Tuesday * 2 / 3 pi...
If Tom has twice as much money as John and their combined money is $90, how much money does John have?
def solve() -> int: john_money = 0 tom_money = 0 john_money = 30 tom_money = 2 * john_money result = john_money return result
A galaxy of triforces has three points. In a constellation, there are a total of 27 points. How many triforces are in the constellation?
def solve() -> int: total_points = 27 points_per_triforce = 3 triforces = total_points // points_per_triforce result = triforces return result
A group of workers can build a wall in 8 hours if they work together. If there are 12 workers in the group, how long will it take for 4 workers to build the same wall?
def solve() -> int: total_rate = 1/8 group_rate = total_rate / 12 four_workers_rate = group_rate * 4 time_four_workers = 1 / four_workers_rate result = time_four_workers return result
How many more red books than blue books would need to be added to a shelf in order to make it 5 times as many red books as blue books?
def solve() -> int: num_blue = 10 num_red = 50 desired_ratio = 5 total_needed = (desired_ratio * num_blue) - num_red result = total_needed return result
Ada has a collection of stamps from different countries. She wants to arrange them in an album with 12 pages. Each page can fit 20 stamps. She has 150 stamps from France, 120 stamps from Italy, 80 stamps from Germany, and 60 stamps from Spain. How many stamps can she fit in the album?
def solve() -> int: france_stamps = 150 italy_stamps = 120 germany_stamps = 80 spain_stamps = 60 total_stamps = sum([france_stamps, italy_stamps, germany_stamps, spain_stamps]) pages = 12 stamps_per_page = 20 album_capacity = pages * stamps_per_page result = min(total_stamps,...
A car travels at 72 miles/hour for 3 hours and then increases its speed to 80 miles/hour. After another 4 hours, it reduces the speed to 60 miles/hour. How far does the car travel?
def solve() -> int: distance1 = 72 * 3 distance2 = 80 * 4 distance3 = 60 * 3 total_distance = distance1 + distance2 + distance3 result = total_distance return result
In a park, there are 240 birds, some are pigeons and some are sparrows. If there are 4 times as many sparrows as pigeons, how many pigeons are there?
def solve() -> int: total_birds_ratio_parts = 4+1 sparrows_ratio_parts = 4 sparrows = sparrows_ratio_parts / total_birds_ratio_parts * 240 pigeons = 240 - sparrows result = pigeons return result
Student: A box contains 24 pens and 36 pencils. If you take out 10 pens and put in 20 pencils, how many writing utensils are in the box now?
def solve() -> int: pens = 24 pencils = 36 pens -= 10 pencils += 20 result = pens + pencils return result
A car's gas tank can hold 16 gallons of gas. After driving for half the distance, it currently has 6 gallons left. They fill it up with 10 gallons more. Later on, they drive and use up 2 more gallons of fuel. How many gallons of fuel does the car currently have?
def solve() -> int: tank_capacity = 16 current_fuel = 6 additional_fuel = 10 fuel_used = 2 distance_driven = (tank_capacity - current_fuel) / 2 total_fuel_used = distance_driven + fuel_used current_fuel = tank_capacity - total_fuel_used + additional_fuel result = curr...
A car travels 120 miles in 2 hours. What is the average speed of the car in miles per hour?
def solve() -> int: distance = 120 time = 2 averageSpeed = distance / time result = averageSpeed return result
Student: A sports store offers basketballs for $10 each, footballs for $15 more than basketballs, and soccer balls for the sum of the prices of two basketballs. How much do you need to pay in total to buy one of each of these products?
def solve() -> int: basketball_price = 10 football_price = basketball_price + 15 soccer_ball_price = basketball_price * 2 total_price = basketball_price + football_price + soccer_ball_price result = total_price return result
A company hires 80 employees and fires 10% of them. If 5 employees quit, how many employees are left in the company?
def solve() -> int: employees = 80 fired = employees * 0.1 quit = 5 result = employees - fired - quit return result
A garden is 28 feet long and 17 feet wide. How much fencing is needed to surround the garden if the fence costs $2.5 per foot?
def solve() -> int: length = 28 width = 17 cost_per_foot = 2.5 perimeter = 2 * (length + width) total_cost = perimeter * cost_per_foot result = total_cost return result
You are saving up to buy a new phone. You currently have $700 and you need $1200. How much more money do you need to save?
def solve() -> int: current_savings = 700 target_savings = 1200 remaining_savings = target_savings - current_savings result = remaining_savings return result
Alex cycles 20 miles to the park. Coming back he takes a route that is 8% longer. He spends 1 hour at the park. If he rides at a speed of 12 mph, how long was he not at home? Out of all the toys in a toy box, four-fifths are action figures. Half of the action figures are wearing capes. If there are 10 action figures we...
def solve() -> int: total_distance = 20 extra_distance_percentage = 8 time_at_park = 1 speed = 12 extra_distance = (extra_distance_percentage / 100) * total_distance return_distance = total_distance + extra_distance return_time = return_distance / speed total_time_not...
Nancy found that 12 out of 35 people surveyed said “yes” to the question she asked. What percentage of people said yes?
def solve() -> int: percent_yes = (12 / 35) * 100 result = percent_yes return result
Student: A recipe calls for 3/4 cups of vegetable oil for every 2 cups of flour. If there are 6 cups of flour, how much vegetable oil will be needed?
def solve() -> int: flour = 6 oil_per_flour = 3/4 oil = flour * oil_per_flour result = oil return result
Alex decided to buy a car on an EMI, which he has to pay for the next 5 years. The car cost $20,000, and Alex needs to pay $400 per month. After 2 years, the bank increased the EMI to $500, and Alex continued paying the increased amount until he paid off the car. What was the total amount Alex paid for the car?
def solve() -> int: car_cost = 20000 emi_1 = 400 emi_2 = 500 total_months = 60 paid_months_1 = 24 paid_months_2 = total_months - paid_months_1 total_paid_1 = emi_1 * paid_months_1 total_paid_2 = emi_2 * paid_months_2 total_paid = total_paid_1 + total_paid_2 result ...
A company needs to print documents. The document is 40 pages long and the printer can print 12 pages per minute. How long will it take to print all of the copies of the document?
def solve() -> int: pages = 40 pagespMin = 12 totalTime = pages / pagespMin result = totalTime return result
A scorpion has eight legs. If a group of scorpions has twice as many scorpions as half the number of legs a single scorpion has, what is the total number of legs in the group of scorpions?
def solve() -> int: legs_per_scorpion = 8 scorpions = (legs_per_scorpion / 2) * 2 total_legs = scorpions * legs_per_scorpion result = total_legs return result
A train leaves the station at 9am, traveling at 50 mph. If it is now 11am, how far has the train traveled?
def solve() -> int: speed = 50 start_time = 9 elapsed_time = 11-start_time distance_traveled = speed*elapsed_time result = distance_traveled return result
A parking lot charges $5 for the first two hours of parking and then $1.50 for each additional hour. If a person parks their car for 5 hours and 45 minutes, how much do they have to pay?
def solve() -> int: total_hours = 5.75 hourly_rate = 1.5 if total_hours <=2: cost = 5 else: cost = 5 + hourly_rate*(total_hours-2) result = cost return result
Emma and her brother went to the mall to buy some clothes. They each bought a shirt and a pair of jeans. They also split the cost of a dress. A shirt costs $10. A pair of jeans costs $20. The dress costs $50. They used 75% of their combined money. If Emma brought $80, how much did her brother bring?
def solve() -> int: shirt_cost = 10 jeans_cost = 20 dress_cost = 50 emma_money = 80 total_cost = 2 * (shirt_cost + jeans_cost) + dress_cost money_left = emma_money / 0.75 - total_cost brother_money = money_left / 2 result = brother_money return result
In a sports team, the ratio of boys to girls is 4 : 3. If there are 24 boys, how many girls are in the team?
def solve() -> int: total = 24 boys = total * (4/7) girls = total - boys result = girls return result
Carlos and his friends are having a pizza party and need 6 pizzas. While at the pizzeria, Carlos' uncle calls and says they'll need to add 2 more pizzas for their extended family who will be attending. If Carlos estimates they'll need to buy twice as many pizzas for the next two pizza parties, how many pizzas will they...
def solve() -> int: pizzas_first_party = 6 pizzas_extended_family = 2 total_pizzas = pizzas_first_party + pizzas_extended_family pizzas_next_parties = total_pizzas * 2 total_pizzas_all_parties = total_pizzas + pizzas_next_parties result = total_pizzas_all_parties ...
Student: Liam has whooping cough. He coughs 15 times every hour for 8 hours a day. How many times does he cough in a day?
def solve() -> int: coughs_per_hour = 15 hours_per_day = 8 total_coughs = coughs_per_hour * hours_per_day result = total_coughs return result
Student: A family of 5 went on a road trip and drove 1200 miles. If they drove for 1/3 of the total distance on the first day and drove the same distance each day, how many miles did they drive each day?
def solve() -> int: total_distance = 1200 distance_first_day = total_distance / 3 distance_each_day = total_distance - distance_first_day total_distance_each_day = distance_each_day / 4 result = total_distance_each_day return result
Mike went on a road trip driving at an average speed of 60 miles per hour. If he drove for 4 hours and then took a break for 30 minutes, and then drove at the same average speed for another 2 hours and 45 minutes, how many miles did Mike drive in total?
def solve() -> int: total_driving_time = 4 + (30/60) + 2 + (45/60) total_distance = 60 * total_driving_time result = total_distance return result
There are 80 students in a class, and 45% of them are girls. How many boys are there in the class?
def solve() -> int: girls = 80 * 0.45 boys = 80 - girls result = boys return result
9. Of the 400 homes in the town of Belize, one fifth of them are two stories and the other four fifths are single story. One third of the two stories homes have a front yard. How many single story homes do not have a front yard?
def solve() -> int: total_homes = 400 two_story_homes = total_homes/5 single_story_homes = total_homes - two_story_homes frontyard_homes = two_story_homes/3 non_frontyard_homes = single_story_homes - frontyard_homes result = non_frontyard_homes return result
Student: A school drama performance has 145 seats available for purchase. If 95 tickets have been sold already, how many seats are still available?
def solve() -> int: seats_available = 145 tickets_sold = 95 seats_still_available = seats_available - tickets_sold result = seats_still_available return result
A company has a sales team of 50 members. 25% of them are top performers. Of the top performers, 80% have been with the company for more than 2 years. If a random sales team member is picked, what are the odds they are a top performer who has been with the company for more than 2 years?
def solve() -> int: prob_top_performer = 0.25 prob_longer_tenure_given_top_performer = 0.8 prob_top_performer_and_longer_tenure = prob_top_performer * prob_longer_tenure_given_top_performer result = prob_top_performer_and_longer_tenure return result
A bike tire has a radius of 15 inches. What is the circumference of the tire in feet (1 foot = 12 inches)?
def solve() -> int: radius = 15 circumference = 2*3.14159*radius circumference_feet = circumference/12 result = circumference_feet return result
7. Dave bought four toy cars that each cost the same amount. If the total cost was $56, how much did each toy car cost?
def solve() -> int: total_cost = 56 each_car_cost = total_cost/4 result = each_car_cost return result
There are 200 students in a school. If 50% of the students are girls and 60% of the girls wear glasses, how many girls in the school wear glasses?
def solve() -> int: total_students = 200 girls = total_students*0.5 girls_with_glasses = girls*0.6 result = girls_with_glasses return result
Student: A grocery store is selling apples in bags. Each bag has 8 apples. If the store sold 60 bags of apples, how many apples did they sell in total?
def solve() -> int: bags = 60 apples_per_bag = 8 total_apples = bags * apples_per_bag result = total_apples return result
A construction company is building a 500 meter long fence around a site. If the fence posts are to be placed every 10 meters, how many fence posts will be needed?
def solve() -> int: distance = 500 interval = 10 num_posts = distance//interval result = num_posts return result
Student: Jack had 800 feet of string. He used 6-inch lengths of it to make 3 bracelets and then divided the remaining string into piles of 2 feet. How many piles of string did he get in the end?
def solve() -> int: string_length = 800 bracelet_length = 6 * 3 remaining_length = string_length - bracelet_length pile_length = 2 piles = remaining_length // pile_length result = piles return result
Student: Simon has 16 markers in his desk drawer. Zoe has half as many markers as Simon, and John has 5 times as many markers as Zoe. How many markers do Simon and John have combined?
def solve() -> int: markers_simon = 16 markers_zoe = markers_simon / 2 markers_john = markers_zoe * 5 markers_combined = markers_simon + markers_john result = markers_combined return result
In a box, there are 8 books in 6 different categories. How many different combinations of books can be chosen?
def solve() -> int: books = 8 categories = 6 combinations = books ** categories result = combinations return result
-Use the following tools:import numpy as np import sympy as sp Some possible questions are: A carton of eggs costs $4.50 and a loaf of bread costs $3.00. If Tamara wants to buy 3 cartons of eggs and 4 loaves of bread, how much will she pay?
def solve() -> int: eggs_cost = 4.5 bread_cost = 3 eggs_num = 3 bread_num = 4 total_cost = eggs_cost * eggs_num + bread_cost * bread_num result = total_cost return result
During spirit week, 10/12 students wear t-shirts for $14.50 each. How much money was collected for t-shirts during spirit week?
def solve() -> int: num_students = 10/12 cost_per_tshirt = 14.50 total_money_for_tshirts = num_students * cost_per_tshirt result = total_money_for_tshirts return result
Joe's income is $5000 per month. He pays $850.00 in rent, spends $300.00 on utilities, $800.00 on groceries, and $700.00 on car payment. How much money does he have left to save after covering these expenses?
def solve() -> int: income = 5000 rent = 850.00 utilities = 300.00 groceries = 800.00 car_payment = 700.00 total_expenses = rent + utilities + groceries + car_payment money_left = income - total_expenses result = money_left return result
Maria has the option of working at her current job for 8 hours a week with a wage of $12 per hour or taking a new job that pays $15 per hour for 4 hours a week with an additional bonus of $25 if she exceeds her weekly performance objective. If Maria is confident that she will exceed her performance objective, how much ...
def solve() -> int: current_hours = 8 current_wage = 12 new_hours = 4 new_wage = 15 bonus = 25 current_earnings = current_hours * current_wage new_earnings = new_hours * new_wage + bonus difference = new_earnings - current_earnings result = difference return result...
Annabelle wants to buy a new book. If she saves 5 dollars the first day and 15 more each day, how much will she have saved by the end of the second week?
def solve() -> int: savings_per_day = 5 additional_savings_per_day = 15 days_in_week = 7 weeks = 2 total_savings = savings_per_day + additional_savings_per_day * (days_in_week * weeks - 1) result = total_savings return result
A rectangle has a length of 15 inches and a width of 10 inches. What is the perimeter of the rectangle in inches?
def solve() -> int: length = 15 width = 10 perimeter = 2 * (length + width) result = perimeter return result
Eva buys 4 bags of chips. Each bag has 200 grams. She pays for the chips with a $5 bill. She gets $1 change. How much does each gram cost, in cents?
def solve() -> int: total_cost = 5 - 1 cost_per_bag = total_cost / 4 cost_per_gram = cost_per_bag / 200 cost_per_gram_in_cents = cost_per_gram * 100 result = cost_per_gram_in_cents return result
For a particular phone model, 25% of customers choose the black color, while 40% of customers opt for the extended warranty. What are the chances a customer chosen at random chooses the black phone color and does not get the extended warranty?
def solve() -> int: black_color = 0.25 extended_warranty = 0.4 prob = black_color * (1 - extended_warranty) result = prob return result
Mary had 70 beads in her jewelry making kit. She used one-fourth of the beads for making a necklace, used one-sixth of the remaining beads for making a bracelet, and gave away 4 beads to her friend. Later, her sister gifted her five times the number of beads she had left. How many beads does she have now?
def solve() -> int: beads = 70 necklace_beads = beads / 4 remaining_beads = beads - necklace_beads bracelet_beads = remaining_beads / 6 remaining_beads -= bracelet_beads remaining_beads -= 4 sister_gift = remaining_beads * 5 total_beads = remaining_beads + sister_gift result = total_...
If the difference between two numbers is 17, and their sum is 43, what are the two numbers?
def solve() -> int: difference = 17 sum = 43 second_number = (sum - difference) / 2 first_number = second_number + difference result = (first_number, second_number) return result
Lisa wants to go on a shopping spree. She can choose between a dress for $75 and a skirt for $50. How much will these two items cost her with a 20% discount for each item?
def solve() -> int: dress_price = 75 skirt_price = 50 dress_discount = dress_price * 0.2 skirt_discount = skirt_price * 0.2 dress_final_price = dress_price - dress_discount skirt_final_price = skirt_price - skirt_discount total_cost = dress_final_price + skirt_final_price ...
If Emma bought 12 cupcakes for $6.00, how much will 15 cupcakes cost?
def solve() -> int: cupcakes_bought = 12 cost = 6.00 cost_per_cupcake = cost / cupcakes_bought total_cost = cost_per_cupcake * 15 result = total_cost return result
David goes to the movies twice a week. He buys a ticket for $12 and he gives the ticket-taker a $3 tip each time. Then once a month he rents a new release for $30. How much does he spend on movies and rentals per month?
def solve() -> int: movies_per_week = 2 ticket_price = 12 tip = 3 rental_price = 30 movies_per_month = movies_per_week * 4 total_ticket_price = movies_per_month * (ticket_price + tip) total_rental_price = rental_price total_spending = total_ticket_price + total_rental_price ...
Hannah is making lemonade for a party. She needs 9 cups of water and 3 cups of lemon juice for every gallon of lemonade. If Hannah has 15 cups of water and 6 cups of lemon juice, how many gallons of lemonade can she make?
def solve() -> int: water_gallons = 15 / 16 juice_gallons = 6 / 16 ratio_water = water_gallons / 9 ratio_juice = juice_gallons / 3 ratio_min = min(ratio_water, ratio_juice) lemonade_gallons = ratio_min * (9 + 3) result = lemonade_gallons return result
In a pet store, there were 30 dogs and 50 cats. If each dog ate 2 cups of dog food per day and each cat ate 1 cup of cat food per day, how many cups of pet food are needed in a week?
def solve() -> int: number_of_days = 7 dogs = 30 cats = 50 dog_food_per_day = 2 cat_food_per_day = 1 total_dog_food = number_of_days * dogs * dog_food_per_day total_cat_food = number_of_days * cats * cat_food_per_day total_food = total_dog_food + total_cat_food result = total_food ...
Tom needs to paint his bedroom, which has four walls of equal size. Each wall takes up 120 square feet, and one gallon of paint covers 400 square feet. How many gallons of paint does Tom need?
def solve() -> int: wall_size = 120 total_size = wall_size * 4 paint_coverage = 400 gallons_of_paint = total_size / paint_coverage result = gallons_of_paint return result
Jaxon ran for 10 miles, while Tyler ran for 7.5 miles. How many miles more did Jaxon run than Tyler?
def solve() -> int: jaxon_miles = 10 tyler_miles = 7.5 difference = jaxon_miles - tyler_miles result = difference return result
In a park, there are 300 visitors. 45 percent of them are children or teenagers. 1/8 of the children and teenagers brought snacks. How many children and teenagers didn't bring any snacks?
def solve() -> int: total_visitors = 300 children_and_teenagers = total_visitors * 0.45 snacks_brought = children_and_teenagers / 8 children_and_teenagers_without_snacks = children_and_teenagers - snacks_brought result = children_and_teenagers_without_snacks return result
There were three friends who decided to split a pizza equally. Each person ate 1/4 of the pizza. If the pizza cost $12, calculate how much each friend should pay, including a 10% tip.
def solve() -> int: pizza_cost = 12 tip_percentage = 0.1 pizza_slices = 4 total_slices = 3 * pizza_slices total_cost = (pizza_cost * (1 + tip_percentage)) / total_slices result = round(total_cost, 2) return result
If a tire rotates 1500 times in a mile, how many times will it rotate in 0.25 miles?
def solve() -> int: rotations_in_mile = 1500 distance = 0.25 rotations_in_quarter_mile = rotations_in_mile * distance result = rotations_in_quarter_mile return result