question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A salesperson worked for 4 years and 5 months in a retail store and 1 year and 9 months in a car dealership. How many months of work experience does he have in total?
def solve() -> int: total_months = 4*12 + 5 + 1*12 + 9 result = total_months return result
Jane ran for 20 minutes on Monday and Wednesday, and for 30 minutes on Friday. She ran for 15 minutes on Tuesday and Thursday. She didn't go for a run on Saturday and Sunday. If she did this for 5 consecutive weeks, how many hours of running did she do in total?
def solve() -> int: mon_wed = 20*2 fri = 30 tues_thurs = 15*2 weekly_total = (mon_wed+fri+tues_thurs)/60 total_5_weeks = weekly_total*5 result = total_5_weeks return result
In a race, there is a total of 600 yards from start to finish. If Mike and Sam both start running at the same time and Mike runs at 10 yards per second, how long will it take for Mike to finish the race if Sam runs at 6 yards per second?
def solve() -> int: distance = 600 mike_speed = 10 sam_speed = 6 mike_time = distance / mike_speed sam_time = distance / sam_speed time_diff = mike_time - sam_time result = time_diff return result
One bag contains 5 red marbles, 3 blue marbles, and 2 green marbles. A second bag contains 4 red marbles, 4 blue marbles, and 1 green marble. What is the total number of blue marbles in both bags?
def solve() -> int: bag1_red = 5 bag1_blue = 3 bag1_green = 2 bag2_red = 4 bag2_blue = 4 bag2_green = 1 total_blue = bag1_blue + bag2_blue result = total_blue return result
A cookie factory makes 7 batches of cookies a day. Each batch has 35 cookies. After the first batch came out, they sold 28. After the second batch, they sold 42. After the third batch, they sold 30. How many cookies are left?
def solve() -> int: batches = 7 cookies_per_batch = 35 total_cookies = batches * cookies_per_batch sold_batch1 = 28 sold_batch2 = 42 sold_batch3 = 30 total_sold = sold_batch1 + sold_batch2 + sold_batch3 left_over = total_cookies - total_sold result = left_over return r...
Emily is hosting a wine and cheese night for her friends. She buys a cheese platter with 12 even-sized pieces. If there are 3 guests attending the event, including Emily, how many pieces of cheese can each person have?
def solve() -> int: cheese_platter = 12 guests = 3 pieces_per_person = cheese_platter / guests result = pieces_per_person return result
A store sold 300 items in the morning and 400 items in the evening. If the evening’s sale was 20% more than the morning’s sale, how many items were sold in total?
def solve() -> int: morning_sales = 300 evening_sales_increase_ratio = 1.2 evening_sales = morning_sales * evening_sales_increase_ratio total_sales = morning_sales + evening_sales result = total_sales return result
Braden increases the dosage of his medication by 25%, then he got a generic version of it which increased the dosage by 20%, if he used to take a 10mg dosage, what is his new dosage?
def solve() -> int: original_dosage = 10 increase_1 = original_dosage * 0.25 dosage_after_increase_1 = original_dosage + increase_1 increase_2 = dosage_after_increase_1 * 0.20 new_dosage = dosage_after_increase_1 + increase_2 result = new_dosage return result
A certain company has 588 employees, 14% of whom are on vacation this week. How many employees are not on vacation this week?
def solve() -> int: num_employees = 588 percent_on_vacation = 0.14 remaining_employees = (1 - percent_on_vacation) * num_employees result = remaining_employees return result
Emily and Luke are at the grocery buying ingredients for a recipe. Emily can carry 2 bags in 5 minutes and Luke can carry 3 bags in 6 minutes. How long does it take for both of them to carry 8 bags?
def solve() -> int: Emily_bag = 2 Emily_time = 5 Luke_bag = 3 Luke_time = 6 needed_bag = 8 total_time = (needed_bag/Emily_bag * Emily_time) + (needed_bag/Luke_bag * Luke_time) result = total_time return result
Samantha purchased a new gym membership that offered a $50.00 bonus for every friend she referred. If Samantha referred 4 friends, how much money did she earn in total?
def solve() -> int: bonus_per_friend = 50.00 num_friends_referred = 4 total_bonus = bonus_per_friend * num_friends_referred result = total_bonus return result
There are 800 pages in a book. Each chapter has 25 pages. How many chapters are there in the book?
def solve() -> int: pages_per_chapter = 25 total_chapters = 800 // pages_per_chapter result = total_chapters return result
Matthew works out every day. One day, he lifted weights for 30 minutes, ran for 10 kilometers, and walked for ¾ of the number of kilometers he ran. What distance did Matthew cover during his exercise routine?
def solve() -> int: minutes_weightlifting = 30 kilometers_running = 10 kilometers_walking = (3/4) * kilometers_running total_distance = kilometers_running + kilometers_walking result = total_distance return result
Student: Grace borrowed $8000 for 4 years at an interest rate of 8%. What is the total amount to be repaid?
def solve() -> int: principal = 8000 years = 4 interest_rate = 0.08 total_amount = principal * (1 + interest_rate * years) result = total_amount return result
A hardware store has 1000 hammers in stock. They sell each hammer for $10 and their total cost of buying the hammers was $4000. If they discount each hammer by 20%, how much profit will they make on the hammers?
def solve() -> int: number_of_hammers = 1000 hammer_purchase_cost = 4000 sale_price = 10 discount_percentage = 0.20 discounted_sale_price = sale_price * (1 - discount_percentage) total_sale_revenue = number_of_hammers * discounted_sale_price total_profit = total_sale_revenue - hammer_purchas...
A choir has 36 members. They need to form groups such that each group has 4 members. How many groups can be formed?
def solve() -> int: members = 36 members_per_group = 4 groups = members // members_per_group result = groups return result
Janice takes a cab to a nearby concert venue that is 15 miles away. The cab costs $3 per mile. How much money will she need for a round trip cab ride?
def solve() -> int: distance = 15 cost_per_mile = 3 round_trip_distance = distance * 2 total_cost = round_trip_distance * cost_per_mile result = total_cost return result
Student: A gardener has a rectangular garden that is 12 feet long and 8 feet wide. If they want to add a border that is 1 foot wide around the garden, what is the total area of the garden and border?
def solve() -> int: length = 12 width = 8 border_width = 1 area_garden = length * width area_border = (length + 2 * border_width) * (width + 2 * border_width) total_area = area_garden + area_border result = total_area return result
Student: A dress originally costs $80, but it is on sale for 20% off. What is the sale price?
def solve() -> int: original_cost = 80 discount_rate = 0.2 sale_price = original_cost * (1 - discount_rate) result = sale_price return result
A farmer has 20 chickens and 10 cows. Each chicken lays 4 eggs per week and each cow produces 15 liters of milk per week. How many eggs and liters of milk does the farmer have after 3 weeks?
def solve() -> int: eggs_week = 20 * 4 milk_week = 10 * 15 eggs_3weeks = eggs_week * 3 milk_3weeks = milk_week * 3 result = eggs_3weeks, milk_3weeks return result
A cylindrical barrel has a radius of 2 feet and a height of 3 feet. It is filled with water up to 80% of its capacity. How much water is in the barrel in cubic feet?
def solve() -> int: barrel_volume = 3.14 * 2 ** 2 * 3 water_volume = 0.8 * barrel_volume result = round(water_volume, 2) return result
Student: A container is filled with 42 pounds of chocolate. If the chocolate is divided among seven people, how much does each person get?
def solve() -> int: container = 42 people = 7 weight_per_person = container / people result = weight_per_person return result
Alex spent $150 on clothes and saved 30% of his monthly income. If he has $1000 left, what was his monthly income?
def solve() -> int: clothes_cost = 150 savings_percentage = 0.3 remaining_money = 1000 total_expenses = clothes_cost + remaining_money monthly_income = total_expenses / (1 - savings_percentage) result = monthly_income return result
A driver covers 200 km in 2 hours and 30 minutes. What is the average speed of the driver in km/h?
def solve() -> int: distance = 200 time_in_hours = 2.5 average_speed = distance/time_in_hours result = average_speed return result
7 years ago, Devin's age was 3 times the age of his little sister, Brooke. Today, Devin's age is 2 times Brooke's age. How old is Brooke today?
def solve() -> int: DevinAgeCurrent = 28 BrookeAgeCurrent = DevinAgeCurrent / 2 DevinAge7YearsAgo = DevinAgeCurrent - 7 BrookeAge7YearsAgo = BrookeAgeCurrent - 7 BrookeAge7YearsAgo = DevinAge7YearsAgo / 3 BrookeAgeCurrent = BrookeAge7YearsAgo + 7 resu...
Greta, Heidi, and Iris decided to donate money to a charity. Greta donated $100, Heidi donated 50% more money than Greta, and Iris donated twice as much money as Heidi. How much money did they donate in total?
def solve() -> int: heidi_donate = 1.5 * 100 iris_donate = 2 * heidi_donate total_donate = 100 + heidi_donate + iris_donate result = total_donate return result
There are 64 marbles in a bag, some are red and the others are blue. The ratio of red to blue marbles is 3:2. How many marbles in the bag are blue?
def solve() -> int: total = 64 red_ratio = 3 blue_ratio = 2 red_count = total/(red_ratio + blue_ratio) * red_ratio blue_count = total - red_count result = blue_count return result
Student: Tina earns a 25% commission on every necklace she sells. She sells 5 necklaces that cost $40 each, 3 necklaces that cost $60 each and 2 necklaces that cost $100 each. How much commission does Tina earn?
def solve() -> int: commission_rate = 0.25 necklace_1_price = 40 necklace_1_quantity = 5 necklace_2_price = 60 necklace_2_quantity = 3 necklace_3_price = 100 necklace_3_quantity = 2 total_cost = (necklace_1_price * necklace_1_quantity) + (necklace_2_price * necklace_2_quantity) + (neckla...
Tyler has a rectangular garden that is 12 meters long and 8 meters wide. He wants to plant roses along the perimeter of the garden. He needs one rose plant for every meter of the perimeter. How many rose plants does he need?
def solve() -> int: length = 12 width = 8 perimeter = 2 * (length + width) rose_plants = perimeter result = rose_plants return result
6. Bob starts on the fourth floor of a mall. He goes down 11 floors, then takes the stairs up 4 floors, then goes down 9 floors. How many floors are there in the mall?
def solve() -> int: start_floor = 4 step1 = -11 step2 = 4 step3 = -9 total_floors = 0 total_floors = start_floor + step1 + step2 + step3 result = total_floors return result
In a race, Sarah ran 12% fewer miles than her friend Amy, and Amy ran 9 more miles than their friend Mike. If Sarah ran 50 miles, how many miles did they all run combined?
def solve() -> int: sarah_miles = 50 amy_miles = sarah_miles / 0.88 mike_miles = amy_miles - 9 total_miles = sarah_miles + amy_miles + mike_miles result = total_miles return result
Student: Tom bought 3 pizzas for $10 each. He also bought 2 sodas for $2 each. He paid the cashier $35. How much change did he receive?
def solve() -> int: pizza_price = 10 soda_price = 2 pizza_num = 3 soda_num = 2 payment = 35 total_cost = pizza_price * pizza_num + soda_price * soda_num change = payment - total_cost result = change return result
``` John has 25 dollars and wants to buy shirts and ties. Each shirt costs 18 dollars and each tie costs 7 dollars. How many ties can he buy with his 25 dollars if he buys 2 shirts?
def solve() -> int: dollars = 25 shirt_cost = 18 tie_cost = 7 num_shirts = 2 total_shirt_cost = shirt_cost * num_shirts remaining_dollars = dollars - total_shirt_cost num_ties = remaining_dollars // tie_cost result = num_ties return result
John is planning to make a smoothie. He can either use strawberries that cost $3.00 per 10 ounce carton or raspberries that cost $4.00 per 8 ounce carton. If he is going to make 3 cups of smoothie each requiring 6 ounces of fruit, by how much would he save by using strawberries instead of raspberries?
def solve() -> int: strawberries_price = 3.00 strawberries_weight = 10 raspberries_price = 4.00 raspberries_weight = 8 smoothie_cups = 3 smoothie_ounce = 6 strawberries_cost = (strawberries_price / strawberries_weight) * smoothie_ounce * smoothie_cups raspberries_cost = (raspberries...
Student: Maggie bought 10 pens for $2 each. She then got 20 more pens for free. How much money did Maggie save on the pens?
def solve() -> int: pens = 10 price = 2 free = 20 cost = pens * price value = free * price save = value - cost result = save return result
Student: If 12 people can paint a house in 6 days, how many days will it take for 18 people to paint the same house?
def solve() -> int: people = 12 days = 6 new_people = 18 new_days = days * (new_people / people) result = new_days return result
Jasmine works 2 hours every morning cleaning houses for $12.00 an hour. She works every day of the week at a bookstore for 3 hours at $11.00 an hour. On Sunday, she works at a bakery for 6 hours at $10.00 an hour. How much money does she earn over a week?
def solve() -> int: morning_hours = 2 morning_rate = 12.00 bookstore_hours = 3 bookstore_rate = 11.00 sunday_hours = 6 sunday_rate = 10.00 total_earnings = (morning_hours * morning_rate) * 7 + (bookstore_hours * bookstore_rate) * 6 + (sunday_hours * sunday_rate) resul...
Mark brings in 20 towels and three times as many washcloths as towels to the laundromat. When he comes back, he finds seven washcloths and double the number of towels. How many items are missing?
def solve() -> int: towels = 20 washcloths = 3 * towels missing_towels = 2 * towels - 7 missing_washcloths = washcloths - 7 missing_items = missing_towels + missing_washcloths result = missing_items return result
A baker makes cupcakes in batches of 24. She uses 3 eggs for each batch, and 1/4 cup of milk for every 6 cupcakes. She has 15 eggs and 3 cups of milk in her pantry. How many batches of cupcakes can she make with the ingredients she has?
def solve() -> int: batches = 24 eggs_per_batch = 3 milk_per_cupcake = 1/4 / 6 eggs = 15 milk = 3 batches_by_eggs = eggs // eggs_per_batch milk_per_batch = batches * milk_per_cupcake batches_by_milk = milk // milk_per_batch result = min(batches_by_eggs, batches_by_milk) re...
To promote eco-friendly products, the local store is offering a 20% discount on any product that is made from recycled materials and over $30.00 and a 10% discount on any product under $20.00. Jenny goes to the storeEmily washed the car and removed three-fourths of the dirt from it. As she drove it afterward, her tires...
def solve() -> int: removed_dirt = 3/4 new_dirt = 86 total_dirt = 218 before_dirt = (total_dirt - new_dirt) / removed_dirt result = before_dirt return result
If a pizza has a diameter of 12 inches, what is the radius of the pizza?
def solve() -> int: diameter = 12 radius = diameter / 2 result = radius return result
Student: Lucy has 3 more dolls than Emma and Emma has 5 times as many dolls as Lily. If Lily has 4 dolls, how many does Lucy have?
def solve() -> int: lily_dolls = 4 emma_dolls = 0 lucy_dolls = 0 emma_dolls = lily_dolls * 5 lucy_dolls = emma_dolls + 3 result = lucy_dolls return result
Jake has 25 books and trades 5 of them for 15 comics from Ben. Ben started with 40 comics and trades 6 for 12 of Jake's books. How many reading materials in total were traded between Jake and Ben?
def solve() -> int: jake_books = 25 jake_books -= 5 ben_comics = 15 ben_comics += 40 ben_comics -= 6 jake_books += 12 total_traded = jake_books + ben_comics result = total_traded return result
Student: Kim has 4 times the number of crayons than 8 less than the number of markers she has. If she has 60 crayons, how many markers does she have?
def solve() -> int: crayons = 60 markers = 0 markers = crayons / 4 + 8 result = markers return result
Julia has a goal to become a pharmacist. She first got a degree in chemistry which took her 4 years. Later on, she decided to get a degree in pharmacy, and it took her 6 more years to complete. How many years in total did Julia spend in college to become a pharmacist?
def solve() -> int: years_chemistry = 4 years_pharmacy = 6 total_years = years_chemistry + years_pharmacy result = total_years return result
Tom has five years and eight times his age is the same as his father's age. If Tom's father is 40 years old, determine Tom's age.
def solve() -> int: father_age = 40 protein_5_years = father_age - 8 * 5 tom_age = protein_5_years result = tom_age return result
If a car is driving at a speed of 50 miles per hour, how long will it take the car to travel 200 miles?
def solve() -> int: time_to_travel = 200/50 result = time_to_travel return result
A student receives the following grades: 75, 80, 95 and 85. What is their average grade?
def solve() -> int: grades = [75, 80, 95, 85] sum_of_grades = sum(grades) number_of_grades = len(grades) average_grade = sum_of_grades / number_of_grades result = average_grade return result
Jill scored 85 on her first math test which was 15% of her final grade. What was her final grade if the math test was the only graded item?
def solve() -> int: final_grade = 85 / 0.15 result = final_grade return result
There were 100 fish swimming in a tank before some were moved to another tank. After the transfer, there were 70 fish in the original tank. What's 50% of the number of fish that were moved to the other tank?
def solve() -> int: original_tank = 100 after_transfer = 70 fish_moved = original_tank - after_transfer percentage = 50 result = (percentage / 100) * fish_moved return result
``` If a car travels 280 miles on 20 gallons of gasoline, how far will it travel on 15 gallons of gasoline, assuming the driving conditions are identical?
def solve() -> int: miles_per_gallon = 280/20 result = miles_per_gallon * 15 return result
A movie theater charges $12 for a ticket, but customers who buy more than two tickets receive a 10% discount on each ticket. Customers who buy more than four tickets receive an additional discount of 15%. What is the price of a ticket for a customer who bought six tickets?
def solve() -> int: num_tickets = 6 ticket_price = 12 if num_tickets > 4: discount = 0.15 elif num_tickets > 2: discount = 0.10 else: discount = 0 total_price = num_tickets * ticket_price * (1 - discount) result = total_price return result
Tina and Anna are selling lemonade. Tina sells a cup of lemonade for 25 cents, and Anna sells a cup of lemonade for 30 cents. They both start with 10 cups of lemonade each. Tina sells 7 cups, and Anna sells 8 cups. How much money do they have in total?
def solve() -> int: money_tina = 7 * 0.25 money_anna = 8 * 0.30 total_money = money_tina + money_anna result = float(total_money) return result
Katie can swim 24 meters in 30 seconds. How long will it take her to swim 120 meters?
def solve() -> int: distance_swam_in_time = 24 time_taken = 30 distance_to_swim = 120 time_to_swim_distance = (distance_to_swim / distance_swam_in_time) * time_taken result = time_to_swim_distance return result
Noah purchases 10 apples, 4 bananas, and 2 oranges. Each banana costs as much as the 3 combined apples. The oranges cost 3 times as much as the bananas. If an apple costs $0.75, how much did everything cost together? Jane has a bucket that is 10 inches tall. She leaves it outside during a rainstorm that produces 4 inch...
def solve() -> int: apples = 10 bananas = 4 oranges = 2 apple_cost = 0.75 banana_cost = 3 * apple_cost total_banana_cost = bananas * banana_cost orange_cost = 3 * banana_cost total_orange_cost = oranges * orange_cost total_cost = (apples * apple_cost) + total_banana_co...
There are 32 pieces of candy in a jar. The ratio of the number of chocolate candies to the number of fruit candies is 5:3. If 8 pieces of fruit candy are added to the jar, what is the new ratio of chocolate to fruit candies?
def solve() -> int: chocolate_to_fruit = 5/3 total_candies = 32 chocolate_candies = total_candies / (chocolate_to_fruit + 1) fruit_candies = total_candies - chocolate_candies new_fruit_candies = fruit_candies + 8 new_chocolate_to_fruit = chocolate_candies / new_fruit_candies result = new_cho...
If a bookstore sells all books with a 20% discount, and a particular book originally costs $50, how much does it cost after the discount?
def solve() -> int: original_price = 50 discount = 0.2 discounted_price = original_price * (1 - discount) result = discounted_price return result
Student: - Lucy likes to bake cookies, where each batch of cookies requires 2 cups of flour, 1 cup of sugar, and 0.5 cup of butter. If she has 10 cups of flour, 7 cups of sugar, and 3 cups of butter in her pantry, what is the maximum number of batches of cookies she can bake? How much of each ingredient will she have l...
def solve() -> int: flour = 10 sugar = 7 butter = 3 flour_per_batch = 2 sugar_per_batch = 1 butter_per_batch = 0.5 flour_batches = flour // flour_per_batch sugar_batches = sugar // sugar_per_batch butter_batches = butter // butter_per_batch max_batches = min(flour_batches,...
A class has 50 students and 60% of them are boys. If the rest are girls, how many girls are there in the class?
def solve() -> int: boys = 50 * 60/100 girls = 50 - boys result = girls return result
Paula's family went to a movie theatre and purchased 13 tickets with a discounted rate of $7.49 each. How much money did they spend in total?
def solve() -> int: number_of_tickets = 13 price_per_ticket = 7.49 total_cost = number_of_tickets * price_per_ticket result = total_cost return result
A garden has 60 flowers, with three different colors. One-third of the flowers are red, one-fourth are yellow, and the rest are orange. How many orange flowers are there in the garden?
def solve() -> int: total_flowers = 60 red_flowers = total_flowers / 3 yellow_flowers = total_flowers / 4 orange_flowers = total_flowers - red_flowers - yellow_flowers result = orange_flowers return result
A movie ticket costs $12. If John spends $156 on movie tickets, how many movie tickets did he buy?
def solve() -> int: cost_per_ticket = 12 total_spent = 156 num_tickets = total_spent / cost_per_ticket result = num_tickets return result
Martin made a cake costing $15 and sold it for $25. Then he made 3 more cakes for the same amount. How much did he profit?
def solve() -> int: cost_of_cake = 15 selling_price = 25 total_cost = cost_of_cake * 4 total_revenue = selling_price * 4 profit = total_revenue - total_cost result = profit return result
A video recording device can store enough gigabytes of storage space to store 1500 hours of footage. Each hour of footage is 5 gigabytes in size. How much storage space is left if it already has 500 hours of footage on it?
def solve() -> int: total_storage = 1500 hour_size = 5 current_hours = 500 used_storage = current_hours * hour_size remaining_storage = total_storage - used_storage result = remaining_storage return result
Laura has 436 stickers in total. She gave 94 stickers to her younger sister. How many stickers are left with Laura?
def solve() -> int: total_stickers = 436 stickers_given = 94 stickers_left = total_stickers - stickers_given result = stickers_left return result
There are 72 students in the robotics club. One eighth of them build robots, and 3/8 of the remaining students program robots. The rest of the students design robots or test robots. How many students design robots or test robots?
def solve() -> int: build = 72 / 8 remaining = 72 - build program = 3/8 * remaining design_test = remaining - program result = design_test return result
Maria, the cat, eats 3 cans of wet food per week when she weighs 5 pounds, but she eats twice as many cans when she weighs 10 pounds. How many cans will she eat over 8 weeks if she weighs 5 pounds for 60% of the time and weighs 10 pounds for the remainder of the time?
def solve() -> int: weight_5 = 5 weight_10 = 10 cans_per_week_5 = 3 cans_per_week_10 = 2 * cans_per_week_5 weeks_weight_5 = 0.6 * 8 weeks_weight_10 = 8 - weeks_weight_5 total_cans = (cans_per_week_5 * weeks_weight_5) + (cans_per_week_10 * weeks_weight_10) result = total_ca...
Student: If Teresa mows the lawn every 2 weeks, how many times will she need to mow the lawn in a year?
def solve() -> int: mow_frequency = 2 year_length = 52 result = year_length // mow_frequency return result
He spends 20 coins. How much money does he have left?
def solve() -> int: coins_initial = 89 coins_spending = 20 coins_remaining = coins_initial - coins_spending result = coins_remaining return result
Student: In a natural history museum, 60% of the exhibits are about prehistoric animals, 20% about plants and the remaining about birds. If there are 200 exhibits altogether, how many of them are about birds?
def solve() -> int: prehistoric_animals = 0.6 plants = 0.2 birds = 0.2 total_exhibits = 200 birds_exhibits = total_exhibits * birds result = birds_exhibits return result
Lily, Rose, and Daisy worked a total of 190 hours in one month. Lily worked x hours. Rose worked 7 more than double of what Lily worked. Daisy worked 10 less than half of Rose's hours. How many hours did Daisy work?
def solve() -> int: x = 50 rose = 7 + 2*x daisy = (rose/2) - 10 total_hours = x + rose + daisy result = daisy return result
A furniture store is having a 30% discount on all items. If a sofa was originally priced at $900, what is the discounted price?
def solve() -> int: original_price = 900 discount = 0.3 discounted_price = original_price * (1 - discount) result = discounted_price return result
A carpenter made 20 chairs in two days and each chair was sold for $50. On the third day, the carpenter made an additional 10 chairs and sold all chairs made over three days for $45 each. How much profit did the carpenter make over those three days?
def solve() -> int: revenue = (20*50) + (10*45) cost = 20*25 + 10*20 profit = revenue - cost result = profit return result
A recipe for 10 servings requires 1 pound of flour. If a chef wants to make 20 servings, how many pounds of flour does he need to use?
def solve() -> int: servings_per_pound = 10 target_servings = 20 pounds_of_flour = target_servings / servings_per_pound result = pounds_of_flour return result
John needs to have an overall average grade of at least 85%. If he scored a 79% on his first exam, what does he need to score on his second exam to meet his goal?
def solve() -> int: first_exam_score = 79 overall_average_goal = 85 second_exam_score_needed = (overall_average_goal * 2) - first_exam_score result = second_exam_score_needed return result
Student: There are 25 students in a class. If the teacher has 100 sheets of paper, how many sheets can each student get if they all get the same amount?
def solve() -> int: students = 25 sheets = 100 sheets_per_student = sheets // students result = sheets_per_student return result
Lila sells bracelets at a market, and she charges $5 per bracelet. On Saturday, she sold 20 bracelets. On Sunday, she sold 15% less bracelets than on Saturday. On Monday, she sold 6 bracelets more than on Sunday. How much did she earn for three days?
def solve() -> int: price = 5 saturday = 20 sunday = saturday * 0.85 monday = sunday + 6 earnings = (saturday + sunday + monday) * price result = earnings return result
Ryan is measuring his backyard to determine how much grass seed he needs to buy. His backyard is a rectangular shape with dimensions of 20 feet by 30 feet. If each pound of grass seed covers 100 square feet, how many pounds of grass seed does he need to buy?
def solve() -> int: length = 30 width = 20 area = length * width coverage = 100 seed_needed = area / coverage result = seed_needed return result
- The zoo charges $10 for adult tickets, $7 for student tickets, and $5 for children tickets. If they sell 150 adult tickets, 200 student tickets, and 250 children tickets, how much money do they make in total?
def solve() -> int: adult_price = 10 student_price = 7 children_price = 5 adult_tickets = 150 student_tickets = 200 children_tickets = 250 adult_revenue = adult_price * adult_tickets student_revenue = student_price * student_tickets children_revenue = children_price * child...
Ann has 12 fewer rings than Nick, and Josh has half the amount of rings Nick has. If Josh has 24 rings, how many rings do the three of them have in total?
def solve() -> int: Josh_rings = 24 Nick_rings = 2*Josh_rings Ann_rings = Nick_rings - 12 total_rings = Josh_rings + Nick_rings + Ann_rings result = total_rings return result
A bookstore has 100 books in stock. If the bookstore wants to order enough books for 50 more customers, and each customer buys 2 books, how many books should the bookstore order?
def solve() -> int: num_books_in_stock = 100 num_customers = 50 books_per_customer = 2 total_books_needed = (num_customers * books_per_customer) + num_books_in_stock result = total_books_needed return result
A car traveled 75 miles in 1.5 hours. What is the average speed of the car in miles per hour?
def solve() -> int: distance = 75 time = 1.5 average_speed = distance / time result = average_speed return result
Joanna had 360 candy pieces. If she gives away 1/4 of her candy, how many candy pieces does she have left?
def solve() -> int: total_candies = 360 frac_given = 1/4 n_remain = total_candies - (frac_given * total_candies) result = n_remain return result
Jessica works part-time at a coffee shop making $9 per hour. If she wants to save $500 to go on a trip, how many hours will she need to work to reach her goal?
def solve() -> int: hourly_wage = 9 savings_goal = 500 hours_needed = savings_goal / hourly_wage result = hours_needed return result
Alice has a necklace that she wants to shorten. The necklace is made of 100 beads that are connected by 99 strings. Each string is 1 cm long and each bead is 0.5 cm in diameter. She wants to cut the necklace so that it is 50 cm long. How many beads and strings does she need to remove?
def solve() -> int: length = (100 * 0.5) + (99 * 1) remove = length - 50 strings = remove / (0.5 + 1) strings = int(strings + 0.5) beads = strings result = beads return result
Jill has 14 barrettes. She wants to put 3 barrettes in each row. How many rows of barrettes can she make?
def solve() -> int: barrettes = 14 rows = barrettes//3 result = rows return result
Student: Jake and Lisa went roller skating in a local rink, which is a half-mile circular track. After 1 hour, Jake completed 15 laps around the track, while Lisa was more cautious and only completed half of the laps that Jake did. What was Lisa's average speed in miles per hour?
def solve() -> int: track_length = 0.5 jake_laps = 15 lisa_laps = jake_laps / 2 time = 1 jake_distance = track_length * jake_laps lisa_distance = track_length * lisa_laps lisa_speed = lisa_distance / time result = lisa_speed return result
ara just bought a new bike. The frame costs $600 and the wheels cost $200. Sara pays $80 sales tax on the purchase. How much did Sara pay in total?
def solve() -> int: frame_price = 600 wheel_price = 200 sales_tax_percent = 0.8 total_price = frame_price + wheel_price + frame_price*sales_tax_percent + wheel_price*sales_tax_percent result = total_price return result
A store offers a 10% discount on all products. However, they give a loyalty bonus to customers who have purchased more than $500 worth of products in the past, which is an additional 5% discount. How much does a loyal customer have to pay for $300 worth of products?
def solve() -> int: price = 300 discount1 = 10 if price > 500: discount2 = 5 discounted_price = price*(1-discount1/100)*(1-discount2/100) else: discounted_price = price*(1-discount1/100) result = discounted_price return result
Lisa is making a flower bed in her backyard that is in the shape of an octagon with a side length of 2 feet. What is the perimeter of Lisa's flower bed?
def solve() -> int: side_length = 2 perimeter = side_length*8 result = perimeter return result
Lisa drives 100 miles and twice as much on the train. If driving costs 50 cents per mile and the train costs twice as much per mile, what is the total cost of her transportation?
def solve() -> int: driving_distance = 100 train_distance = 2 * driving_distance driving_cost_per_mile = 0.50 train_cost_per_mile = 2 * driving_cost_per_mile driving_cost = driving_distance * driving_cost_per_mile train_cost = train_distance * train_cost_per_mile total_cost = ...
A water tank can hold 120 liters of water. A pipe can fill the tank in 15 minutes, and another pipe can drain the tank in 20 minutes. If both pipes are opened at the same time, how long will it take to fill the tank completely?
def solve() -> int: fill_rate = 120 / 15 drain_rate = 120 / 20 net_rate = fill_rate - drain_rate time = 120 / net_rate result = time return result
At the cinema, the ticket fee is $8 per person, and each snack has a separate fee as well. A small popcorn costs $3, and a drink costs $2. How much would a group of 3 adults and 2 children pay to watch a movie and buy 3 small popcorns, and 2 drinks?
def solve() -> int: adults = 3 children = 2 ticket_fee = 8 popcorn_fee = 3 drink_fee = 2 total_ticket_fee = (adults + children) * ticket_fee total_popcorn_fee = 3 * popcorn_fee total_drink_fee = 2 * drink_fee total_cost = total_ticket_fee + total_popcorn_fee + total_drink_f...
Student: Two trains are travelling towards each other at speeds of 60 kilometers per hour and 90 kilometers per hour respectively. They are separated by a distance of 150 kilometers. How long will it take for them to collide?
def solve() -> int: speed1 = 60 speed2 = 90 distance = 150 time = distance / (speed1 + speed2) result = time return result
David had 56 toy cars, and he gave seven of them to William. Now David has 8 times more toy cars than William. How many toy cars did William have at first?
def solve() -> int: david_cars = 56 william_cars = david_cars - 7 david_cars = 8 * william_cars result = william_cars return result
A certain city's population increases by 5% every year. If the current population is 100,000, what will be the population after 10 years?
def solve() -> int: current_population = 100000 growth_rate = 0.05 years = 10 future_population = current_population * (1+growth_rate)**years result = f'<<<{future_population}>>>' result = future_population return result
- Carol is a nurse who works 12-hour shifts. She used to work 4 shifts a week, but due to the pandemic, she has to work 6 shifts a week. She earns 30 dollars per hour normally, but gets a 50% bonus for working extra shifts. How much does she earn in a week now?
def solve() -> int: normal_hours_per_week = 4 * 12 new_hours_per_week = 6 * 12 extra_hours_per_week = new_hours_per_week - normal_hours_per_week normal_earnings_per_week = normal_hours_per_week * 30 extra_earnings_per_week = extra_hours_per_week * 30 * 1.5 total_earnings_per_week = normal_ea...
Ben used to bike 25 miles in 2 hours but due to a leg injury, he has slowed down. He lost 10% of his speed and now can only bike 20 miles in 2 hours. How fast was he biking before?
def solve() -> int: original_distance = 25 original_time = 2 new_distance = 20 new_time = 2 original_speed = original_distance / original_time new_speed = new_distance / new_time percentage_lost = (original_speed - new_speed) / original_speed * 100 original_speed_befo...
If it takes 2 hours to paint a room with 2 people, how many hours would it take for 5 people to paint 3 rooms?
def solve() -> int: rate_per_person = 1/2 rooms = 3 time = rooms / (rate_per_person * 5) result = time return result
A rectangular swimming pool is 20 feet long and 10 feet wide. If the depth of the shallow end is 5 feet and the depth of the deep end is 10 feet, what is the average depth of the pool?
def solve() -> int: shallow_depth = 5 deep_depth = 10 length = 20 width = 10 average_depth = (shallow_depth + deep_depth)/2 result = average_depth return result