question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Olivia bought 3 packs of candy, each pack has 15 pieces. How many candies does she have in total?
def solve() -> int: num_packs = 3 pieces_per_pack = 15 total_candies = num_packs * pieces_per_pack result = total_candies return result
Sophia runs for 1 hour every day. If 6 times the time she takes to run to the gym and back is the same as the price of a smoothie, how much will Sophia pay for 5 smoothies?
def solve() -> int: time_to_gym = 10 time_to_run = time_to_gym * 2 time_per_day = 60 days = 1 total_time = time_per_day * days smoothie_price = 6 * time_to_run num_smoothies = 5 total_cost = smoothie_price * num_smoothies result = total_cost return result
A baker purchased 18 bags of flour. Every bag contains 2 gallons of flour. How many gallons of flour does the baker have in total?
def solve() -> int: numBags = 18 bagSize = 2 numGallons = numBags * bagSize result = numGallons return result
Marcus is planning a road trip from New York to San Francisco. His car gets 25 miles per gallon. The distance from New York to San Francisco is approximately 2,800 miles. If gas costs $2.50 per gallon, how much will Marcus need to spend on gas?
def solve() -> int: miles_per_gallon = 25 distance = 2800 cost_per_gallon = 2.5 gallons_needed = distance / miles_per_gallon total_cost = gallons_needed * cost_per_gallon result = total_cost return result
Phone A has a battery life that is 50% more than Phone B. If Phone B has a battery life of 8 hours, how long does Phone A's battery last?
def solve() -> int: phoneB_battery = 8 phoneA_battery = phoneB_battery*1.5 result = phoneA_battery return result
2 scientists collected 1600 specimens. If each scientist needs 800 specimens for their research, how many more specimens do they need to collect?
def solve() -> int: total_specimens = 1600 specimens_per_scientist = 800 specimens_needed = total_specimens - (2 * specimens_per_scientist) result = specimens_needed return result
Student: Jason purchased 3 pairs of tennis shoes and 4 casual shirts for $134. Gabriella purchased 5 pairs of tennis shoes and 2 casual shirts for $130. How much money did Gabriella pay less than Jason?
def solve() -> int: jason_shoes = 3 jason_shirts = 4 jason_total = 134 gabriella_shoes = 5 gabriella_shirts = 2 gabriella_total = 130 shoe_cost = jason_total / (jason_shoes + gabriella_shoes) shirt_cost = jason_total / (jason_shirts + gabriella_shirts) jason_total_cost = (jason_shoes...
arah can run 5 miles in 42 minutes. Emma can run 15% faster than Sarah. How long will it take for Emma to run 5 miles?
def solve() -> int: time_sarah = 42 distance_sarah = 5 speed_sarah = distance_sarah/(time_sarah/60) speed_emma = speed_sarah*1.15 time_emma = distance_sarah/speed_emma*60 result = time_emma return result
Lucy puts $30 in her piggy bank every month for 2 years to save up for her college fees. She spent $500 from her piggy bank savings last week to buy her textbooks. What is the balance in her piggy bank account?
def solve() -> int: monthly_savings = 30 num_months = 2 * 12 total_savings = monthly_savings * num_months textbook_cost = 500 balance = total_savings - textbook_cost result = balance return result
arah sold 25 lemonade cups at her lemonade stand for $0.50 each. It cost her $6.00 to buy the ingredients. How much profit did she make?
def solve() -> int: total_earning = 25 * 0.50 profit = total_earning - 6.00 result = profit return result
Student: While grocery shopping, Kathleen purchased 4 bottles of juice, 2 packages of cookies, and 3 boxes of cereal. If each bottle of juice cost $2.99, each package of cookies cost $3.99 and each box of cereal cost $4.99, how much did she spend in total?
def solve() -> int: juice_quantity = 4 juice_price = 2.99 cookie_quantity = 2 cookie_price = 3.99 cereal_quantity = 3 cereal_price = 4.99 juice_cost = juice_quantity * juice_price cookie_cost = cookie_quantity * cookie_price cereal_cost = cereal_quantity * cereal_price total_cost...
Jennifer bought some books from a bookstore for her daughter. She bought 5 books which cost her $12 each. If she gave $100 to the cashier, how much change will she get back?
def solve() -> int: number_of_books = 5 price_per_book = 12 money_given = 100 total_cost = number_of_books * price_per_book change = money_given - total_cost result = change return result
A runner runs at a constant speed of 8 km/h for 2 hours and then continues at a constant speed of 12 km/h for 1.5 hours. What is the total distance the runner runs?
def solve() -> int: distance_first_leg = 8 * 2 distance_second_leg = 12 * 1.5 total_distance = distance_first_leg + distance_second_leg result = f'<<<{total_distance}>>>' result = total_distance return result
If 6 dolphins can swim 24 kilometers in 3 hours, how many kilometers can 10 dolphins swim in 5 hours?
def solve() -> int: dolphins_1 = 6 distance_1 = 24 time_1 = 3 dolphins_2 = 10 time_2 = 5 speed_1 = distance_1 / time_1 distance_2 = speed_1 * time_2 result = distance_2 return result
If Tim has 7 less marbles than John, who has four times as many as Lisa, and Lisa has 20 marbles, how many more marbles than Tim does John have?
def solve() -> int: lisa_marbles = 20 john_marbles = 4 * lisa_marbles tim_marbles = john_marbles - 7 john_tim_diff = john_marbles - tim_marbles result = john_tim_diff return result
Emily went to a spice market and bought a bag of 2 pounds of black pepper. She then added white pepper such that the ratio of black to white was 3:4. Lastly, she added 6 ounces of dried thyme, which made up 15% of the total weight. How much spice did Emily have in total?
def solve() -> int: black_pepper = 2 white_pepper = (4/3) * black_pepper dried_thyme = 6 total_weight = (dried_thyme / 0.15) total_pepper = black_pepper + white_pepper total_spice = total_pepper + dried_thyme total_spice = round(total_spice, 2) result = total_spice ...
A library has 125 books in the fiction section and 80 books in the non-fiction section. If 15 fiction books and 10 non-fiction books are borrowed, how many books remain in the library?
def solve() -> int: books_in_fiction_section = 125 books_in_non_fiction_section = 80 fiction_books_borrowed = 15 non_fiction_books_borrowed = 10 books_remaining = books_in_fiction_section + books_in_non_fiction_section - fiction_books_borrowed - non_fiction_books_borrowed result = books_remainin...
Mallory went to the store to buy apples, oranges, and peaches. If she bought 8 apples, 12 oranges, and 14 peaches, how much did she spend if each apple cost her 20 cents, each orange cost her 25 cents, and each peach cost her 15 cents?
def solve() -> int: numApples = 8 numOranges = 12 numPeaches = 14 costApple = 0.2 costOrange = 0.25 costPeach = 0.15 totalCost = (numApples * costApple) + (numOranges * costOrange) + (numPeaches * costPeach) result = totalCost return result
A bike travels 20 miles in 1 hour and 30 minutes. What is the average speed of the bike in miles per hour?
def solve() -> int: distance = 20 hours = 1 + 30/60 speed = distance / hours result = speed return result
Sarah likes to bake cookies with her friends. She likes to bake with her friend Emily the most, as she's baked with her 12 times and Emily has only made perfect cookies once. She doesn't like baking with her friend Mike, as she's baked with him four times as many times as she's baked with Emily and Mike has burned the ...
def solve() -> int: emily_bakes = 1 sarah_bakes_with_emily = 12 mike_bakes = sarah_bakes_with_emily * 4 mike_burned_cookies = mike_bakes * 0.6 sarah_perfect_with_emily = sarah_bakes_with_emily - emily_bakes sarah_perfect_with_mike = mike_bakes - mike_burned_cookies total_perfect_cookies = sa...
Jenna needs to mix a solution that is 40% water and 60% vinegar. She wants to mix enough to fill a 12-ounce spray bottle. How much of each liquid should she use?
def solve() -> int: total_volume = 12 water_percent = 0.4 vinegar_percent = 0.6 water_volume = total_volume * water_percent vinegar_volume = total_volume * vinegar_percent result = (water_volume, vinegar_volume) return result
A circle has a diameter of 8 meters. What is the area of this circle?
def solve() -> int: radius = 8/2 area = 3.14 * radius**2 result = area return result
san is making a pizza and needs to buy toppings. Pepperoni costs $2.50 per ounce, mushrooms cost $1.75 per ounce, and olives cost $1.20 per ounce. Susan wants to buy 4 ounces of pepperoni, 3 ounces of mushrooms, and 2 ounces of olives. How much will she spend on toppings?
def solve() -> int: pepperoni_cost = 2.5 * 4 mushrooms_cost = 1.75 * 3 olives_cost = 1.2 * 2 total_cost = pepperoni_cost + mushrooms_cost + olives_cost result = total_cost return result
Dhruv drove 63 miles an hour for 9 and a quarter hours. How many total miles did Dhruv drive?
def solve() -> int: distance_per_hour = 63 time_hours = 9 time_minutes = 15 time_in_hours = (time_hours) + (time_minutes/60) total_miles_driven = distance_per_hour * time_in_hours result = total_miles_driven return result
The ratio of boys to girls in a class is 2:3. If there are 30 students in the class, how many boys are there?
def solve() -> int: total_students = 30 boys_ratio = 2 / 5 boys = boys_ratio * total_students result = f'<<<{boys}>>>' result = boys return result
Grace is a painter. It takes her 4 hours to complete one painting, and each shipment of paints can yield 6 paintings. If she gets an order for 50 paintings and already has 18 paintings, how many shipments of paints does she need to fulfill the order?
def solve() -> int: hours_per_painting = 4 paintings_per_shipment = 6 order_paintings = 50 current_paintings = 18 total_paintings_needed = order_paintings - current_paintings shipments_needed = (total_paintings_needed // paintings_per_shipment) + 1 result = shipments_needed return resul...
Yesterday, Sarah baked 20 cookies. She plans to bake 10 more cookies every day for the next three days. How many cookies will she have baked on the third day?
def solve() -> int: cookies_baked_yesterday = 20 cookies_baked_per_day = 10 days = 3 cookies_baked_on_third_day = cookies_baked_yesterday + (cookies_baked_per_day * (days - 1)) result = cookies_baked_on_third_day return result
A recipe calls for 1 cup of sugar to make 12 cookies. If you want to make 48 cookies, how many cups of sugar do you need?
def solve() -> int: sugar_cups = 1/12*48 result = sugar_cups return result
Below are some possible questions and programs. A car traveled 150 miles in the first 3 hours of a road trip, and then slowed down to an average speed of 40 miles per hour for the remaining 2 hours. What was the total distance, in miles, that the car traveled in the 5 hours?
def solve() -> int: distance1 = 150 distance2 = 40 * 2 total_distance = distance1 + distance2 result = total_distance return result
In a party, there are 3 adults and 2 children. For each adult, they get 2 pieces of pie, and for each child, they get 1 piece of pie. Calculate the total number of pieces of pie in the party.
def solve() -> int: num_of_adults = 3 num_of_children = 2 pie_piece_per_adult = 2 pie_piece_per_child = 1 total_pie_pieces = (num_of_adults * pie_piece_per_adult) + (num_of_children * pie_piece_per_child) result = total_pie_pieces return result
Lauren works at a coffee shop and earns $9.50 per hour. She works for 7.5 hours on Monday and 8 hours on Wednesday. How much did she earn in total for the two days?
def solve() -> int: hours_worked = 7.5 + 8 total_earned = hours_worked * 9.5 result = total_earned return result
Jane is currently 25 years old. In 5 years, her age will be 3 times the age she was 10 years ago. How old was Jane 7 years ago?
def solve() -> int: jane_current_age = 25 jane_future_age = jane_current_age + 5 jane_past_age = jane_current_age - 10 jane_future_age_3x = 3*jane_past_age jane_past_age_7 = jane_past_age - 7 result = jane_past_age_7 return result
Eight people needed to paint a wall in 4 hours. How long would it take two people to paint the same wall?
def solve() -> int: time_to_paint_with_8_people = 4 num_of_people = 8 num_of_people_for_2 = 2 time_to_paint_with_2_people = time_to_paint_with_8_people / (num_of_people / num_of_people_for_2) result = time_to_paint_with_2_people return result
During a sale, a store has a buy-one-get-one-half-off promotion. Sophia bought 4 shirts (all the same price). What was the total cost?
def solve() -> int: num_shirts = 4 price_per_shirt = 20 discounted_price = price_per_shirt * 0.75 total_cost = (num_shirts//2)*discounted_price + (num_shirts%2)*price_per_shirt result = total_cost return result
John has 5 hats and gave away 1 of them. He then buys 8 times the amount he currently has. How many hats does John have now?
def solve() -> int: hats = 5 hats = hats - 1 num_more = hats * 8 hats = hats + num_more result = hats return result
Mary wants to buy a new laptop that costs $900. If she saves $70 from her monthly allowance, how many months does she need to save in order to buy the laptop?
def solve() -> int: laptop_cost = 900 monthly_savings = 70 months_needed = laptop_cost // monthly_savings + 1 result = months_needed return result
========================================================================== Possible questions and programs are: Lucas has five coins in his pocket. Three of them are quarters, each worth 25 cents. The other two are dimes, each worth 10 cents. He buys a candy bar for 75 cents and gets some change. How much change does h...
def solve() -> int: total = 3 * 25 + 2 * 10 change = total - 75 result = change return result
``` A musician has 500 CDs. On the first day, he loses 1/10 of them, and on the second day, he gives away 2/5 of the remaining CDs to fans. How many CDs does he have left?
def solve() -> int: cds = 500 cds_lost_d1 = cds * (1/10) cds_remaining_d1 = cds - cds_lost_d1 cds_given_away_d2 = cds_remaining_d1 * (2/5) cds_remaining_d2 = cds_remaining_d1 - cds_given_away_d2 result = cds_remaining_d2 return result
Student: A school has 24 teachers and 376 students. What is the ratio of students to teachers?
def solve() -> int: teachers = 24 students = 376 ratio = students / teachers result = ratio return result
Student: 5. Frank went on a camping trip and he bought 10 cans of food. He gave 4 cans to each of his friends and kept the remaining cans for himself. How many cans does he have left for himself?
def solve() -> int: cans_bought = 10 cans_given = 4 cans_left = cans_bought - cans_given * 3 result = cans_left return result
Student: Mia swims twice as fast as Noah runs, and Zoe rollerblades five times faster than Noah runs. But Mia can only run one third the speed that Zoe rollerblades. If Mia swims at 6 miles per hour, how fast can Mia run, in miles per hour?
def solve() -> int: m_swim = 6 n_run = None z_roller = None m_run = None n_run = m_swim / 2 z_roller = n_run * 5 m_run = z_roller / 3 result = m_run return result
Nick owns 3 ferrets, 4 rats, and 6 mice. If he spends $12 to feed each ferret, $2 to feed each rat, and $4 to feed each mouse every month, how much does he spend every year to feed all his pets?
def solve() -> int: costPerFerret = 12 costPerRat = 2 costPerMouse = 4 numFerrets = 3 numRats = 4 numMice = 6 monthlyCost = (costPerFerret*numFerrets) + (costPerRat*numRats) + (costPerMouse*numMice) yearlyCost = monthlyCost * 12 result = yearlyCost return resu...
John is painting his living room. He needs to buy paint for the walls. Each can of paint covers 50 square feet and costs $25. His living room has a total of 300 square feet of walls. How many cans of paint will John need to buy and what will be the total cost?
def solve() -> int: total_square_feet = 300 coverage_per_can = 50 cost_per_can = 25 cans_needed = total_square_feet / coverage_per_can total_cost = cans_needed * cost_per_can result = f'John will need to buy {cans_needed} cans of paint, and the total cost will be ${total_cost}.' ...
Student: A bag contains 2 red balls, 3 blue balls, and 1 green ball. If you choose one ball at random, what is the probability that it is not blue?
def solve() -> int: red_balls = 2 blue_balls = 3 green_balls = 1 total_balls = red_balls + blue_balls + green_balls probability = (red_balls + green_balls) / total_balls result = probability return result
John runs a car dealership and has 20 cars that he sells every month. Each car sells for $20,000. How much money does John make in a month?
def solve() -> int: cars_sold = 20 price_per_car = 20000 total_money = cars_sold * price_per_car result = total_money return result
Sarah received a box of chocolates containing 25 pieces. Over three days, she ate 6 pieces each day. How many pieces of chocolate does she have left?
def solve() -> int: chocolates_received = 25 pieces_eaten_per_day = 6 pieces_left = chocolates_received - (pieces_eaten_per_day * 3) result = pieces_left return result
Student: Julia and her brother went to the store. They bought a laptop that cost $1600 and a printer that cost $120. Julia paid $80 more than her brother. How much did her brother pay?
def solve() -> int: laptop_cost = 1600 printer_cost = 120 difference = 80 total_cost = laptop_cost + printer_cost brother_payment = total_cost - difference result = brother_payment return result
In 30 years, Robert will be 3 times as old as Sarah. If Sarah is currently 12 years old, how old is Robert?
def solve() -> int: years = 30 sarah_age = 12 robert_age = (years*3) + sarah_age result = robert_age return result
A rectangle has a length of 6 cm and a width of 8 cm. What is the perimeter of the rectangle?
def solve() -> int: length = 6 width = 8 perimeter = 2*(length + width) result = perimeter return result
A basket contains red and green apples. There are 18 red apples which is five times the number of green apples. Find the total number of apples in the basket.
def solve() -> int: red_apples = 18 green_apples = red_apples / 5 total_apples = red_apples + green_apples result = total_apples return result
His teddy bear is 4 inches taller than his pillow. If his pillow is 16 inches tall, what is the average height for the three of them?
def solve() -> int: pillow_height = 16 teddy_bear_height = pillow_height + 4 leo_height = teddy_bear_height - 2 height_sum = pillow_height + teddy_bear_height + leo_height height_average = height_sum / 3 result = height_average return result
Carlos bought a shirt for $7 and 2 hats for $8 each. How much did he spend in total?
def solve() -> int: shirt = 7 hat = 8 totalExpenditure = shirt + (hat * 2) result = totalExpenditure return result
Amy has a total of $2 and some quarters. If she has 9 quarters in total, how many dollars does she have?
def solve() -> int: total_money = 2 total_quarters = 9 money_dollars = total_money + (total_quarters * 0.25) result = round(money_dollars, 2) return result
Tom wants to give his barber a 10% tip on a $85 bill. If his friend decides to contribute $8, how much should Tom add to the tip?
def solve() -> int: bill = 85 tip_percentage = 0.10 friend_contribution = 8 tip_amount = bill * tip_percentage total_tip = tip_amount + friend_contribution result = total_tip return result
A rectangular room is 8 meters wide and 12 meters long. The owner wants to tile the floor with square tiles of 0.5 meters. How many tiles does he need?
def solve() -> int: n_tiles = (8*12) / (0.5**2) result = int(n_tiles) return result
If Jane can complete a task in half the time it takes Mary, who completes the task in 12 hours, how many hours does it take both of them to complete two tasks?
def solve() -> int: time_mary = 12 time_jane = time_mary / 2 time_both_tasks = 2 * (1 / (1 / time_mary + 1 / time_jane)) result = time_both_tasks return result
Lucas paid $50 for 3 hats. After wearing them for three months, he decided to sell them for $20. How much money did he lose?
def solve() -> int: hats_cost = 50 number_of_hats = 3 selling_price = 20 total_cost = hats_cost * number_of_hats total_selling_price = selling_price * number_of_hats money_lost = total_cost - total_selling_price result = money_lost return result
A company has a profit of $5000 in a year. If there are 365 days in a year, what is the average profit per day?
def solve() -> int: daily_profit = 5000 / 365 result = daily_profit return result
A movie theater has 100 seats. If the movie is sold out and the theater makes $12 from each adult ticket and $8 from each child ticket, and the theater sold 70 adult tickets and 30 child tickets, how much money did the theater make?
def solve() -> int: num_adult_tickets = 70 num_child_tickets = 30 adult_ticket_price = 12 child_ticket_price = 8 total_revenue = (num_adult_tickets * adult_ticket_price) + (num_child_tickets * child_ticket_price) result = total_revenue return result
Student: Mia sells cupcakes at a bake sale. She makes 4 batches of chocolate, 3 batches of vanilla, and 2 batches of red velvet cupcakes. Each batch has 12 cupcakes. She sells each cupcake for 2 dollars. She spends 20 dollars on ingredients and 10 dollars on packaging. How much profit does she make?
def solve() -> int: num_chocolate = 4 * 12 num_vanilla = 3 * 12 num_red_velvet = 2 * 12 total_num_cupcakes = num_chocolate + num_vanilla + num_red_velvet cost_ingredients = 20 cost_packaging = 10 total_cost = cost_ingredients + cost_packaging revenue = total_num_cupcakes * 2 profit =...
A student received the following grades in a subject: first quiz result was 80 points (out of 100), second quiz result was 70 points (out of 100) and final exam result was 90 points (out of 100). If the first quiz and second quiz results carry 20% weightage each, while the final exam carries a 60% weightage, what is th...
def solve() -> int: weightage_quiz1 = 0.2 weightage_quiz2 = 0.2 weightage_exam = 0.6 score_quiz1 = 80 score_quiz2 = 70 score_exam = 90 weighted_score_quiz1 = weightage_quiz1 * score_quiz1 weighted_score_quiz2 = weightage_quiz2 * score_quiz2 weighted_score_exam = weightage_exa...
A rectangular box measures 24 cm in length, 15 cm in width and 18 cm in height. What is the volume of the box in cubic cm?
def solve() -> int: length = 24 width = 15 height = 18 volume = length * width * height result = volume return result
Anna wants to give out 40 cards for her friend's birthday. If each card cost $0.50, how much money will she need to spend on the cards?
def solve() -> int: price_card = 0.50 num_card = 40 result = price_card * num_card return result
Alicia had 25 packets of stickers. She traded seven packets with her friend for some candies. Then, she gave away half as many packets as she had traded to her sister. Finally, she found eight more packets of stickers in her closet. How many packets of stickers did Alicia have in the end?
def solve() -> int: packets = 25 packets = packets - 7 packets = packets - (7 / 2) packets = packets + 8 result = packets return result
Ryan can swim 50 meters in 40 seconds. How many meters can he swim in 2 minutes?
def solve() -> int: swim_speed = 50 / 40 swim_distance = swim_speed * 2 * 60 result = swim_distance return result
A shoe store buys 5 boxes of shoes for $250 each. Each shoe costs $10 to make and the store sells each shoe for $25. How much money did the store make if they sold all the shoes?
def solve() -> int: cost = 1250 amount = 250 price_selling = 25 price_making = 10 total_making = amount*price_making total_selling = amount*price_selling profit = total_selling-cost result = profit return result
Tim has a fish tank that can hold 20 liters of water. He wants to fill it with water and some goldfish. Each goldfish needs 2 liters of water to live comfortably. He also wants to leave some space for decorations. He decides to fill the tank with 18 liters of water. How many goldfish can he put in the tank?
def solve() -> int: water_for_goldfish = 18 - 2 goldfish = water_for_goldfish / 2 goldfish = int(goldfish) result = goldfish return result
Oliver wants to purchase a backpack that costs $75.00. He has a coupon for 15% off the purchase. He also wants to add a monogrammed tag to the backpack for $12.50. The shipping fee is $8.00. What is the total cost of the backpack and tag?
def solve() -> int: backpack_cost = 75.00 coupon = 0.15 tag_cost = 12.50 shipping_fee = 8.00 discount = backpack_cost * coupon new_backpack_cost = backpack_cost - discount total_cost = new_backpack_cost + tag_cost + shipping_fee result = total_cost return result
Last year, a bookstore sold 400 books during a book fair. This year, they increased their sales by 30%. How many books did they sell this year?
def solve() -> int: books_last_year = 400 increase_percentage = 30 increase_decimal = increase_percentage / 100 books_this_year = books_last_year + (books_last_year * increase_decimal) result = books_this_year return result
Ethan played seven fewer video games last week than this week. Last week, he played eighteen video games. How many video games did Ethan play in two weeks?
def solve() -> int: last_week = 18 this_week = last_week + 7 total_games = last_week + this_week result = total_games * 2 return result
``` An amusement park charges $25 per person for admission. If the park has 5000 visitors in a day, how much money do they make in one day?
def solve() -> int: visitors = 5000 price_per_ticket = 25 revenue = visitors * price_per_ticket result = revenue return result
Student: A family drove 345 miles in one day. They drove at an average speed of 60 miles per hour. How long did the trip take in hours?
def solve() -> int: distance = 345 speed = 60 time = distance / speed result = time return result
Missy is trying to eat more healthily. She tracks the calories of her meals and wants to know the total number of calories she's eating each day. Here are the calories for her meals this week: - Monday: 400 - Tuesday: 600 - Wednesday: 300 - Thursday: 550 - Friday: 700 - Saturday: 450 - Sunday: 500 What is the average n...
def solve() -> int: calories = [400, 600, 300, 550, 700, 450, 500] total_calories = sum(calories) days = len(calories) avg_calories = total_calories / days result = avg_calories return result
A car rental company offers 3 types of cars: economy, standard, and luxury. The rental rate per day for the cars is $40, $50, and $100, respectively. If the company rented out 200 cars in a day and earned $19,500, how many of each type of car did they rent out?
def solve() -> int: number_of_economy_cars = 100 number_of_standard_cars = 80 number_of_luxury_cars = 20 result = (number_of_economy_cars, number_of_standard_cars, number_of_luxury_cars) return result
Susan has 36 marbles. She gave 1/3 of them to her friend and another 1/4 of them to her sister. How many marbles does she have now?
def solve() -> int: marbles = 36 friend_marbles = marbles / 3 sister_marbles = marbles / 4 total_given_away = friend_marbles + sister_marbles remaining_marbles = marbles - total_given_away result = remaining_marbles return result
Last week, Rachel read five books. They have a total of 1000 pages. Her brother read one book a day that has 50 pages each. They both finished them in 10 days. On average, how many more pages per day did Rachel read compared to her brother?
def solve() -> int: rachel_books = 5 rachel_pages = 1000 total_days = 10 brother_pages_per_day = 50 brother_pages = brother_pages_per_day * total_days rachel_pages_per_day = (rachel_pages - brother_pages) / total_days difference = rachel_pages_per_day - brother_...
Kelly bought 3 packs of pencils. Each pack has 12 pencils. She uses 9 pencils for her homework and gives 6 pencils to her brother. How many pencils does Kelly have left?
def solve() -> int: bought_pencils = 3 * 12 used_gave_pencils = 9 + 6 left_pencils = bought_pencils - used_gave_pencils result = left_pencils return result
Student: John is putting a fence around his garden. He needs 16 pieces of wood for the fence and each piece of wood costs $13. How much money will he spend on the fence?
def solve() -> int: pieces_of_wood = 16 cost_per_piece = 13 total_cost = pieces_of_wood * cost_per_piece result = total_cost return result
Jack wants to purchase a new watch for his brother. The watch is currently priced at $120.00 and is 20% off. Jack wants to engrave his brother's initials on the back for an additional $15.00. If the shipping cost is a flat rate of $12.00, what is the total cost of the watch and engraving?
def solve() -> int: price = 120.00 discount = 0.20 engraving = 15.00 shipping = 12.00 discounted_price = price - (price * discount) total_price = discounted_price + engraving total_cost = total_price + shipping result = total_cost return result
A car travels at a speed of 75 kilometers/hour for 3 hours. How many kilometers does the car travel in total in those 3 hours?
def solve() -> int: speed = 75 time = 3 distance = speed * time result = distance return result
Maya is tracking her dairy intake per day. She drinks 1 cup of milk in the morning, 1 slice of cheese in the afternoon, and 1 cup of yogurt in the evening. If a cup of milk has 10 grams of sugar, a slice of cheese has 5 grams of protein, and a cup of yogurt has 15 grams of protein, how many grams of protein does Maya g...
def solve() -> int: milk_cup = 1 cheese_slice = 1 yogurt_cup = 1 milk_sugar = 10 cheese_protein = 5 yogurt_protein = 15 total_protein = (milk_cup * milk_sugar) + (cheese_slice * cheese_protein) + (yogurt_cup * yogurt_protein) result = total_protein return result
Peter and John went to a store to buy shirts. Peter bought two more shirts than John and the average price of John's shirts was $25. If Peter spent a total of $150, what was the average price of Peter's shirts?
def solve() -> int: avg_price_john = 25 peter_paid = 150 x = 0 y = 0 x = y + 2 total_shirts = x + y avg_price_peter = (peter_paid - avg_price_john*y) / x result = avg_price_peter return result
Student: Alyssa is baking bread. She has a recipe that requires 4 cups of flour to make 2 loaves of bread. If Alyssa wants to make 5 loaves of bread, how many cups of flour will she need?
def solve() -> int: loaves = 5 flour_per_loaf = 4 total_flour = loaves * flour_per_loaf result = total_flour return result
Alice has a pack of 72 crayons. 25 of them are red, 15% are blue, and the rest are yellow. How many yellow crayons does she have?
def solve() -> int: blue_crayons = 0.15 * 72 yellow_crayons = 72 - 25 - blue_crayons result = yellow_crayons return result
Laura is knitting a sweater from 20 balls of yarn. If she has used 7 balls of yarn, how many more balls of yarn does she need to finish the sweater?
def solve() -> int: balls_of_yarn_total = 20 balls_of_yarn_used = 7 balls_of_yarn_needed = balls_of_yarn_total - balls_of_yarn_used result = balls_of_yarn_needed return result
Brian does 8 hours of workout every day and has 6 different exercises in his routine. He spends a total of 1.5 hours on two exercises. On average, how many minutes does he do each remaining exercise per day?
def solve() -> int: hours_per_day = 8 total_exercises = 6 time_spent_on_two_exercises = 1.5 remaining_exercises = total_exercises - 2 total_time_spent = hours_per_day - time_spent_on_two_exercises average_time_per_exercise = total_time_spent / remaining_exercises average_time_per_e...
Student: A group of school children is cleaning up the park. They decide to collect empty soda cans in bags. Each hour, they fill up 6 bags of cans. After 5 hours, they have already collected 30 bags. How many more hours will they need to collect a total of 54 bags?
def solve() -> int: bags_per_hour = 6 hours_worked = 5 bags_collected = 30 bags_goal = 54 bags_remaining = bags_goal - bags_collected hours_remaining = bags_remaining / bags_per_hour result = hours_remaining return result
Kevin had 500 stickers in his collection. He gave away 1/10 of them to his friends, then bought 50 more stickers from a store. He traded 1/4 of his stickers with his brother for some cards, then lost 1/6 of his stickers while playing outside. How many stickers did he have left?
def solve() -> int: stickers = 500 stickers -= stickers // 10 stickers += 50 stickers -= stickers // 4 stickers -= stickers // 6 result = stickers return result
Sam has a rectangular garden that is 12 meters long and 8 meters wide. He wants to plant flowers along the perimeter of the garden, leaving 1 meter of space between each flower. How many flowers can he plant?
def solve() -> int: length = 12 width = 8 space = 1 perimeter = 2 * (length + width) spaces = perimeter // space flowers = spaces - 1 result = flowers return result
There are 200 marbles in a bag. 30% of the marbles are blue, 40% are green, and the rest are red. How many red marbles are there?
def solve() -> int: total_marbles = 200 blue_ratio = 0.3 green_ratio = 0.4 red_ratio = 1 - blue_ratio - green_ratio red_marbles = red_ratio * total_marbles result = red_marbles return result
A worker is paid $12.50 per hour for their normal working hours and $18.75 per hour for any overtime hours. If the worker works 45 hours in a week, where 5 of those hours were overtime, how much money will they earn for the week?
def solve() -> int: normal_pay_rate = 12.50 overtime_pay_rate = 18.75 normal_hours = 40 overtime_hours = 5 total_pay = (normal_pay_rate * normal_hours) + (overtime_pay_rate * overtime_hours) result = total_pay return result
At a picnic, Mrs. Johnson brought 4/7 times as many sandwiches as drinks. If there were 42 drinks, and each person needed 2 sandwiches and 1 drink, how many people could be fed?
def solve() -> int: drinks = 42 sandwiches = (4/7) * drinks people = sandwiches // 2 result = people return result
A farmer has 6 times as many pigs as chickens. If he buys 11 more chickens, he will have 5 times as many pigs as chickens. How many pigs and chickens does he have?
def solve() -> int: pigs = 0 chickens = 0 result = 0 for chickens in range(0,1000): pigs = chickens * 6 if (pigs + (11 * 5)) / 5 == chickens: result = [pigs, chickens] break return result
Rachel went to the pet store to buy some pets. She bought 2 rabbits, 5 cats, and 8 fish, all in a single paper bag. Unfortunately, the bag had a hole and half of the pets fell out. When she counted the pets left in the bag, there were only 7 pieces remaining. How many cats did she buy?
def solve() -> int: rabbits = 2 cats = 5 fish = 8 total_pets = rabbits + cats + fish pets_left = total_pets / 2 cats_bought = pets_left - rabbits - fish result = cats_bought return result
Lorenzo works as a delivery driver, but he only works on odd days of the month. On October he made $1100. How much money did he make in August?
def solve() -> int: August_days = 31 October_days = 31 August_salary = 1100/October_days * August_days result = August_salary return result
In a town, 40% of the households own a dog and 50% of those households have a dog that weighs over 50 pounds. If there are 8000 households in the town, how many households own a dog that weighs over 50 pounds?
def solve() -> int: total_households = 8000 dog_owners = 0.4 * total_households big_dog_owners = 0.5 * dog_owners result = big_dog_owners return result
Josh wants to buy a dozen eggs for his breakfast. The regular price for an egg is $0.50 and is now on sale at a 20% discount. How much will Josh pay for the eggs?
def solve() -> int: regular_price = 0.50 discount = 0.20 sale_price = regular_price - (regular_price * discount) dozen_eggs = 12 total_price = sale_price * dozen_eggs result = total_price return result
Leo wants to buy hot dogs for himself and his 5 friends. Each hot dog costs $3.50 and can feed 1 person. If Leo earns $5 a night selling lemonade, how many nights will he have to sell lemonade to afford the hot dogs?
def solve() -> int: num_friends = 5 cost_per_hotdog = 3.50 total_hotdogs = num_friends + 1 total_cost = total_hotdogs * cost_per_hotdog earnings_per_night = 5 nights_to_afford = total_cost / earnings_per_night result = nights_to_afford return result
Jack owns a collection of vintage vinyl records. He has 80 rock records and three times as many jazz records. He intends to give away classical records to his friend, which will be 15% of his entire collection. How many records does Jack have left after giving some away?
def solve() -> int: rock_records = 80 jazz_records = 3 * rock_records total_records = rock_records + jazz_records classical_records = 0.15 * total_records remaining_records = total_records - classical_records result = remaining_records return result
Rita sells handmade bracelets for $8 each. She spends $2 on materials for each bracelet and pays $50 for a table at a craft fair. How many bracelets does she need to sell to break even?
def solve() -> int: net_profit = 8 - 2 break_even = 50 / net_profit result = break_even return result