question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Liam’s suitcase weighs 90 pounds. It weighs 2 times as much as Sophia’s suitcase. Together, what is the weight of the suitcases?
def solve() -> int: liam_suitcase_weight = 90 sophia_suitcase_weight = liam_suitcase_weight / 2 total_weight = liam_suitcase_weight + sophia_suitcase_weight result = total_weight return result
Possible questions and programs: Lucas bought 15 lollipops and 2/5 times as many gummy bears as lollipops. If each lollipop cost 10 cents and each gummy bear cost 5 cents, how much money did Lucas spend in total?
def solve() -> int: gummy_bears = 2/5 * 15 lollipops_cost = 15 * 0.1 gummy_bears_cost = gummy_bears * 0.05 total_cost = lollipops_cost + gummy_bears_cost result = total_cost return result
Student: David has a book business. He buys a book for $8 and sells it for $12. He sells an average of 75 books per day for 4 days a week. If he sells all of his books, how much profit does he make in a month (30 days)?
def solve() -> int: book_cost = 8 book_price = 12 books_sold_per_day = 75 days_per_week = 4 weeks_in_month = 30 / days_per_week total_books_sold = books_sold_per_day * days_per_week * weeks_in_month profit = (book_price - book_cost) * total_books_sold result = profit return result
In a pet store, 60% of the animals are dogs and 40% are cats. If there are 120 dogs, how many cats are there?
def solve() -> int: total_animals = 120 / 0.6 cats = total_animals * 0.4 result = cats return result
Fahad wants to divide 50 candies equally among his 4 friends and keep 12 for himself. How many candies will each friend get?
def solve() -> int: total_candies = 50 num_friends = 4 candies_kept = 12 candies_per_friend = (total_candies - candies_kept)/num_friends result = candies_per_friend return result
A recipe needs 3 cups of flour to make 24 cookies. How much flour is needed to make 60 cookies?
def solve() -> int: flour_for_24_cookies = 3 flour_for_one_cookie = flour_for_24_cookies / 24 flour_for_60_cookies = flour_for_one_cookie * 60 result = flour_for_60_cookies return result
Sarah traveled 120 miles in 4 hours and Mike traveled 200 miles in 5 hours. If they both traveled at a constant speed, how many more miles per hour did Mike travel than Sarah?
def solve() -> int: sarah_distance = 120 sarah_time = 4 mike_distance = 200 mike_time = 5 sarah_speed = sarah_distance / sarah_time mike_speed = mike_distance / mike_time difference = mike_speed - sarah_speed result = difference return result
If Kelly earns $12 an hour for the first 40 hours she works and $18 for any additional hours, and she worked 50 hours last week, how much did she make?
def solve() -> int: hourly_rate = 12 additional_rate = 18 hours_worked = 50 if hours_worked <= 40: total_pay = hourly_rate * hours_worked else: overtime_hours = hours_worked - 40 overtime_pay = additional_rate * overtime_hours regular_pay = hourly_rate * 40 ...
Steven went cherry picking with his grandparents over the weekend. He picked 7 times the amount of cherries his grandpa picked and his grandma picked 64 cherries less than him. If his grandpa picked 6 baskets each containing 10 cherries, how many cherries would they each have if they divide the total number of cherries...
def solve() -> int: grandpa_cherries = 6 * 10 steven_cherries = 7 * grandpa_cherries grandma_cherries = steven_cherries - 64 total_cherries = grandpa_cherries + steven_cherries + grandma_cherries each_cherries = total_cherries / 3 result = each_cherries return result
For every book that he reads, Ben writes three paragraphs of a summary. If he reads four books every week for two weeks, how many paragraphs does he write?
def solve() -> int: books = 4 paragraphs = 3 weeks = 2 total_paragraphs = books * paragraphs * weeks result = total_paragraphs return result
Student: A pet shop has 600 cats, 132 rabbits and 48 ducks in total. Every week, they sell 72 cats, 20 rabbits and 8 ducks. How many animals will be left in the pet shop after 5 weeks?
def solve() -> int: cats = 600 rabbits = 132 ducks = 48 cats_sold_per_week = 72 rabbits_sold_per_week = 20 ducks_sold_per_week = 8 cats_left = cats - cats_sold_per_week * 5 rabbits_left = rabbits - rabbits_sold_per_week * 5 ducks_left = ducks - ducks_sold_per_week * 5 result = ca...
Mia has 3 bags of candy, each containing 15 pieces. She wants to share the candy equally with her 4 friends, including herself. How many pieces of candy will each person get, and how many pieces will be left over?
def solve() -> int: total_pieces = 3 * 15 people = 4 pieces_per_person = total_pieces // people pieces_left_over = total_pieces % people result = (pieces_per_person, pieces_left_over) return result
Emily has 9 more nickels than dimes in her change purse. She has twice as many quarters as dimes. She has 3 times as many pennies as nickels. If she has 18 dimes, how many pennies does she have?
def solve() -> int: dimes = 18 nickels = dimes + 9 quarters = 2 * dimes pennies = 3 * nickels result = pennies return result
Lilly knows that the distance a bird travels to migrate between Canada and Mexico is 3000 km, while the distance between Canada and the US border is 500 km. Lilly observes a bird that goes from Canada to the US, takes a rest, and then goes to Mexico and finally returns to Canada. Lilly measures the distance traveled an...
def solve() -> int: distance_canada_mexico = 3000 distance_canada_us = 500 distance_us_mexico = distance_canada_mexico - distance_canada_us distance_canada_us_mexico = distance_canada_us + distance_us_mexico result = distance_canada_us_mexico return result
In a classroom, there are twelve desks, each with three pencils, three erasers, and two pairs of scissors. How many of each item are there in the classroom in total?
def solve() -> int: desks = 12 total_pencils = 3 * desks total_erasers = 3 * desks total_pairs_of_scissors = 2 * desks result = total_pencils + total_erasers + total_pairs_of_scissors return result
``` The ratio of girls to boys in a school is 4:5. If there are 120 boys, then how many girls are in the school?
def solve() -> int: total_ratio = 4+5 boys_ratio = 5 girls_ratio = 4 boys_count = 120 girls_count = (girls_ratio/total_ratio)*boys_count result = girls_count return result
If a parallelogram has a base of 30 centimeters and a height of 15 centimeters, how many 5-centimeter pencils can be placed end-to-end across the base of the parallelogram?
def solve() -> int: base = 30 height = 15 pencil_length = 5 num_pencils = base // pencil_length result = num_pencils return result
David bought some flowers for his mom. He bought 18 red roses, 3 times as many yellow roses as red roses and 10 fewer white roses than red roses. If he spent $144 in total, how much did he spend on white roses?
def solve() -> int: red = 18 yellow = 0 white = 0 total = 144 yellow = 3 * red white = (total - 18 - 3 * yellow)/1 result = white return result
If it takes 5 scientists 2 weeks to conduct an experiment, how long will it take 2 scientists to conduct the same experiment?
def solve() -> int: num_scientists = 5 time_taken = 2 num_scientists_new = 2 total_scientist_weeks = num_scientists * time_taken time_taken_new = total_scientist_weeks / num_scientists_new result = time_taken_new return result
Student: Arlene has collected 25% of the money she needs to buy a laptop. If she needs to save $850 for a laptop, how much money has Arlene collected?
def solve() -> int: total_needed = 850 percent_collected = 0.25 amount_collected = total_needed * percent_collected result = amount_collected return result
Ten years ago, Anna could complete 10 yoga poses in 20 minutes. Now, she can complete 1 yoga pose in 1 minute. How many more yoga poses can she complete per minute now compared to 10 years ago?
def solve() -> int: ten_years_ago_poses = 10 ten_years_ago_time = 20 now_poses = 1 now_time = 1 poses_per_minute_ten_years_ago = ten_years_ago_poses / ten_years_ago_time poses_per_minute_now = now_poses / now_time more_poses_per_minute = poses_per_minute_now - poses_per_minute_ten_...
A classroom has a length of 15 meters, a width of 10 meters, and a height of 3 meters. How many cubic meters of air are in the classroom?
def solve() -> int: length = 15 width = 10 height = 3 volume = length * width * height result = volume return result
If a store sells 2400 pencils in 6 days, how many pencils will it sell in 9 days if it continues at the same rate?
def solve() -> int: pencils_per_day = 2400 / 6 total_pencils = pencils_per_day * 9 result = total_pencils return result
Student: Amy drove for 2 hours and 40 minutes and the average speed was 55 mph. How many miles did she drive?
def solve() -> int: time = 2 + 40 / 60 distance = time * 55 result = distance return result
Rachel can run 5 miles an hour. Her sister Monica can run 7 miles an hour. If they start at opposite corners of a rectangular field that is 10 miles by 8 miles and run in straight lines towards each other, how many miles do they run in total before they meet?
def solve() -> int: distance_Rachel = 0 distance_Monica = 0 time = 0 while distance_Rachel + distance_Monica < 10+8: distance_Rachel += 5/3 distance_Monica += 7/3 time += 1/3 result = time*12/3 return result
Student: At a concert, an orchestra is made up of 14 musicians. If 2/5 of the musicians are women, how many male musicians are in the orchestra?
def solve() -> int: total_musicians = 14 fraction_women = 2/5 women = total_musicians * fraction_women men = total_musicians - women result = men return result
David earns $9 per hour and works for 35 hours a week. How much does he earn in one week?
def solve() -> int: hourly_rate = 9 hours_worked = 35 total_earnings = hourly_rate * hours_worked result = total_earnings return result
A phone company charges $30 for the first 300 minutes of calls and then 5 cents per minute thereafter. If a customer makes 500 minutes of calls, what is their total charge?
def solve() -> int: base_charge = 30 free_minutes = 300 charge_per_minute = 0.05 total_minutes = 500 if total_minutes <= free_minutes: total_charge = base_charge else: additional_minutes = total_minutes - free_minutes additional_charge = additional_minutes * charge_p...
A snack costs $1.50 and a drink costs $2.00. How much will 4 snacks and 3 drinks cost?
def solve() -> int: snack_price = 1.50 drink_price = 2.00 num_snacks = 4 num_drinks = 3 total_cost = (snack_price*num_snacks) + (drink_price*num_drinks) result = total_cost return result
Emily fills up her car's gas tank for $40. The price of each gallon of gas is $2. If her car gets 20 miles per gallon, how far can she drive?
def solve() -> int: fill_up_cost = 40 price_per_gallon = 2 miles_per_gallon = 20 gallons = fill_up_cost / price_per_gallon miles_driven = gallons * miles_per_gallon result = miles_driven return result
The product of two consecutive even numbers is 48. What are the two numbers?
def solve() -> int: product = 48 num1 = product**(1/2) - 1 num2 = product**(1/2) + 1 result = (num1, num2) return result
A marathon is 42 kilometers. He can run the first 5 kilometers in 28 minutes. For the remaining kilometers, he runs at 75% that pace. How long does the marathon take?
def solve() -> int: first_5km_time = 28 remaining_distance = 42 - 5 remaining_pace = first_5km_time / 5 * 1.75 remaining_time = remaining_pace * remaining_distance total_time = first_5km_time + remaining_time result = total_time return result
Student: A sum of money is to be divided among three people in ratio 1:2:5. If the largest share is $175, what is the total amount of money?
def solve() -> int: share1 = 0 share2 = 0 share3 = 0 largest_share = 175 share1 = largest_share / 5 share2 = largest_share / 2 share3 = largest_share total_amount = share1 + share2 + share3 result = total_amount return result
Student: Amanda went to the market and bought 12 eggs on Monday. She then bought 1/4 of the eggs she had on Monday, how many eggs did she buy?
def solve() -> int: eggs_on_monday = 12 eggs_bought_on_other_day = eggs_on_monday * 1/4 total_eggs_bought = eggs_on_monday + eggs_bought_on_other_day result = total_eggs_bought return result
Tom bought 4 shirts and 2 pants. Each shirt costs $20 and each pant costs $30. How much more did Tom spend on shirts compared to pants?
def solve() -> int: shirt_cost = 20 pant_cost = 30 num_shirts = 4 num_pants = 2 shirt_total = shirt_cost * num_shirts pant_total = pant_cost * num_pants difference = shirt_total - pant_total result = difference return result
Tracy has $27.50 and wants to buy 2 novels at $6.75 each, a pack of pencils for $2.50, and a pack of markers for $5. If the sales tax is 7%, how much money will be left after the purchase?
def solve() -> int: money_in_wallet = 27.50 novel_cost = 6.75 * 2 pencil_cost = 2.50 marker_cost = 5 total_cost = novel_cost + pencil_cost + marker_cost sales_tax = total_cost * 0.07 total_cost = total_cost + sales_tax money_left = money_in_wallet - total_cost result = money_left ...
Jenna is baking cookies and will need 5 cups of flour to make 24 cookies. If she wants to make 60 cookies, how many cups of flour will she need?
def solve() -> int: num_cookies = 60 cookies_per_cup = 24/5 cups_of_flour = num_cookies / cookies_per_cup result = cups_of_flour return result
Student: A janitor cleans a room of 500 square meter, he has cleaned 350 square meter in the morning, he cleans 130 square meter in the afternoon and there is still some part of the room that he needs to clean at night. How much square meter needs to be cleaned before the room is completely cleaned?
def solve() -> int: total_area = 500 morning_area = 350 afternoon_area = 130 cleaned_area = morning_area + afternoon_area remaining_area = total_area - cleaned_area result = remaining_area return result
Anna orders a pizza for 12.99 and a salad for 4.99. She splits the bill equally with her friend Bob. They each give a 18% tip. How much does each of them pay?
def solve() -> int: pizza = 12.99 salad = 4.99 tip_rate = 0.18 total_cost = pizza + salad tip = total_cost * tip_rate pay = (total_cost + tip) / 2 result = pay return result
Student: John is delivering furniture with a truck. The truck can hold up to 3000 kilograms. He has two sofas that each weigh 300 kilograms and 4 dressers that each weigh 150 kilograms. How much room is left in the truck?
def solve() -> int: sofa_weight = 300 dresser_weight = 150 truck_capacity = 3000 total_weight = 2 * sofa_weight + 4 * dresser_weight remaining_room = truck_capacity - total_weight result = remaining_room return result
A school has 15 classes, each with 24 students. The school decides to divide each class into two equal groups for a field trip. How many groups will there be in total, and how many students will be in each group?
def solve() -> int: classes = 15 students_per_class = 24 total_groups = classes * 2 students_per_group = students_per_class / 2 result = (total_groups, students_per_group) return result
A rectangle has a length of 6cm and a width of 4cm. What is its perimeter?
def solve() -> int: length = 6 width = 4 perimeter = 2 * (length + width) result = perimeter return result
A flower shop has the same number of customers every day. Each customer buys 1 rose during their visit and is also given a seed packet to take home. The flower shop also buys an extra 5 roses each day to ensure there is always enough. If the flower shop buys 25 roses every day, how many customers visit the shop each da...
def solve() -> int: roses_bought_per_day = 25 extra_roses_bought_per_day = 5 roses_per_customer = 1 total_roses_per_day = roses_bought_per_day + extra_roses_bought_per_day customers_per_day = total_roses_per_day // roses_per_customer result = customers_per_day return result
Student: A farmer has 5 chickens in one coop and 8 in another. If he combines them into one coop, how many chickens will there be in total?
def solve() -> int: chickens_1 = 5 chickens_2 = 8 total_chickens = chickens_1 + chickens_2 result = total_chickens return result
amuel has a bush growing in his garden that is currently 108 inches long. He plants a new bush, and the length of the new bush increases by 50%. What will be the new length of the bush, in inches?
def solve() -> int: length_initial = 108 increase_ratio = 0.5 length_final = length_initial + (length_initial*increase_ratio) result = length_final return result
Mike can run at a speed of 7 miles per hour. If he runs for 2 hours and takes a break for 30 minutes, how many miles will he run in total?
def solve() -> int: time_in_hours = 2 + 0.5/60 distance = time_in_hours * 7 result = distance return result
Kevin was stacking wooden blocks to form a pyramid. He started with one block on the top layer, then added two blocks on the second layer, then three blocks on the third layer, and so on, increasing the number of blocks by one on each layer. How many blocks were there in the pyramid after he added the 9th layer?
def solve() -> int: total_blocks = 0 current_blocks = 1 for i in range(9): total_blocks = total_blocks + current_blocks current_blocks = current_blocks + 1 result = total_blocks return result
Isaac has 20 apples and 9 pears altogether. He wants to divide them into baskets in such a way that each basket contains the same number of apples and pears. How many baskets will there be?
def solve() -> int: apples = 20 pears = 9 total = apples + pears baskets = total / (apples / pears) result = baskets return result
Student: A square has a perimeter of 20 cm. What is the area of the square?
def solve() -> int: perimeter = 20 side_length = perimeter / 4 area = side_length ** 2 result = area return result
A shoe store has 30 pairs of shoes and boots (in total) for sale. Two-thirds of the items are shoes, and a quarter of the shoes have laces included. How many pairs of laced shoes are in the shoe store’s stock in all?
def solve() -> int: total_items = 30 shoes = total_items * 2/3 shoes_with_laces = shoes * 1/4 result = shoes_with_laces return result
The price of a book is initially $20. Each month, the price of the book decreases by $1.50. How much does the book cost on the third month?
def solve() -> int: start_price = 20 price_decrease = 1.5 month = 3 price = start_price - price_decrease*(month-1) result = price return result
There are 24 children in a class. Each child has 5 pencils. How many pencils are there in total in the class?
def solve() -> int: children = 24 pencils_each = 5 total_pencils = children * pencils_each result = total_pencils return result
A library has a total of 600 books. If they organize 20% for a sale, and 40% of the remaining are not available, how many books are available?
def solve() -> int: sale_books = 600 * 0.2 remaining_books = 600 - sale_books not_available_books = remaining_books * 0.4 available_books = remaining_books - not_available_books result = available_books return result
Student: Kevin is a landscaper and charges $30 per lawn for mowing and trimming. He also pays $5 per day for renting a trailer to haul his equipment. On Monday he mowed 4 lawns, on Tuesday he mowed 3 lawns, on Wednesday he mowed 5 lawns, on Thursday he mowed 2 lawns, and on Friday he mowed 6 lawns. How much profit did ...
def solve() -> int: monday_lawns = 4 tuesday_lawns = 3 wednesday_lawns = 5 thursday_lawns = 2 friday_lawns = 6 monday_profit = monday_lawns * 30 tuesday_profit = tuesday_lawns * 30 wednesday_profit = wednesday_lawns * 30 thursday_profit = thursday_lawns * 30 friday_profit = frida...
Student: A car travels 80 miles in 2 hours. What is the average speed of the car in miles per hour?
def solve() -> int: distance = 80 time = 2 average_speed = distance / time result = average_speed return result
A student earned a score of 88, 92, and 95 on her first three tests. What score must she earn on her next test to have an average of 90?
def solve() -> int: test1 = 88 test2 = 92 test3 = 95 average = 90 total = average * 4 - test1 - test2 - test3 result = total return result
Student: David rented a car for a road trip. He paid $50 for the rental fee, $0.2 per mile for the mileage, and $10 for the insurance. He drove 250 miles in total. How much did David pay for the car rental?
def solve() -> int: rental_fee = 50 mileage_rate = 0.2 insurance = 10 miles = 250 total_cost = rental_fee + insurance + mileage_rate * miles result = total_cost return result
Student: A triangle has a base length of 8cm and a height of 10cm. What is the area of the triangle?
def solve() -> int: base = 8 height = 10 area = 0.5 * base * height result = area return result
Student: A man bought a bicycle for $600 and sold it for $480. What was the loss percentage?
def solve() -> int: cost = 600 sell = 480 loss = cost - sell percentage = (loss/cost)*100 result = percentage return result
Here are some possible new questions and programs: Jacob sells lemonade for $0.25 per cup. He made 48 cups of lemonade and sold 36 of them. How much money did Jacob earn from selling lemonade?
def solve() -> int: price = 0.25 cups_made = 48 cups_sold = 36 revenue = price * cups_sold result = revenue return result
Peter has 8 shells in his collection. He found 7 more shells on the beach. How many shells does Peter have in total?
def solve() -> int: shells_in_collection = 8 shells_found = 7 result = shells_in_collection + shells_found return result
James pays $50/hour for 4 hours per week of language lessons and $30/hour for 7 hours per week of math lessons. How much more does he spend on math lessons than language lessons in 3 months?
def solve() -> int: rate_language_lessons = 50 hours_language_lessons = 4 rate_math_lessons = 30 hours_math_lessons = 7 weeks_per_month = 4 months = 3 total_cost_language_lessons = rate_language_lessons * hours_language_lessons * weeks_per_month * months total_cost_math_lessons = rate_ma...
Possible math questions and python programs are: Lisa likes to collect stamps. She buys a new album every month that can hold 200 stamps. She also buys 20 stamps every week from different countries. Each album costs $15 and each stamp costs $0.25. How much does she spend on her hobby in a year?
def solve() -> int: total_cost_albums = 15 * 12 total_cost_stamps = 0.25 * 20 * 52 total_cost_hobby = total_cost_albums + total_cost_stamps result = total_cost_hobby return result
A ladder is leaning against a building wall that is 15 feet high. The ladder touches the wall at a height of 12 feet and is 9 feet away from the building. How long is the ladder?
def solve() -> int: wall_height = 15 touch_height = 12 distance = 9 ladder_length = ((wall_height - touch_height)**2 + distance**2)**0.5 result = ladder_length return result
Sarah is reading a book for her book club. She read for 30 minutes on the first day. On the second day, she read for twice as long as she did on the first day and on the third day, she read 15 minutes less than the previous day. How many minutes did Sarah read in total over the three days?
def solve() -> int: day1 = 30 day2 = day1 * 2 day3 = day2 - 15 total_minutes = day1 + day2 + day3 result = total_minutes return result
Jackson has a rectangular garden that is 10 meters long and 6 meters wide. If he wants to put a fence around the entire garden and fencing costs $4.50 per meter, how much will the fence cost?
def solve() -> int: perimeter = 2 * (10 + 6) fence_cost = perimeter * 4.50 result = fence_cost return result
Student: Lisa has 18 buckets of crayons, each bucket having 13 crayons. She takes 2 buckets with her and gives 7 buckets away. How many crayons does she have left?
def solve() -> int: buckets = 18 crayons_per_bucket = 13 buckets_taken = 2 buckets_given = 7 buckets_left = buckets - buckets_taken - buckets_given crayons_left = buckets_left * crayons_per_bucket result = crayons_left return result
A restaurant needs to order enough ingredients for a week's worth of meals. They need to order enough chicken breasts to make 3 meals a day for 7 days, with 2 chicken breasts per meal. They also need to order enough vegetables to make 3 sides per meal. Each package of chicken breasts contains 8 breasts and each package...
def solve() -> int: meals_per_day = 3 days = 7 chicken_breasts_per_meal = 2 sides_per_meal = 3 breasts_per_package = 8 cups_per_package = 4 total_chicken_breasts = meals_per_day * chicken_breasts_per_meal * days total_chicken_packages = total_chicken_breasts // breasts_per_package + 1 ...
A library had 300 books. 75% of the books were in English, the rest were in other languages. After 2 hours, 30 more English books were added while the number of books in other languages remained constant. If the total number of books was 500 at the end of the day, how many books were not in English at the start of the ...
def solve() -> int: num_books = 300 num_english = round(num_books * 0.75) num_books -= num_english num_english += 30 num_non_english = 500 - num_english result = num_books + num_non_english return result
A car travels at a rate of 50 mph. How many hours will it take to travel 250 miles?
def solve() -> int: distance = 250 rate = 50 time = distance/rate result = time return result
A company offers its employees a 401(k) plan that matches 100% of the employee's contributions up to 6% of their salary. If an employee earns $60,000 a year and contributes the maximum amount, how much will the company contribute to their 401(k) account? Peter is trying to hatch his chicken eggs successfully. The first...
def solve() -> int: salary = 60000 max_contribution = salary * 0.06 company_contribution = max_contribution * 1 result_401k = company_contribution first_incubator = 15 second_incubator = 2 * first_incubator - 4 both_incubators = 3 * second_incubator total_incubation_time = first_incubato...
Isabel's cat weighs 8 pounds more than twice the weight of her dog. If her dog weighs 20 pounds, what is the weight of her cat?
def solve() -> int: dog_weight = 20 cat_weight = 2 * dog_weight + 8 result = cat_weight return result
Student: 4. A toy store sold dolls to 12 customers that day. The first 5 customers each bought 3 dolls, the next 5 customers each bought 2 dolls, and the last 2 customers each bought 1 doll. How many dolls were sold in total?
def solve() -> int: num_customers = 12 num_dolls_first_5 = 3 num_dolls_next_5 = 2 num_dolls_last_2 = 1 total_dolls_sold = (num_customers // 5) * (num_dolls_first_5 * 5 + num_dolls_next_5 * 5) + num_dolls_last_2 * 2 result = total_dolls_sold return result
Carol has four boxes of different colors: red, blue, green, and yellow. She puts some balls in each box according to some rules. The red box has 10 balls, the blue box has 3 more balls than the red box, the green box has twice as many balls as the blue box, and the yellow box has 5 less balls than the green box. She la...
def solve() -> int: red = 10 blue = red + 3 green = 2 * blue yellow = green - 5 label_red = 2 label_blue = 1 label_green = 3 label_yellow = 4 tag_red = label_red * red tag_blue = label_blue * blue tag_green = label_green * green tag_yellow = label_yellow * yellow tota...
On vacation, Karen's family camped for 4 nights and spent a total of $104 on camping fees. How much did they spend on camping fees each night?
def solve() -> int: total_fee = 104 number_of_nights = 4 fee_per_night = total_fee/number_of_nights result = fee_per_night return result
A jewelry store is offering a discount on diamond rings. If you buy 2 rings at the regular price, you can get the next 2 for 20% off. A customer came in and bought 4 rings for $800. What's the regular price of one ring in dollars?
def solve() -> int: rings_bought = 4 total_price = 800 regular_price = total_price / rings_bought discounted_price = regular_price * 0.8 if rings_bought >= 4: regular_price = (total_price - (discounted_price * 2)) / 2 result = regular_price return result
Amy has $3000 in a savings account that earns 4% annual interest. If she doesn't add or withdraw any money for 2 years, how much money will she have in the account at the end of 2 years?
def solve() -> int: principal = 3000 interest_rate = 4 time_period = 2 interest = principal * (interest_rate/100) * time_period amount = principal + interest result = amount return result
Student: Q6: Mary was making cupcakes for her friends and family. She needed 3 eggs, 1 cup of sugar, and 1 cup of flour for each dozen cupcakes. How many eggs does she need if she is making 8 dozen?
def solve() -> int: num_dozen = 8 num_eggs_per_dozen = 3 total_num_eggs = num_dozen * num_eggs_per_dozen result = total_num_eggs return result
Eric is saving up for a trip to Disneyland that will cost $1,000. He currently has $750 saved up and decides to do odd jobs for his neighbors for $20 per hour. If he works for 15 hours, how much money will he have in total?
def solve() -> int: savings = 750 trip_cost = 1000 payment_per_hour = 20 hours_worked = 15 total_payment = payment_per_hour * hours_worked total_money = savings + total_payment result = total_money return result
A grocery store sells juices in boxes. Each box has 12 pouches of juice. If you buy 2 boxes, how many pouches of juice will you have?
def solve() -> int: juice_pouches_per_box = 12 number_of_boxes = 2 total_juice_pouches = juice_pouches_per_box * number_of_boxes result = total_juice_pouches return result
If Kenny ate 1/5 of a large pizza and the entire pizza has 8 slices, how many slices did Kenny eat?
def solve() -> int: total_slices = 8 fraction_eaten = 1/5 slices_eaten = total_slices * fraction_eaten result = slices_eaten return result
Daisy has 3000 dollars in her bank account. She deposits 500 dollars every month. The bank pays her an interest of 5% per year, compounded monthly. How much money does she have in her account after 2 years?
def solve() -> int: money = 3000 deposit = 500 rate = 0.05 months = 24 for i in range(months): money = money + deposit money = money * (1 + rate / 12) result = money return result
Student: The cost of a product was increased from $50 to $60. What is the percentage increase in the cost?
def solve() -> int: initial_cost = 50 final_cost = 60 increase = final_cost - initial_cost percentage_increase = (increase / initial_cost) * 100 result = percentage_increase return result
A company pays its employees $25 per hour if they work less than 40 hours per week and $35 per hour if they work more than 40 hours per week. How much will an employee earn in a week if they work 45 hours?
def solve() -> int: num_hours_worked = 45 if num_hours_worked <= 40: hourly_rate = 25 weekly_earnings = hourly_rate * num_hours_worked else: hourly_rate = 35 weekly_earnings = 40 * 25 + (num_hours_worked - 40) * 35 result = weekly_earnings return result
Andy bought 9 tickets for his friends for a concert, which cost him $990 in total. One ticket was $85, and two other tickets were each $125. If the remaining tickets had the same price, how much did one of those tickets cost?
def solve() -> int: total_cost = 990 cost_first_three = 85 + (125 * 2) total_cost_remaining_items = total_cost - cost_first_three number_of_remaining_items = 9 - 3 price_of_one_remaining_item = total_cost_remaining_items / number_of_remaining_items result = price_of_one_remaining_item retur...
Lily bought a dress for $50, earrings for $20, and a purse for $30. She then paid 10% sales tax. How much money did Lily spend?
def solve() -> int: subtotal = 50 + 20 + 30 sales_tax = subtotal * 0.1 total = subtotal + sales_tax result = total return result
Ethan is going to buy 3 new pairs of shoes. Each pair cost $50 and he get a 10% discount on the 3 pairs plus a $5 discount on each. How much does he pay in total?
def solve() -> int: shoes_price = 50 number_of_shoes = 3 discount_percent = 0.1 discount_price = 5 total_amount = shoes_price * number_of_shoes discount_amount = total_amount * discount_percent + discount_price*number_of_shoes total_payable = total_amount - discount_amount ...
Jonah collects stamps from different countries. He has 12 stamps from Canada, 8 stamps from Japan, and 10 stamps from Brazil. He decides to trade 5 stamps from Canada and 3 stamps from Japan with his friend for 7 stamps from France and 4 stamps from India. How many stamps does Jonah have after the trade?
def solve() -> int: canada = 12 japan = 8 brazil = 10 canada = canada - 5 japan = japan - 3 france = 7 india = 4 total = canada + japan + brazil + france + india result = total return result
Max had $25 and his friend had $13. They went to a bowling alley where they rented shoes for $4 and played two games for $6 each. They also got a basket of fries for $3. The tax came to $2.75. How much change should they have received in total?
def solve() -> int: max_money = 25 friend_money = 13 shoe_rental = 4 game_cost = 6 fries_cost = 3 tax = 2.75 total_cost = shoe_rental + (2 * game_cost) + fries_cost + tax change = max_money + friend_money - total_cost result = change return result
In a store, 65% of the items are on sale. Out of the sale items, 1/10 of them are discounted by 50%. If there are 800 items on sale, how many items are discounted at 50%?
def solve() -> int: total_items_on_sale = 800 non_discounted_items = total_items_on_sale - (total_items_on_sale / 10) discounted_items = non_discounted_items / 2 discounted_items = round(discounted_items) result = discounted_items return result
A company had a revenue of $50,000 in the first quarter of the year. If the revenue for the second quarter decreased by 10%, what was the revenue for the second quarter?
def solve() -> int: first_quarter_revenue = 50000 decrease_percent = 10 decrease_factor = 1 - decrease_percent/100 second_quarter_revenue = first_quarter_revenue * decrease_factor result = second_quarter_revenue return result
Student: Gary and Gigi went to the park. Gary took 4 fewer turns than Gigi in the first round, 7 more turns than Gigi in the second round, and 2 fewer turns than Gigi in the third round. If Gigi took 13 turns in each round, what is the total number of turns taken by Gary?
def solve() -> int: gigi_turns = 13 gary_turns_1 = gigi_turns - 4 gary_turns_2 = gigi_turns + 7 gary_turns_3 = gigi_turns - 2 gary_total_turns = gary_turns_1 + gary_turns_2 + gary_turns_3 result = gary_total_turns return result
A phone plan costs $30 per month with an additional $0.05 per minute of talk time. If John's monthly phone bill was $37.50, how many minutes did he use?
def solve() -> int: monthly_cost = 30 additional_cost_per_minute = 0.05 total_cost = 37.5 total_minutes = (total_cost - monthly_cost) / additional_cost_per_minute result = total_minutes return result
Zach needed to buy 16 pencils, but he only had $5. How much was each pencil?
def solve() -> int: total_cost = 5 number_of_pencils = 16 price_per_pencil = total_cost/number_of_pencils result = price_per_pencil return result
A box contains 7,560 pieces of candy. There are 180 pieces of candy taken out each day. How many days will it take for the box to be empty?
def solve() -> int: total_candy = 7560 taken_candy = 180 total_days = total_candy/taken_candy result = total_days return result
In a class 80% of the students passed the math exam, 30% passed with an A and 24 students passed with an A. How many students are in the class?
def solve() -> int: passing_percentage = 80 passing_with_A_percentage = 30 students_with_A = 24 total_students = (students_with_A * 100) / passing_with_A_percentage result = total_students return result
A grocery store sells apples for $2 per pound and oranges for $1.50 per pound. If a customer buys 3 pounds of apples and 4 pounds of oranges, how much does the customer spend at the store?
def solve() -> int: apple_price_per_pound = 2 orange_price_per_pound = 1.5 num_apple_pounds = 3 num_orange_pounds = 4 total_spent = (num_apple_pounds * apple_price_per_pound) + (num_orange_pounds * orange_price_per_pound) result = total_spent return result
A recipe for chocolate cake calls for 2 1/4 cups of flour. If Tommy wants to make 1/2 recipe, how much flour does he need?
def solve() -> int: full_recipe_flour = 2.25 half_recipe_flour = 0.5*full_recipe_flour result = half_recipe_flour return result
Student: If a group of colleagues go out to lunch and the bill comes out to $75.00 including a 15% tip, how much did the lunch cost before the tip?
def solve() -> int: bill = 75.00 tip_percentage = 15 tip = bill * (tip_percentage/100) cost_before_tip = bill - tip result = cost_before_tip return result
A store sold 100 notebooks and 200 pencils in one week. If 1/4 of the notebooks and 3/5 of the pencils were sold, how many notebooks and pencils were sold?
def solve() -> int: notebooks_sold = 100*(1/4) pencils_sold = 200*(3/5) result = (notebooks_sold, pencils_sold) return result