question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
In a group of 30 people, 21 of them have brown eyes and the rest have green eyes. What is the ratio of people with brown eyes to people with green eyes?
def solve() -> int: brown_eyed_people = 21 green_eyed_people = 30 - brown_eyed_people ratio = brown_eyed_people/green_eyed_people result = ratio return result
A rectangle has a length of 12 inches and a width of 5 inches. What is the area of the rectangle? What is the perimeter of the rectangle?
def solve() -> int: length = 12 width = 5 area = length * width perimeter = 2 * (length + width) result = area, perimeter return result
A store sells shirts for $15 each or 2 for $25. If someone buys 3 shirts, how much will they cost?
def solve() -> int: cost_1 = 15*3 cost_2 = 25 + 15 total = cost_1 if cost_1 < cost_2 else cost_2 result = total return result
Leo is a farmer. He has 60 chickens and 40 cows. He sells eggs for $0.2 each and milk for $1.5 per liter. He collects 10 eggs from each chicken and 20 liters of milk from each cow in a month. How much money does he make in a month?
def solve() -> int: chickens = 60 cows = 40 egg_price = 0.2 milk_price = 1.5 eggs_per_chicken = 10 milk_per_cow = 20 eggs = chickens * eggs_per_chicken milk = cows * milk_per_cow egg_money = eggs * egg_price milk_money = milk * milk_price money = egg_money + milk_money re...
-Some rules: * Use different numbers and fractions in each question, do not repeat the same values * Use different contexts and scenarios in each question, do not repeat the same theme * Use different operations and expressions in each question, do not limit yourself to only multiplication and division * Make sure the ...
def solve() -> int: total_slices = 4 * 8 slices_eaten = 3/4 * total_slices slices_per_friend = slices_eaten / 12 result = round(slices_per_friend, 2) return result
Mike and Sarah have 32 pencils together. If Sarah has 4 more pencils than Mike, how many pencils does Mike have?
def solve() -> int: mike_pencils = (32 - 4) / 2 result = mike_pencils return result
Possible questions and programs: There are 16 boys and 12 girls in a club. Each boy has 4 badges and each girl has 6 badges. How many badges are there in the club?
def solve() -> int: badges_for_boys = 16 * 4 badges_for_girls = 12 * 6 total_badges = badges_for_boys + badges_for_girls result = total_badges return result
Some possible new questions are: Mrs. Lee's class is going to a zoo for a field trip. She has 36 students in her class, and 3/8 of them are boys. She also has two parent volunteers and a driver to accompany them. How many people are on the bus in total?
def solve() -> int: boys = 3/8 * 36 girls = 36 - boys people = boys + girls + 2 + 1 + 1 result = people return result
A company of 20 employees shared 600 pens equally among themselves. However, 15 pens were found to be faulty and had to be thrown away. How many pens less will each employee get now than if no pen had to be thrown away?
def solve() -> int: total_pens = 600 pens_per_employee = total_pens / 20 faulty_pens = 15 usable_pens = total_pens - faulty_pens usable_pens_per_employee = usable_pens / 20 result = pens_per_employee - usable_pens_per_employee return result
A travel agency offers a package deal of $1000 per person for a 5-day trip to France. If a family of 4 spent $15000 for the trip, how much did the travel agency charge for each additional day?
def solve() -> int: additional_cost_per_day = (15000-(4*1000*5))/4/2 result = additional_cost_per_day return result
If he wants the pyramid to have a base of 10 cubes, how many stacks of 1 inch cubes will he need to build the pyramid?
def solve() -> int: total_stacks = 0 large_cube_size = 2 small_cubes_size = 1 base_cubes = 10 total_stacks = (base_cubes * (large_cube_size**2)) // (small_cubes_size**2) result = total_stacks return result
Student: Zara and John went to the store to buy pizza dough. Zara bought twice as much dough as John. Together, they bought 12 kilograms of dough. How much dough did Zara buy?
def solve() -> int: zara_dough = 0 john_dough = 0 total_dough = 12 john_dough = total_dough / 3 zara_dough = john_dough * 2 result = zara_dough return result
Possible new questions are: Amy has a jar of 120 candies. She gives 20% of them to her friend Ben. Then she eats 12 candies herself. How many candies are left in the jar?
def solve() -> int: candies_to_ben = 0.2 * 120 candies_after_giving = 120 - candies_to_ben candies_after_eating = candies_after_giving - 12 result = candies_after_eating return result
Tom has $170 for buying plants for his garden. He wants to buy twelve flowering plants for $8 each, seven more herbs than flowering plants for $5 each, and four times as many succulents as flowering plants for $3 each. If he also wants to buy soil, how much money can he spend on it?
def solve() -> int: num_flowering_plants = 12 num_herbs = num_flowering_plants + 7 num_succulents = num_flowering_plants * 4 cost_flowering_plants = 8 cost_herbs = 5 cost_succulents = 3 total_money = 170 cost_total_plants = (num_flowering_plants * cost_flowering_plants) + (num_herbs...
A swimming pool is 25 meters long, 10 meters wide, and 2 meters deep. How many cubic meters of water are needed to fill the pool?
def solve() -> int: length = 25 width = 10 depth = 2 volume = length * width * depth result = volume return result
Student: Katie wants to practice an average of 1 hour of violin a day. On Monday, she practiced for 45 minutes, on Tuesday she practiced for 1 hour and 15 minutes, on Wednesday she practiced for 1 hour and 5 minutes, and on Thursday she practiced for 50 minutes. She didn't practice at all on Friday. How many minutes do...
def solve() -> int: monday = 45 tuesday = 75 wednesday = 65 thursday = 50 friday = 0 total = monday + tuesday + wednesday + thursday + friday average = total / 5 difference = 60 - average saturday = difference * 2 result = saturday return result
Emma bought 4 packs of stickers, each with 12 stickers in them. She gave 3 packs to her friends and kept the fourth. Her friends each gave 4 stickers to their siblings. How many stickers did Emma have left?
def solve() -> int: packs_of_stickers = 4 stickers_per_pack = 12 friends_packs = 3 stickers_given_to_siblings = 4 total_stickers = packs_of_stickers * stickers_per_pack stickers_given_away = friends_packs * stickers_per_pack stickers_given_away_to_siblings = friends_packs * stickers_giv...
Alex said he would sell 4 more cupcakes per hour than Lisa did. Lisa sold 36 cupcakes in 3 hours. How many cupcakes did they sell together in 5 hours?
def solve() -> int: lisa_hourly = 36 / 3 alex_hourly = lisa_hourly + 4 total = (lisa_hourly + alex_hourly) * 5 result = total return result
Jake baked 48 dozen cupcakes for a school fundraiser. He then set aside 10% of the cupcakes for his coworkers. If he divided the remaining cupcakes equally among 200 students, how many cupcakes did each student receive?
def solve() -> int: dozen_cupcakes = 48 total_cupcakes = dozen_cupcakes * 12 cupcakes_for_coworkers = total_cupcakes * 0.1 remaining_cupcakes = total_cupcakes - cupcakes_for_coworkers cupcakes_per_student = remaining_cupcakes / 200 result = cupcakes_per_student return result
Possible Questions: Jessica has 12 apples and 8 oranges. She wants to make fruit salads for her friends. Each fruit salad needs 3 apples and 2 oranges. How many fruit salads can Jessica make?
def solve() -> int: apples = 12 oranges = 8 salad_apples = 3 salad_oranges = 2 salads = min(apples // salad_apples, oranges // salad_oranges) result = salads return result
Mary has 40 apple trees in her orchard. Each tree produces 100 apples. If she sells 60% of the apples to the local market, donates 10% to charity, and uses 20% to make apple pies, how many apples does she have left to store in her barn?
def solve() -> int: total_apples = 40 * 100 market_apples = total_apples * 0.6 charity_apples = total_apples * 0.1 pie_apples = total_apples * 0.2 remaining_apples = total_apples - market_apples - charity_apples - pie_apples result = remaining_apples return result
A class has 25 students. Each student scored an average of 85 on the math test. What is the total score of all students combined?
def solve() -> int: number_of_students = 25 average_score = 85 total_score = number_of_students * average_score result = total_score return result
Karen has 12 dimes and nickels worth $1.05. How many nickels does she have?
def solve() -> int: num_dimes = 12 total_value = 1.05 result = "There are multiple solutions" return result
Aisha reads 5 books per week. How many books will she have read in 10 weeks?
def solve() -> int: total_books = 0 for i in range(10): total_books = total_books + 5 result = total_books return result
3. Harry bought some fruits and vegetables. The fruits cost $26.40 and the vegetables cost $33.50. How much did he spend in total?
def solve() -> int: cost_of_fruits = 26.40 cost_of_vegetables = 33.50 total_cost = cost_of_fruits + cost_of_vegetables result = total_cost return result
Molly has 80 stickers and wants to split them equally between herself and her 6 friends. How many stickers will each person get?
def solve() -> int: stickers = 80 num_friends = 6 total_people = num_friends + 1 stickers_per_person = stickers / total_people result = stickers_per_person return result
Student: The perimeter of a square is 28 meters. What is the length of one side of the square?
def solve() -> int: perimeter = 28 side_length = perimeter / 4 result = side_length return result
There are 56 students in a class. 30% of them are wearing blue shirts, and 25% are wearing green shirts. How many students are wearing neither blue nor green shirts?
def solve() -> int: total_students = 56 blue_shirt_percent = 30 green_shirt_percent = 25 neither_percent = 100 - blue_shirt_percent - green_shirt_percent neither_students = neither_percent / 100 * total_students result = neither_students return result
A company has 450 employees, 60% of them are women and rest are men. How many men work in the company?
def solve() -> int: women_in_company = 450 * 0.60 men_in_company = 450 - women_in_company result = men_in_company return result
A train travels 75 miles per hour. If the train travels for 3 hours, how far does it travel?
def solve() -> int: speed_in_mph = 75 time_in_hours = 3 distance_traveled = speed_in_mph*time_in_hours result = distance_traveled return result
Mark just turned 29, the same year as Ashley turned 42. Sebastian is 16 years less than three times Ashley’s age. How old is Sebastian, if Mark is 32?
def solve() -> int: mark_age = 32 ashley_age = 42 - (mark_age - 29) sebastian_age = 3 * ashley_age - 16 result = sebastian_age return result
A local doctor is paying 8 nurses to help vaccinate patients. Every vaccine requires 1 syringe. A box of syringes contains 50 syringes and you need 4 boxes. He pays the nurses $2 per vaccine. Afterward, the nurses are so tired that they end up spending half their money on coffee. The coffee cost $5 per nurse. How many ...
def solve() -> int: nurses = 8 syringes_per_vaccine = 1 syringes_per_box = 50 boxes_needed = 4 cost_per_vaccine = 2 coffee_cost_per_nurse = 5 total_syringes_needed = nurses * syringes_per_vaccine total_boxes_needed = total_syringes_needed / syringes_per_box result = total_b...
A soccer field is 120 meters by 80 meters. If the goal boxes are each 18 meters long, what area will be left over for the field?
def solve() -> int: length = 120 width = 80 goal_box_length = 18 total_goal_box_area = (goal_box_length * 2) * (length + width) total_field_area = length * width total_area_left_over = total_field_area - total_goal_box_area result = total_area_left_over return result
If a crab has four times the number of legs a lobster has, and a lobster has twice the number of legs a shrimp has, how many legs does the crab have?
def solve() -> int: shrimp_legs = 8 lobster_legs = shrimp_legs * 2 crab_legs = lobster_legs * 4 result = crab_legs return result
6. The price of 9 pencils is 36 dollars. If the price of one pencil is half of the price of the nine pencils, how much is the price of one pencil?
def solve() -> int: TotalPrice = 36 Priceof9Pencils = TotalPrice Priceof1Pencil = Priceof9Pencils/2 result = Priceof1Pencil return result
John and Nick's whole family travelled to Shanghai for vacation. During their visit to Shanghai Tower, the combined height of John and Nick is 298 centimeters, while the height of John alone is 26 centimeters more than the height of Nick. What is the height of Nick?
def solve() -> int: heightJohn = 298 heightFamily = heightJohn heightNick = heightFamily - (heightJohn-26) result = heightNick return result
Jenny has a jar of coins that contains 20 quarters, 15 dimes, 10 nickels, and 5 pennies. She wants to use the coins to buy a toy that costs $7.25. How many coins does she need to take out of the jar to buy the toy?
def solve() -> int: quarter = 0.25 dime = 0.10 nickel = 0.05 penny = 0.01 total_value = 20 * quarter + 15 * dime + 10 * nickel + 5 * penny cost_of_toy = 7.25 remaining_value = total_value - cost_of_toy coins = 0 while remaining_value > 0: if remaining_value >= quarter: ...
Jason wants to buy a new car and he is willing to pay up to $35,000. He found a car for $29,000 and was offered a discount of 10%. How much money did Jason save by purchasing this car instead of one for the full $35,000?
def solve() -> int: original_price = 35000 discounted_price = 29000 * 0.9 savings = original_price - discounted_price result = savings return result
A grocery store sold 30 apples and 25 oranges. If an apple cost $2, and an orange costs $3, how much did the store receive?
def solve() -> int: price_of_apple = 2 number_of_apples = 30 price_of_orange = 3 number_of_oranges = 25 total_price_apples = price_of_apple * number_of_apples total_price_oranges = price_of_orange * number_of_oranges total_price = total_price_apples + total_price_oranges r...
-(Optional: provide comments in the program to explain the logic. ) Some possible questions and programs are: Helen baked 36 blueberry muffins and 48 strawberry muffins for a bake sale. Each muffin had 6 blueberries or 6 strawberries on top. She sold 3 out of every 4 muffins. How many blueberries and strawberries were ...
def solve() -> int: blue_muffins = 36 blue_berries = 6 straw_muffins = 48 straw_berries = 6 total_berries = blue_muffins * blue_berries + straw_muffins * straw_berries sold_fraction = 3 / 4 sold_berries = total_berries * sold_fraction left_berries = total_berries - sold_berries resul...
A cell phone company charges $50 per month for their unlimited plan and $25 per month for their basic plan. If a customer wants to sign up for a year, how much money will they save if they choose the basic plan instead of the unlimited plan?
def solve() -> int: basic_plan = 25 unlimited_plan = 50 no_of_months = 12 basic_plan_total = basic_plan * no_of_months unlimited_plan_total = unlimited_plan * no_of_months savings = unlimited_plan_total - basic_plan_total result = savings return result
Result: $23 Lily spent 2 hours reading every day for 5 days. Samantha spent 1.5 hours reading every day for 7 days. How many more hours did Lily spend reading than Samantha?
def solve() -> int: hoursLily = 2 daysLily = 5 totalHoursLily = hoursLily * daysLily hoursSamantha = 1.5 daysSamantha = 7 totalHoursSamantha = hoursSamantha * daysSamantha differenceHours = totalHoursLily - totalHoursSamantha result = differenceHours return result
Student: A recipe needs 2 cups of flour and 3 eggs. If I want to make 6 cups of flour, how many eggs do I need?
def solve() -> int: flour_needed = 6 flour_per_egg = 2/3 eggs_needed = flour_needed * flour_per_egg result = eggs_needed return result
Bill has 20 jelly beans and gives away 3 to his brother. How many jelly beans does Bill have left?
def solve() -> int: x = 20 y = 3 Bill_jellybeans_left = x - y result = Bill_jellybeans_left return result
Isabel wants to buy 2 dresses, one costs $25 and the other costs $30. She has a discount coupon of 15% and will have to pay 10% sales tax. How much does she have to pay altogether?
def solve() -> int: dress1 = 25 dress2 = 30 discount = 0.15 tax = 0.1 subtotal = (dress1 + dress2) * (1-discount) total_cost = subtotal * (1+tax) result = total_cost return result
In a group of 30 students, 20 of them play basketball and 15 of them play soccer. How many students in the group play both soccer and basketball?
def solve() -> int: num_students = 30 basketball_players = 20 soccer_players = 15 both_sports_players = basketball_players + soccer_players - num_students result = both_sports_players return result
The sum of three consecutive even integers is 114. Find these integers.
def solve() -> int: sum_of_integers = 114 middle_integer = sum_of_integers/3 first_integer = middle_integer - 2 third_integer = middle_integer + 2 result = first_integer, middle_integer, third_integer return result
Alex has $3200 in his bank account. If he saves $450 every month, how many months will it take for him to have $8000 in his account?
def solve() -> int: account_balance = 3200 monthly_savings = 450 target_balance = 8000 months = (target_balance - account_balance) / monthly_savings result = months return result
Student: Bob starts with $20. He spends $7.50 on lunch, and then earns $15 from mowing a lawn. He spends $3.50 on candy. How much money does Bob have now?
def solve() -> int: start_amount = 20 lunch_cost = 7.50 earning = 15 candy_cost = 3.50 total_amount = start_amount + earning - lunch_cost - candy_cost result = total_amount return result
Damian drives 30 miles to work each day. If he works 5 days a week and takes 2 weeks off in a year, how many miles does he drive to work in a year?
def solve() -> int: days_worked = 5 * 50 days_off = 2 * 5 miles_per_year = (days_worked - days_off) * 30 result = miles_per_year return result
Steven is a painter who needs to paint 3 bedrooms. It takes him 2 hours to paint each bedroom. How long will it take him to paint all 3 bedrooms?
def solve() -> int: bedrooms = 3 time_per_bedroom = 2 total_time = bedrooms * time_per_bedroom result = total_time return result
Ella has twice as many bags as Zoe who has 4 fewer bags than Sarah. After Ella gave 6 bags to Zoe, Sarah had 14 bags left. How many bags did Ella have at the beginning?
def solve() -> int: sarah_bags = 14 zoe_bags = sarah_bags + 4 ella_bags = 2 * zoe_bags ella_bags -= 6 result = ella_bags return result
A school has 3 sections, with 30 students in each section. If a student from each section was selected to participate in a competition, how many students were selected in total?
def solve() -> int: students_per_section = 30 sections = 3 selected_students = sections result = selected_students return result
A store orders 60 boxes of pens. Each box contains 24 pens. If 10 of the boxes have an extra black pen inside, how many black pens does the store have in total?
def solve() -> int: boxes_ordered = 60 pens_per_box = 24 extra_pens = 10 total_pens = boxes_ordered * pens_per_box + extra_pens result = total_pens return result
Student: How many pieces of cake did Vince eat if he had 16 pieces, ate 4 and gave away 2?
def solve() -> int: pieces_of_cake = 16 ate = 4 gave_away = 2 pieces_Vince_ate = pieces_of_cake - ate - gave_away result = pieces_Vince_ate return result
Mario has to drive 10 miles. It takes him a quarter of the time to drive the first 5 miles, and half the remaining time for the last 5 miles. How long does it take Mario in total to drive 10 miles?
def solve() -> int: time_driving1 = 0.25 time_driving2 = 0.50 total_distance = 10 result = time_driving1 * (total_distance/2) + time_driving2 * (total_distance/2) return result
Aaron has 16 cookies. Lily gives Aaron double the number he has. Aaron then gives Lily back one-quarter of his new total plus 3. How many cookies does Aaron have now?
def solve() -> int: aaron_cookies = 16 lily_cookies = aaron_cookies * 2 new_total = aaron_cookies + lily_cookies aaron_gives_back = new_total / 4 + 3 aaron_cookies = new_total - aaron_gives_back result = aaron_cookies return result
A bakery sold 50 donuts in the morning, 75 donuts in the afternoon, and 30 donuts in the evening. What was the average number of donuts sold per hour in a 12-hour day?
def solve() -> int: total_donuts = 50 + 75 + 30 num_hours = 12 avg_donuts_per_hour = total_donuts / num_hours result = avg_donuts_per_hour return result
David is making a pizza with pepperoni, mushrooms, and olives in a 2 : 3 : 6 ratio. If he uses 10 ounces of mushrooms, how many ounces of toppings does he use in total?
def solve() -> int: pepperoni_ratio = 2 mushrooms_ratio = 3 olives_ratio = 6 mushrooms_ounces = 10 total_ratio = pepperoni_ratio + mushrooms_ratio + olives_ratio mushrooms_portion = mushrooms_ratio / total_ratio total_portion = 1 / total_ratio total_ounces = mushrooms...
Student: John and Alice went to a restaurant and spent the same amount. John ordered a steak for $25 and a dessert for $8. Alice ordered a hamburger for $10, a salad for $7 and a drink for $3. How much did the drink cost?
def solve() -> int: john_steak = 25 john_dessert = 8 alice_hamburger = 10 alice_salad = 7 alice_drink = 3 total_john = john_steak + john_dessert total_alice = alice_hamburger + alice_salad + alice_drink total_spent = total_john + total_alice alice_drink = total_spent - (total_john - ...
-If you are using Python 3, use a "/" for division. If you are using Python 2, use "//" for division to get an integer result. Possible questions and programs: A train travels at a constant speed of 60 miles per hour. How long will it take to cover a distance of 450 miles?
def solve() -> int: distance = 450 speed = 60 time = distance / speed result = time return result
Henry has $150. He wants to buy 4 shirts, each costing $25. He also wants to buy 2 pants, each costs $35. How much money will he have left after the purchases?
def solve() -> int: money = 150 shirts_cost = 25 pants_cost = 35 no_of_shirts = 4 no_of_pants = 2 total_shirts_cost = shirts_cost * no_of_shirts total_pants_cost = pants_cost * no_of_pants total_cost = total_shirts_cost + total_pants_cost remaining_money = money - total_cost resu...
A store sells a dress for $45 and they have a 15% discount on all dresses. What is the final price of the dress?
def solve() -> int: original_price = 45 discount_percentage = 0.15 discount_amount = original_price * discount_percentage final_price = original_price - discount_amount result = final_price return result
``` John spent $130 on 5 movies tickets. Two of the tickets cost $40 each, and the remaining three tickets cost the same amount. What is the cost of each of these remaining three tickets?
def solve() -> int: total_cost = 130 cost_of_2_tickets = 40 * 2 cost_of_3_tickets = total_cost - cost_of_2_tickets cost_of_each_3_ticket = cost_of_3_tickets / 3 result = cost_of_each_3_ticket return result
A group of friends ordered 4 pizzas. If each pizza has 8 slices, and each friend eats 3 slices, how many friends are needed to finish the pizzas?
def solve() -> int: total_pizzas = 4 slices_per_pizza = 8 total_slices = total_pizzas * slices_per_pizza slices_per_friend = 3 friends_needed = total_slices // slices_per_friend result = friends_needed return result
A recipe for cookies requires 200 grams of flour, 100 grams of butter, and 50 grams of sugar. How many cookies can be made with 1.2 kilograms of flour, 800 grams of butter, and 400 grams of sugar? Assume that each cookie has the same amount of ingredients.
def solve() -> int: cookie_weight = 200 + 100 + 50 cookies_with_flour = 1200 / 200 cookies_with_butter = 800 / 100 cookies_with_sugar = 400 / 50 cookies = min(cookies_with_flour, cookies_with_butter, cookies_with_sugar) result = cookies return result
Omar went to the store and bought 10 toys. Each toy weighed 1kg. He put the toys in a bag and the bag weighed 50g more than the total weight of the toys. How much does the bag weigh?
def solve() -> int: toy = 10 * 1000 bag = toy + 50 result = bag return result
ome possible new questions and programs are: Lisa is baking cakes for a fundraiser. Each cake requires 3 eggs, 2 cups of flour, and 1.5 cups of sugar. If Lisa has 36 eggs, 24 cups of flour, and 30 cups of sugar, how many cakes can she bake?
def solve() -> int: eggs = 36 / 3 flour = 24 / 2 sugar = 30 / 1.5 result = min(eggs, flour, sugar) return result
A bag of candy weighs 1.5 pounds. Each piece of candy weighs 0.03 pounds. How many pieces of candy are in the bag?
def solve() -> int: pieces = 1.5 / 0.03 result = pieces return result
What is the sum of the cube of seven and the cube of four?
def solve() -> int: x = 7 y = 4 cube_of_x = x**3 cube_of_y = y**3 result = cube_of_x + cube_of_y return result
``` Mark has a coupon for 30% off his entire purchase at a store. If he spends $120.00 before the discount, how much will Mark save?
def solve() -> int: original_price = 120.0 discount = 0.3 amount_saved = original_price * discount result = amount_saved return result
A coffee shop sells muffins for $2.50 each and coffee for $3.00 per cup. If John buys 2 muffins and 1 coffee, how much will it all cost him?
def solve() -> int: num_muffins = 2 muffin_price = 2.5 num_coffees = 1 coffee_price = 3 total_cost = (num_muffins * muffin_price) + (num_coffees * coffee_price) result = total_cost return result
Student: The Pet Palace store had 27 customers on Thursday and 28 customers on Friday. If each customer spent an average of $40.50, and sale tax was 8%, how much money did the store have at the end of the two days?
def solve() -> int: customers_thursday = 27 customers_friday = 28 average_spent = 40.50 tax_rate = 0.08 total_spent_thursday = customers_thursday * average_spent total_spent_friday = customers_friday * average_spent total_spent = total_spent_thursday + total_spent_friday tax_amount = tot...
5. Kenneth earns 4 dollars more an hour than his colleague Tom. If Tom worked for 7 hours a day for 2 weeks, how much does Kenneth make?
def solve() -> int: salary_tom = 4 hours = 7 days = 14 salary_kenneth = salary_tom + 4 * hours * days result = salary_kenneth return result
You have 2 notes, each worth 100 dollars, and 5 coins, each worth 50 cents. How much do you have in dollars and cents?
def solve() -> int: note_cost = 100 coin_cost = 0.5 num_notes = 2 num_coins = 5 total_cost = note_cost * num_notes + coin_cost * num_coins result = total_cost return result
Student: Sienna wanted to make soup and she decided to use 3 tomatoes, 2 onions, 1 celery root, 4 cups of stock, and 1 and a half cloves of garlic. How many total ingredients did Sienna use?
def solve() -> int: tomatoes = 3 onions = 2 celery_root = 1 stock = 4 garlic = 1.5 total_ingredients = tomatoes + onions + celery_root + stock + garlic result = total_ingredients return result
Nine bottles contained a total of 18 liters of juice. The first bottle contained 2 liters of juice. The second bottle contained 0.5 liters less than the first bottle. The third bottle contained 0.5 liters more than the second bottle. The fourth bottle contained the same amount of juice as the third bottle. The fifth bo...
def solve() -> int: total = 18 first = 2 second = first - 0.5 third = second + 0.5 fourth = third fifth = fourth - 0.25 sixth = fifth + 0.25 remaining = total - first - second - third - fourth - fifth - sixth each = remaining / 3 result = each return resu...
A museum has 5 exhibit halls. Each hall has 10 displays, except for the final hall which only has 7 displays. How many displays are in the museum?
def solve() -> int: hall_1_displays = 10 hall_2_displays = 10 hall_3_displays = 10 hall_4_displays = 10 hall_5_displays = 7 total_displays = hall_1_displays + hall_2_displays + hall_3_displays + hall_4_displays + hall_5_displays result = total_displays return result
James wants to buy a new phone which costs $1000.00. There is a sale of 15% off on the phone. James also wants to add a phone case which costs $50.00 extra. The shipping fee is $35.00. What is the total cost of the phone and phone case? Five years ago, Jane was half the age of her mother. If her mother is now 50, how o...
def solve() -> int: phone_cost = 1000.00 discount = 0.15 phone_case_cost = 50.00 shipping_fee = 35.00 discount_amount = phone_cost * discount total_cost = phone_cost - discount_amount + phone_case_cost + shipping_fee mother_age = 50 jane_age = (mother_age - 5) / 2 resu...
Jane spent $150 on groceries last month. If she wants to reduce her spending by 10%, how much should she try to spend this month?
def solve() -> int: amount_spent_last_month = 150 reduction_percentage = 10 reduction_rate = reduction_percentage / 100 new_target = amount_spent_last_month * (1 - reduction_rate) result = new_target return result
Oliver has 180 pennies. Oliver gives 30 pennies to Sophia, and he gives twice as many pennies to Ava as he gave to Sophia. How many more pennies does Ava have than Sophia?
def solve() -> int: oliver_pennies = 180 sophia_pennies = 30 ava_pennies = 2 * sophia_pennies difference = ava_pennies - sophia_pennies result = difference return result
Student: Two men starting at the same place walk in opposite directions, one at the rate of 4 miles per hour and the other 3 miles per hour. In how many hours will they be 25 miles apart?
def solve() -> int: distance = 25 speed1 = 4 speed2 = 3 time = distance / (speed1 + speed2) result = time return result
Tim needs to get a new phone that costs $500. He can make a $250 down payment and pay the rest over 12 monthly installments with an interest rate of 5%. What is his monthly payment?
def solve() -> int: price = 500 down_payment = 250 installments = 12 interest_rate = 0.05 total_cost = price - down_payment monthly_interest_rate = interest_rate / installments monthly_payment = (total_cost * monthly_interest_rate) / (1 - (1 + monthly_interest_rate) ** -installments) res...
A pizza place makes 14-inch pizzas that cost $12 each. A 10-inch pizza costs $7. How much money would a person save by ordering three 10-inch pizzas instead of two 14-inch pizzas?
def solve() -> int: pizza1_radius = 7 pizza2_radius = 10 pizza1_cost = 12 pizza2_cost = 7 area1 = 3.14 * pizza1_radius**2 area2 = 3.14 * pizza2_radius**2 total_area1 = area1 * 2 total_area2 = area2 * 3 total_cost1 = pizza1_cost * 2 total_cost2 = pizza2_cost * 3 savings = tota...
A theme park charges $50 for admission and $20 for a fast pass. A group of 15 people goes to the theme park and buys fast passes, while a group of 8 people only goes to the theme park. How much does the theme park earn?
def solve() -> int: admission_price = 50 fast_pass_price = 20 group1_size = 15 group2_size = 8 group1_cost = group1_size * (admission_price + fast_pass_price) group2_cost = group2_size * admission_price total_earnings = group1_cost + group2_cost result = total_earnings ...
An event venue charges $500 to rent their space. They also charge $10 per person for food. If 75 people attend the event, how much will it cost in total?
def solve() -> int: num_people = 75 cost_per_person = 10 space_rental_cost = 500 total_cost = space_rental_cost + num_people * cost_per_person result = total_cost return result
Ali is making a smoothie with a 16-ounce packet of strawberries, a 10-ounce banana, and 4 ounces of blueberries. He then added 12-ounce milk and six pieces of ice cubes, each weighing 2 ounces. What is the total weight of his smoothie?
def solve() -> int: strawberries = 16 banana = 10 blueberries = 4 milk = 12 ice_cubes = 6 ice_cubes_weight = 2 total_weight = strawberries + banana + blueberries + milk + (ice_cubes * ice_cubes_weight) result = total_weight return result
Student: Taylor has 12 notebooks, each of which has 60 pages. If Taylor buys an additional 8 notebooks and then gives away 5 to her friend, how many more pages does she have than her friend?
def solve() -> int: notebooks_original = 12 pages_per_notebook = 60 notebooks_bought = 8 notebooks_given_away = 5 notebooks_total = notebooks_original + notebooks_bought - notebooks_given_away pages_total = notebooks_total * pages_per_notebook pages_friend = (notebooks_original - notebooks_g...
Dan and Ben are twins. Dan is 5 cm taller than Ben. The sum of their heights is 295 cm. How tall are Dan and Ben?
def solve() -> int: x = 145 y = 150 result = x, y return result
Sarah and Sam each brought 5 bags of marbles to school. If each bag has 60 marbles, how many total marbles did they bring?
def solve() -> int: sarah_bags = 5 sam_bags = 5 marbles_per_bag = 60 sarah_total_marbles = sarah_bags * marbles_per_bag sam_total_marbles = sam_bags * marbles_per_bag total_marbles = sarah_total_marbles + sam_total_marbles result = total_marbles return result
Student: Peter was given $20 to buy chocolates for his class. If the cost per chocolate was 5 cents, how many chocolates could he buy?
def solve() -> int: cost_per_chocolate = 0.05 total_money = 20 total_chocolates = total_money // cost_per_chocolate result = total_chocolates return result
A bucket of water weighs 12 kgs. If 20% of the water evaporates, how much does the bucket of water weigh now?
def solve() -> int: bucket_weight = 12 evaporated_weight = bucket_weight * 0.2 new_bucket_weight = bucket_weight - evaporated_weight result = new_bucket_weight return result
Mary is saving money for a new bicycle. On the first day, she saves $5. Every day after that, she saves $2 more than the previous day. How much money will Mary have saved after 10 days?
def solve() -> int: savings = 5 for day in range(1, 10): savings += 5 + (day * 2) result = savings return result
Robert needs to buy 12 cans of soda to sell at his store. Each can contains 12 ounces. How many ounces will he need to buy?
def solve() -> int: cans = 12 ounces_per_can = 12 total_ounces = cans * ounces_per_can result = total_ounces return result
Student: A soccer team has 25 players and 4 of them are coaches. How many players are there on the team?
def solve() -> int: total_players = 25 coaches = 4 players = total_players - coaches result = players return result
Student: If there are 14 people in a room and the ratio of men to women is 2:3, how many women are in the room?
def solve() -> int: num_people = 14 ratio_men = 2 ratio_women = 3 num_men = num_people * (ratio_men / (ratio_men + ratio_women)) num_women = num_people - num_men result = num_women return result
A garden has 24 rows of flowers. Each row has 15 flowers. Half of the flowers are roses and the other half are tulips. How many roses are there in the garden?
def solve() -> int: total_flowers = 24 * 15 roses = total_flowers / 2 result = roses return result
William has $500 to spend on clothes. He wants to buy as many t-shirts as possible for $20 each and use the rest of the money to buy jeans that cost $45 each. How many t-shirts and jeans can he buy?
def solve() -> int: max_tshirts = 500 // 20 remaining_money = 500 % 20 jeans_cost = 45 max_jeans = remaining_money // jeans_cost result = (max_tshirts, max_jeans) return result
In a shoe store, there are 40 sneakers and 30 sandals. If 5 pairs of sneakers are bought and 7 sandals are returned, what percent of the remaining objects are sneakers?
def solve() -> int: sneakers = 40 sandals = 30 total_objects_before = sneakers + sandals sneakers_after = sneakers - 5 sandals_after = sandals + 7 total_objects_after = sneakers_after + sandals_after percentage_sneakers = (sneakers_after / total_objects_after) * 100 ...
Kate had $100 and spent 1/6 of it on a camera. She then spent $35 on a jacket and had $33 left. How much money did she spend on the camera?
def solve() -> int: total_money = 100 spent_on_camera =... money_left =... result = spent_on_camera return result