question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Chris wants to buy a new phone that costs $600. To be able to pay this price, he gets a loan from the bank, at a rate of 10%. He already has $200 saved and he pays an additional $100 right away, how much money does he still need to loan from the bank?
def solve() -> int: phone_price = 600 rate = 0.1 saved = 200 paid = 100 loan = (phone_price - (saved + paid)) * (1 + rate) result = loan return result
A group of 20 friends went out to dinner. If the total bill before tax and tip was $180, how much does each person owe if they split the bill evenly?
def solve() -> int: number_of_friends = 20 total_bill = 180 result = total_bill / number_of_friends return result
John has three times as many marbles as Jane. Jane has 12 marbles. How many marbles do they have in total?
def solve() -> int: jane_marbles = 12 john_marbles = jane_marbles * 3 total_marbles = jane_marbles + john_marbles result = total_marbles return result
Peter has a bottle of cooking oil that contains 1 liter. He used 250ml to fry some chicken and then forgot to put the lid on it, which caused the oil to evaporate by a fifth of what was left. If Peter wants a full bottle of oil in the kitchen, how many milliliters of oil does he need to buy?
def solve() -> int: oil_bottle = 1000 oil_used = 250 oil_left = oil_bottle - oil_used evaporated = oil_left / 5 oil_needed = oil_bottle - oil_left - evaporated result = oil_needed return result
Jonah's Diner has 300 eggs required for 30 customers. How many eggs are needed if there are 10% fewer customers?
def solve() -> int: eggs_per_customer = 300 / 30 reduced_customers = 30 - (30 * 0.1) eggs_needed = eggs_per_customer * reduced_customers result = eggs_needed return result
James and Anna are swimming a 200-meter race. Anna is 30 meters ahead when she speeds up by 15 meters. James follows with a 25-meter sprint. By how many meters is Anna still leading?
def solve() -> int: race_distance = 200 anna_lead = 30 anna_speed_up = 15 james_sprint = 25 anna_distance = anna_lead + anna_speed_up james_distance = anna_distance + james_sprint anna_remaining_lead = race_distance - james_distance result = anna_remaining_lead ...
A teacher grades 15 exams per hour. If she works for 4 hours a day, 5 days a week, how many exams does she grade in total in a month with 4 weeks?
def solve() -> int: exams_per_hour = 15 hours_per_day = 4 days_per_week = 5 weeks_per_month = 4 total_exams = exams_per_hour * hours_per_day * days_per_week * weeks_per_month result = total_exams return result
A recipe for cookies calls for 3/4 cup of sugar for 12 cookies. How much sugar is needed for 24 cookies?
def solve() -> int: sugar_for_12_cookies = 3/4 sugar_for_24_cookies = sugar_for_12_cookies * 2 result = sugar_for_24_cookies return result
Sarah drives 75 miles in 1.5 hours. If she wants to drive 150 miles, how long will it take her?
def solve() -> int: time = 150/75 result = time*1.5 return result
If three apples weigh 0.75lbs, how much will 12 apples weigh?
def solve() -> int: apples_weight = 0.75/3 total_apples = 12 total_weight = apples_weight * total_apples result = total_weight return result
A store has 100 apples in total. 20% of the apples are bad. If the store sells 50% of the good apples, how many good apples are left?
def solve() -> int: good_apples = (1-0.2)*100*0.5 result = good_apples return result
A boat travels upstream at a speed of 20 km/hr and downstream at 64 km/hr. If the boatmaker covers the distance in 5 hours, find the speed of the current.
def solve() -> int: upstream_speed = 20 downstream_speed = 64 total_time = 5 distance = (upstream_speed + downstream_speed) * total_time / 2 speed_of_current = (downstream_speed - upstream_speed) / 2 result = round(speed_of_current) return result
Sarah goes to the toy store to buy some games. She buys 3 board games for $10 each, 2 video games for $20 each, and 4 packs of playing cards for $2 each. When she gets to the register, she realizes she only has $100 bills in her wallet. How many $100 bills does she need to use to pay?
def solve() -> int: board_games = 3 video_games = 2 playing_cards = 4 board_game_price = 10 video_game_price = 20 playing_card_price = 2 total_cost = (board_games * board_game_price) + (video_games * video_game_price) + (playing_cards * playing_card_price) number_of_bills ...
A zoo has 10 exhibits and 80% of them are open to public. The other exhibits are reserved for animal breeding. If each exhibit can contain five animals and each animal weighs 200kg, what is the maximum weight capacity of the zoo?
def solve() -> int: num_exhibits = 10 open_exhibits = num_exhibits * 0.8 reserved_exhibits = num_exhibits - open_exhibits animals_per_exhibit = 5 animal_weight = 200 total_animals = open_exhibits * animals_per_exhibit total_weight = total_animals * animal_weight result = total_weight ...
There are 254 students in a school. If 36 students are absent, and each classroom can fit 27 students, how many classrooms will be needed to accommodate the remaining students?
def solve() -> int: remaining_students = 254 - 36 num_classrooms = remaining_students/27 result = int(num_classrooms) + 1 return result
Ben and Cathy are collecting stamps for their hobby. Ben has 12 pages of stamps and each page has 9 rows of 5 stamps. Cathy has 15 pages of stamps and each page has 6 rows of 6 stamps. They decide to trade some stamps so that they have the same number of stamps. How many stamps should they trade and who should give mor...
def solve() -> int: ben_pages = 12 ben_rows = 9 ben_stamps_per_row = 5 ben_stamps = ben_pages * ben_rows * ben_stamps_per_row cathy_pages = 15 cathy_rows = 6 cathy_stamps_per_row = 6 cathy_stamps = cathy_pages * cathy_rows * cathy_stamps_per_row total_stamps = ben_stamps + ...
Mark is planning a camping trip. He rents a tent for $80, a stove for $20, and a cooler for $15. He also buys $50 worth of food and $30 worth of camping supplies. What is the total cost of Mark's camping trip?
def solve() -> int: total_rental_cost = 80 + 20 + 15 total_camp_cost = 50 + 30 total_cost = total_rental_cost + total_camp_cost result = total_cost return result
Curtis filled a car tank with 22 gallons of gasoline. How many liters of gasoline did he fill?
def solve() -> int: gallons = 22 liters = gallons * 3.785 result = liters return result
At a bakery, there are 25 chocolate cakes and 35 vanilla cakes. If 40% of the chocolate cakes and 60% of the vanilla cakes are sold in a day, how many cakes are left?
def solve() -> int: chocolate_cakes_sold = (40/100) * 25 vanilla_cakes_sold = (60/100) * 35 total_cakes_sold = chocolate_cakes_sold + vanilla_cakes_sold remaining_cakes = (25-chocolate_cakes_sold) + (35-vanilla_cakes_sold) result = remaining_cakes return result
Athena has 70 dollars more than Theo. If Theo has half as much money as Elena, and Elena has 230 dollars, how much more money does Athena have than Elena?
def solve() -> int: x = 230 y = x/2 z = y + 70 result = z-x return result
Henry is 8 years older than his friend William, and their ages combined equal 38. How old is William? Jenny started with 200 marbles. She gave away 30 marbles and got 15 more from her friend. Then she realized she needed to use 25 marbles for her craft project. If she wants to keep 5 extra marbles, how many marbles doe...
def solve() -> int: w = (38 - 8) / 2 h = w + 8 j = 200 - 30 + 15 - 25 + 5 result = w result = j return result
If the value of 5 apples and 3 bananas is $13 and the value of 3 apples and 4 bananas is $11, what is the value of 1 apple and 1 banana?
def solve() -> int: a = (13*4 - 11*3) / (5*4 - 3*3) b = (11 - 3*a) / 4 result = round(a+b, 2) return result
If Mia read 15 more than three times the pages that Leo read and Leo read 828 pages, how many more pages did Mia read?
def solve() -> int: leo_pages = 828 mia_pages = 3 * leo_pages + 15 difference = mia_pages - leo_pages result = difference return result
A math competition has 50 participants. If there are 10 prizes to be won, what is the probability of winning a prize?
def solve() -> int: probability_of_winning = 10 / 50 result = probability_of_winning return result
Student: John was riding his bike and saw an interesting landmark miles away, so he decided to ride his bike to get there. It took him 6 hours to bike the 100 miles to arrive at the landmark. If his bike can ride at a consistent speed, how many miles per hour was he biking?
def solve() -> int: distance = 100 time = 6 speed = None speed = distance / time result = speed return result
Sophia brings pitchers of lemonade to a barbecue to share. Each pitcher contains 32 ounces. She brings 2 total pitchers. Her friend says that for every pitcher she brings, they will provide eleven more identical ones. There are 36 guests at the barbecue. How many ounces of lemonade does each guest get?
def solve() -> int: sophia_pitchers = 2 friend_pitchers = 11 * sophia_pitchers total_pitchers = sophia_pitchers + friend_pitchers total_ounces = total_pitchers * 32 num_guests = 36 ounces_per_guest = total_ounces / num_guests result = ounces_per_guest r...
Michael has 24 baseball cards. Brandon has twice as many baseball cards as Michael, and Jacob has 3 fewer baseball cards than Michael. How many baseball cards do Brandon and Jacob have together?
def solve() -> int: michael_cards = 24 brandon_cards = 2 * michael_cards jacob_cards = michael_cards - 3 total_cards = brandon_cards + jacob_cards result = total_cards return result
Jack buys 22 boxes of cookies for his friends. Each box contains 8 chocolate chip cookies, 4 peanut butter cookies, and 2 oatmeal raisin cookies. Upon opening the boxes, he finds that 4 of them have 1 extra chocolate chip cookie inside. How many chocolate chip cookies did Jack end up with?
def solve() -> int: boxes = 22 chocolate_chip_cookies_per_box = 8 extra_chocolate_chip_cookies = 4 total_chocolate_chip_cookies = boxes * chocolate_chip_cookies_per_box + extra_chocolate_chip_cookies result = total_chocolate_chip_cookies return result
A chocolate bar has 250 calories and costs $1. If Jennifer wants to have 750 calories, how many chocolate bars does she need to buy?
def solve() -> int: choco_calories = 250 choco_cost = 1 goal_calories = 750 num_bars = goal_calories/choco_calories result = int(num_bars) return result
A bookstore has 550 books in total. John buys 2/5 of the books and Jane buys 1/3 of the remaining books. How many books are left in the bookstore?
def solve() -> int: total_books = 550 john_books = total_books * 2/5 remaining_books = total_books - john_books jane_books = remaining_books * 1/3 left_books = remaining_books - jane_books result = left_books return result
Pat builds two brick walls side-by-side with the same amount of bricks at each wall. One wall has 30 rows of 5 bricks and the other has 20 rows of 10 bricks. How many bricks is Pat using in total?
def solve() -> int: num_walls = 2 brick_rows = [30, 20] bricks_per_row = [5, 10] total_bricks = 0 for i in range(len(brick_rows)): total_bricks += num_walls * brick_rows[i] * bricks_per_row[i] result = total_bricks return result
In order to qualify for a marathon, a runner must run an average of 7.5 miles per hour for 12 hours. After running for 5 hours, the runner has only averaged 6 miles per hour. How fast must the runner run for the remainder of the 12 hours in order to qualify for the marathon?
def solve() -> int: average_speed_required = 7.5 total_time = 12 time_elapsed = 5 average_speed_elapsed = 6 distance_covered_elapsed = average_speed_elapsed * time_elapsed distance_remaining = average_speed_required * total_time - distance_covered_elapsed time_remaining = total_time - t...
Student: A recipe calls for 1/4 cup of oil per 1 cup of flour. If there are 6 cups of flour, how many cups of oil are needed?
def solve() -> int: oil_per_flour = 1/4 flour = 6 oil = oil_per_flour * flour result = oil return result
Megan has 52 crayons. She gives 5/16 of them away. How many crayons does she have left?
def solve() -> int: c = 52 f = 5/16 crayons_given = c * f crayons_left = c - crayons_given result = crayons_left return result
Lily is curious about when her aunt was born. She knows her aunt's older sister was born in 1964, her younger brother was born in 1970, and the gap between her aunt and her brother is three times the gap between the older sister and the aunt. What year was Lily's aunt born?
def solve() -> int: gap = 1970 - 1964 gap2 = gap / 4 birth_year = 1964 + gap2 result = int(birth_year) return result
Student: A gas station sells regular gasoline for $3 per gallon and premium gasoline for $3.50 per gallon. If the station sold 100 gallons of regular gas and 50 gallons of premium gas, what is the total revenue from gas sales?
def solve() -> int: regular_price = 3 premium_price = 3.50 regular_gallons = 100 premium_gallons = 50 regular_revenue = regular_price * regular_gallons premium_revenue = premium_price * premium_gallons result = regular_revenue + premium_revenue return result
There is a garden with 7 rows and 6 columns, and each square in the garden contains 50 carrots. How many carrots are there in the garden?
def solve() -> int: total_carrots = 0 for x in range(7): for y in range(6): total_carrots = total_carrots + 50 result = total_carrots return result
In a cricket team, the average batting score of 11 of the 12 players is 25 runs. How many runs has the 12th player scored if the average batting score increases to 28 runs when the 12th player's score is included?
def solve() -> int: initial_average = 25 players_considered = 11 new_average = 28 total_players = 12 total_score_before = initial_average * players_considered total_score_after = new_average * total_players player_12_score = total_score_after - total_score_before result = player_12_...
Emma can bake a pie in 45 minutes and cook a chicken in 1 hour. How long will it take her to bake 2 pies and cook 3 chickens?
def solve() -> int: pie_time = 45 chicken_time = 60 total_pie_time = 2 * pie_time total_chicken_time = 3 * chicken_time total_time = total_pie_time + total_chicken_time result = total_time return result
A store is having a 20% off sale. If you buy a shirt originally priced at $30, how much will you save?
def solve() -> int: original_price = 30 discount_percent = 20 discount_amount = original_price * (discount_percent / 100) result = discount_amount return result
A basket can hold 18 oranges. Charlie has 6 baskets which he bought for $72. He wants to sell the oranges for $1.2 per orange but 6 oranges were rotten. How much will be Charlie's profit from selling those oranges?
def solve() -> int: total_oranges = 6 * 18 sellable_oranges = total_oranges - 6 revenue = sellable_oranges * 1.2 cost = 72 profit = revenue - cost result = profit return result
Dave rode his bike for 2 hours at a speed of 15 km/h, then for another 1.5 hours at a speed of 12 km/h. What was his average speed for the entire trip?
def solve() -> int: time1 = 2 time2 = 1.5 distance1 = time1 * 15 distance2 = time2 * 12 total_distance = distance1 + distance2 total_time = time1 + time2 average_speed = total_distance / total_time result = average_speed return result
A movie theater has 300 seats. If 3/5 of them are already sold, how many seats are still available?
def solve() -> int: total_seats = 300 sold_seats = total_seats * (3/5) available_seats = total_seats - sold_seats result = available_seats return result
Jack has 100 marbles and he gives 5 marbles to each of his friends. If Jack has 12 friends, how many marbles will he have left?
def solve() -> int: num_marbles = 100 marbles_per_friend = 5 num_friends = 12 marbles_left = num_marbles - (marbles_per_friend * num_friends) result = marbles_left return result
Maya and her friends sold their homemade baked goods at the farmer's market. Maya received twice as much as her friend, who received $900. If Maya saved 3/4 of her money, what is the total amount of money the two made together?
def solve() -> int: maya_earnings = 900 * 2 maya_savings = maya_earnings * 3/4 total_earnings = maya_earnings + 900 result = total_earnings return result
Student: To fill a swimming pool, it takes 420 gallons of water. On the first day, the pool is filled with 150 gallons of water. How much water is left to fill the pool?
def solve() -> int: pool_capacity = 420 water_filled_on_first_day = 150 water_left_to_fill = pool_capacity - water_filled_on_first_day result = water_left_to_fill return result
A school has 300 students and 25 teachers. If the student-teacher ratio should be 12:1, how many more teachers should be hired to meet the ratio?
def solve() -> int: students = 300 teachers = 25 ratio = 12 students_per_teacher = students / teachers teachers_needed = students / ratio teachers_to_hire = teachers_needed - teachers result = teachers_to_hire return result
Ali wants to make cupcakes for his classmates. He has a recipe that makes 12 cupcakes and requires 2 eggs, 1 cup of milk, and 3 cups of flour. Ali has 8 eggs, 3 cups of milk, and 9 cups of flour in his kitchen. How many cupcakes can he make with the ingredients he has?
def solve() -> int: cupcakes_per_batch = 12 eggs_per_batch = 2 milk_per_batch = 1 flour_per_batch = 3 eggs = 8 milk = 3 flour = 9 batches_with_eggs = eggs / eggs_per_batch batches_with_milk = milk / milk_per_batch batches_with_flour = flour / flour_per_batch ...
A bookshelf has 5 shelves, and each shelf can hold 15 books. If you have 70 books, how many empty spaces are there on the bookshelf?
def solve() -> int: num_shelves = 5 books_per_shelf = 15 total_books = num_shelves * books_per_shelf empty_spaces = total_books - 70 result = empty_spaces return result
Alex works as a waiter at a restaurant, where he earns $8 an hour. He also gets $0.50 for each drink he serves, and 15% of the total bill as a tip. How much does he earn (before taxes) in a 4-hour shift if he serves 20 drinks, and the total bill for his tables is $320?
def solve() -> int: hourly_wage = 8 * 4 drink_fee = 0.5 * 20 tip = 0.15 * 320 earning = hourly_wage + drink_fee + tip result = earning return result
A store offers a 10% discount on all items. How much will an item costing $50 cost after the discount is applied?
def solve() -> int: original_price = 50 discount_percent = 10 discount_amount = original_price * (discount_percent / 100) final_price = original_price - discount_amount result = final_price return result
ven and Alex are cutting down a box into two similar pieces. If the length of the box is 40cm and the width is 20cm, what will be the area of each piece after it is cut?
def solve() -> int: l = 40 w = 20 total_area = l * w result = total_area / 2 return result
You have 50 flowers and you want to divide them evenly into 5 vases. How many flowers will be in each vase?
def solve() -> int: num_flowers = 50 num_vases = 5 flowers_per_vase = num_flowers // num_vases result = flowers_per_vase return result
David, Diana, and Devon earned $670 in total by doing part-time jobs together in a week. David earned $x. Diana earned $30 more than four times David's earnings, and Devon earned $50 less than Diana's earnings. How much did Devon earn?
def solve() -> int: x = 670 / 9 diana_earnings = 4 * x + 30 devon_earnings = diana_earnings - 50 result = devon_earnings return result
Jake had 450 pages of a book he needed to read. He read 3/10 of the pages in the morning, and then 1/6 of the remaining pages in the afternoon. How many pages still needed to be read?
def solve() -> int: pages = 450 read_morning = pages * 3/10 pages_left = pages - read_morning read_afternoon = pages_left * 1/6 pages_left = pages_left - read_afternoon result = pages_left return result
Student: Monica went to an electronics store. She saw a 35% increase in the price of the tablet she wants to buy. If the tablet originally costs $400, how much will she pay for the tablet?
def solve() -> int: original_price = 400 percentage_increase = 0.35 increase_in_price = original_price * percentage_increase new_price = original_price + increase_in_price result = new_price return result
A box contains 36 markers. You take out 8 markers. What percentage of markers are left in the box?
def solve() -> int: total_markers = 36 markers_removed = 8 markers_left = total_markers - markers_removed percent_left = markers_left / total_markers * 100 result = percent_left return result
A store sells 50 bottles of water every day. If each bottle costs $1.50, how much money does the store make in a week?
def solve() -> int: bottles_per_day = 50 price_per_bottle = 1.5 days_per_week = 7 total_sales = bottles_per_day * price_per_bottle * days_per_week result = total_sales return result
A basket has 10 candles and 12 flags. Mark added 3 candles and 2/3 of the original numbers of flags. His grandfather gave him 4/5 of the added flags. Calculate the total number of flags and candles Mark now has.
def solve() -> int: candles=10 flags=12 added_candles=3 added_flags=2/3*flags grandfather_flags=4/5*added_flags total_candles=candles+added_candles total_flags=flags+added_flags+grandfather_flags result = total_candles, total_flags return result
Some possible questions are: Aaron has a stamp collection. He has 5 times as many animal stamps as flower stamps, and 3 times as many flower stamps as flag stamps. If he has 36 flag stamps, how many animal stamps does he have?
def solve() -> int: flag = 36 flower = 3 * flag animal = 5 * flower result = animal return result
In his first month at the gym, Trainer Gomez trained three times as many clients as Trainer Rivera. Trainer Kim trained seven fewer clients than Trainer Gomez in the same amount of time. If Trainer Gomez trained 21 clients, how many clients did the three of them train altogether?
def solve() -> int: gomez_clients = 21 rivera_clients = gomez_clients / 3 kim_clients = gomez_clients - 7 total_clients = gomez_clients + rivera_clients + kim_clients result = total_clients return result
Student: Bethany had $225 and was able to save 1/4 of it. How much money did she save?
def solve() -> int: amount = 225 fraction = 1/4 saved = amount * fraction result = saved return result
Student: A school is holding a fundraiser by selling cookies. Each of the 25 classes is given 8 boxes of cookies to sell. The first class sells 3 boxes and splits the money equally among the 20 students. The second class sells 5 boxes and gives $2 to each of the 15 students and the rest to the teacher. The last class s...
def solve() -> int: boxes_per_class = 8 classes = 25 box_cost = 12 first_class_students = 20 second_class_students = 15 last_class_students = 18 second_class_teacher_share = 2 last_class_ratio = (3, 2, 1) total_money = boxes_per_class * classes * box_cost first_class_mone...
Dave serves pizza at the local restaurant. Every pizza has 8 slices and he currently has 144 slices of pizza. How many pizzas can Dave make?
def solve() -> int: pizza_slices = 144 slices_needed = 8 result = pizza_slices//slices_needed return result
Mike is setting up a toy store. He needs to stack 150 toys. On each shelf, he can stack 5 toys vertically and 5 sets of vertically stacked toys side-by-side. How many shelves does he need to stock all the toys?
def solve() -> int: toys_per_shelf = 5 * 5 total_toys = 150 shelves_needed = total_toys // toys_per_shelf result = shelves_needed return result
A bakery made 150 cupcakes in 2 hours. How many cupcakes can they make in 5 hours?
def solve() -> int: cupcakes_per_hour = 75 hours = 5 total_cupcakes = cupcakes_per_hour * hours result = total_cupcakes return result
Student: Jennifer leant two of her friends a total of $400 with an interest of 6% and the duration of the loan was one month. How much should each of them return to Jennifer?
def solve() -> int: total_amount = 400 interest_rate = 0.06 duration = 1 total_amount_with_interest = total_amount * (1 + interest_rate * duration) amount_each_friend = total_amount_with_interest / 2 result = amount_each_friend return result
A petting zoo has 50 goats. Each goat eats 1 pound of food per day. 40% of the goats require a special diet that costs $3 per pound. What is the total cost of feeding these goats for a month?
def solve() -> int: goats = 50 food_per_goat = 1 special_diet_percentage = 0.4 special_diet_cost = 3 total_food_per_day = goats * food_per_goat special_diet_goats = total_food_per_day * special_diet_percentage regular_diet_goats = total_food_per_day - special_diet_goats total_c...
Joe has 4 oranges, 2 apples, and 3 bananas. How many pieces of fruit does he have in total?
def solve() -> int: num_oranges = 4 num_apples = 2 num_bananas = 3 result = num_oranges + num_apples + num_bananas return result
Susan saves $75 every two weeks. She spends $35 every four weeks on a subscription to a magazine. How long will it take her to save $200?
def solve() -> int: savings_per_week = 75 / 2 savings_per_month = savings_per_week * 4 subscription_per_month = 35 total_savings = 0 months = 0 while total_savings < 200: total_savings += savings_per_month - subscription_per_month months += 1 result = months ret...
A fruit basket contains 4 apples and 7 oranges. If there are a total of 15 fruits in the basket, how many apples are there?
def solve() -> int: total_fruits = 15 apples_ratio = 4 / (4 + 7) apples = apples_ratio * total_fruits result = apples return result
A math class has 25 students and the average score on a test was 80. However, one student was suspected of cheating and their score was dropped from consideration. What is the new average score of the class?
def solve() -> int: class_size = 25 total_score = 2000 cheater_score = 95 new_total_score = total_score - cheater_score new_class_size = class_size - 1 new_average_score = new_total_score / new_class_size result = new_average_score return result
Maria started running at 6:30 am and finished running at 7:15 am. If she ran at a constant pace of 6 miles per hour, how far did Maria run?
def solve() -> int: time_taken = 0.75 speed = 6 distance = time_taken * speed result = distance return result
Amy has $100 and decides to split it equally between her 5 friends. How much money does each friend get?
def solve() -> int: each_will_get = 100/5 result = each_will_get return result
A car travels 60 miles per hour. If the car travels for 3.5 hours, how far does it travel in total?
def solve() -> int: speed = 60 time = 3.5 distance = speed * time result = distance return result
Lisa has $1200 in her savings account and can save $150 every month. She wants to save up for a new laptop that costs $1200. How long will it take for Lisa to save enough money for the laptop?
def solve() -> int: goal_amount = 1200 current_savings = 1200 monthly_savings = 150 num_months = (goal_amount - current_savings) / monthly_savings result = num_months return result
If a box of crayons contains 8 reds, 10 blues, and 16 greens in the first three rows and 2 fewer of each in the fourth row, how many crayons are in the box?
def solve() -> int: reds_first_three_rows = 8 blues_first_three_rows = 10 greens_first_three_rows = 16 reds_fourth_row = reds_first_three_rows - 2 blues_fourth_row = blues_first_three_rows - 2 greens_fourth_row = greens_first_three_rows - 2 total_crayons = (reds_first_three_rows + ...
A car rental agency charges three times as much for a luxury car as for a standard car. If they charge $20 per day for a standard car, how much will they charge per day for a luxury car?
def solve() -> int: standard_car_price = 20 luxury_car_price = standard_car_price * 3 result = luxury_car_price return result
Cindy and David share a bag of candy. There are 30 pieces of candy in the bag. Cindy takes 12 pieces and David takes the rest. Cindy gives 4 pieces to her friend Amy and David gives 6 pieces to his friend Bob. How many pieces of candy do Cindy and David have left together?
def solve() -> int: total_candy = 30 cindy_candy = 12 david_candy = total_candy - cindy_candy cindy_give = 4 david_give = 6 cindy_remain = cindy_candy - cindy_give david_remain = david_candy - david_give total_remain = cindy_remain + david_remain result = total_remain ret...
Mary has twice as many apples as John. John has 5 apples. How many apples does Mary have?
def solve() -> int: john_apples = 5 mary_apples = john_apples * 2 result = mary_apples return result
Student: A construction worker can build a wall alone in 5 days. Another worker can build the same wall in 8 days. How long will it take them to build the wall if they work together?
def solve() -> int: worker_1 = 5 worker_2 = 8 total_time = worker_1 + worker_2 result = total_time return result
Robin wants to buy a dress that has been marked down to $42, this price is at 30% off the original price. What was the original price of the dress?
def solve() -> int: original_price = 42 / (1 - 0.30) result = original_price return result
price = 60 discount = 0.25 total_price = price * 2 discounted_price = price + (price * discount) final_price = total_price - discounted_price result = final_price A customer wants to buy three items priced at $20, $30, and $40. If a store is offering a 15% discount on purchases over $50, should they buy all three items...
def solve() -> int: item1_price = 20 item2_price = 30 item3_price = 40 total_price = item1_price + item2_price + item3_price discount_threshold = 50 discount = 0.15 if total_price >= discount_threshold: discount_applied = True price_with_discount = total_price * (1 - discount...
Jeff was able to purchase 8 bags of chips for $10 each, and Ryan was able to purchase 10 cups for $5 each. How much more did Jeff spend than Ryan?
def solve() -> int: bags_of_chips = 8 price_of_chips = 10 cups = 10 price_of_cups = 5 total_spent_by_Jeff = bags_of_chips * price_of_chips total_spent_by_Ryan = cups * price_of_cups result = total_spent_by_Jeff - total_spent_by_Ryan return result
Levi is currently 180 cm tall, which is 20 cm taller than he was 4 years ago. 4 years ago, how tall was Levi?
def solve() -> int: current_height = 180 difference = 20 four_years_ago_height = current_height - difference result = four_years_ago_height return result
John has 40 coins consisting of dimes and quarters. If the total value of his coins is $8.10, calculate the number of quarters he has.
def solve() -> int: num_coins = 40 dime_value = 0.10 quarter_value = 0.25 total_value = 8.10 num_quarters = (total_value - num_coins * dime_value) / (quarter_value - dime_value) result = num_quarters return result
There are 340 students in a school, and there are 5 times as many girls as boys. How many boys are there in the school?
def solve() -> int: total_students = 340 girls = 5 * (total_students // 6) boys = total_students // 6 result = boys return result
There are 200 students in a school. If 40% of them are boys and the rest are girls, how many girls are there in the school?
def solve() -> int: students = 200 boys = students * 0.4 girls = students - boys result = girls return result
A company has 3 products: Product A for $10, product B for $20, and product C for $30. They sell 50 of product A, 20 of product B, and 5 of product C, and make $1200. How many of each product did they sell?
def solve() -> int: product_A_price = 10 product_B_price = 20 product_C_price = 30 product_A_sold = 50 product_B_sold = 20 product_C_sold = 5 total_money = product_A_price*product_A_sold + product_B_price*product_B_sold + product_C_price*product_C_sold result = "Product A ...
A toy store has a collection of 200 plushies displayed in a showcase. 10 kids buy 3 plushies each from the showcase on a particular day, and 25 more plushies are sold on the second day. How many plushies are remaining in the showcase after the second day?
def solve() -> int: plushies_in_showcase = 200 kids_on_first_day = 10 plushies_bought_by_each_kid = 3 plushies_sold_on_second_day = 25 plushies_sold_on_first_day = kids_on_first_day * plushies_bought_by_each_kid plushies_remaining_after_first_day = plushies_in_showcase - plushies_sold_on_fi...
Jacob bought 15 oranges for $0.5 each. Each orange could be cut into 12 slices. He sold 10 slices for $2 each. How much profit did Jacob make?
def solve() -> int: num_oranges = 15 cost_per_orange = 0.5 total_cost = num_oranges * cost_per_orange slices_per_orange = 12 total_slices = num_oranges * slices_per_orange price_per_slice = 2 num_slices_sold = 10 * num_oranges total_revenue = num_slices...
John has to fill his gas tank every month. His car's gas tank holds 20 gallons of gas, and the gas station charges $3.50 per gallon. If John fills his gas tank every 2 weeks, how much does he spend on gas in a year?
def solve() -> int: gallon = 20 price = 3.5 fill_frequency = 2 fill_per_year = 52/fill_frequency total_cost = fill_per_year * gallon * price result = total_cost return result
A toy shop sells puzzles in boxes of 6 and 9. Tim bought 5 boxes of 9 puzzles and 4 boxes of 6 puzzles. If he wants to donate the puzzles to an orphanage that has 75 children, how many puzzles will each child receive? How many puzzles will be left over?
def solve() -> int: total_puzzles = 5 * 9 + 4 * 6 quotient = total_puzzles // 75 remainder = total_puzzles % 75 result = quotient, remainder return result
Student: John drove 240 miles in 4 hours. If he continued driving at the same speed, how far would he have gone in 7 hours?
def solve() -> int: distance_driven = 240 time_driven = 4 time_to_drive = 7 speed = distance_driven / time_driven distance_in_7_hours = speed * time_to_drive result = distance_in_7_hours return result
Mary and Lily flew kites in a park for 45 minutes. Mary flew her kite at a constant speed of 5 mph, while Lily flew her kite at a constant speed of 6 mph. If the wind was blowing in the same direction for both kites, how much farther did Lily’s kite travel?
def solve() -> int: speed1 = 5/60 speed2 = 6/60 distance1 = speed1 * 45 distance2 = speed2 * 45 result = distance2 - distance1 return result
Joe and Julie went biking. Joe biked 14 miles and Julie biked 2 times as many miles as Joe. How many miles did Julie bike?
def solve() -> int: miles_joe = 0 miles_julie = 0 miles_julie = 14 - miles_joe miles_joe = 14 - 2 * miles_julie result = miles_julie return result
David is a painter. He has two less paint brushes than he has fingers, and seven more canvases than he has hands. He also has three more paint tubes than he has heads, and two fewer easels than he has canvases. How many painting tools does David have in total?
def solve() -> int: fingers = 10 hands = fingers / 5 paint_brushes = fingers - 2 canvases = hands + 7 heads = 1 paint_tubes = heads + 3 easels = canvases - 2 total_tools = paint_brushes + canvases + paint_tubes + easels result = total_tools return result
Jose used his car to travel from his house to his office, which is 20 miles away. He returned home, and when he refueled his car, it took 2.5 gallons of fuel. If his car mileage is 28 miles per gallon, how many miles per gallon did he get traveling to his office and back?
def solve() -> int: miles = 20*2 fuel = 2.5 mileage = miles/fuel result = round(mileage, 1) return result
A store has a total of 300 items. If 15% of them are fruits and 30% of the remaining items are vegetables, how many items are neither fruits nor vegetables?
def solve() -> int: items = 300 fruits = items * 0.15 remaining = items - fruits vegetables = remaining * 0.3 other_items = remaining - vegetables result = other_items return result
Dan bought a dozen donuts for $4.80. He ate 4 donuts and gave 2 donuts to his sister. He decided to sell the remaining donuts for 50 cents each. How much money did he lose or gain from this transaction?
def solve() -> int: profit_or_loss = 3 - 4.8 result = profit_or_loss return result