question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Timothy planted some sunflower seeds in his backyard. Each sunflower produced 8 seeds on average. In the first month, he harvested 16 sunflowers. In the second month, he planted all the seeds from the first harvest and harvested 24 sunflowers. If he repeated this process for the third month, how many sunflowers did he ...
def solve() -> int: sunflowers = 16 seeds = sunflowers * 8 sunflowers = seeds seeds = sunflowers * 8 sunflowers = seeds result = sunflowers return result
A department store is having a sale where all merchandise is being sold for 10% off. If the original price of a toaster is $30.00, what is the sale price of the toaster? Keep two decimal places in your answer.
def solve() -> int: original_price = 30.00 discount_percent = 10 discount_amount = (discount_percent/100) * original_price sale_price = original_price - discount_amount result = round(sale_price,2) return result
Student: It takes 3 hours to mow a lawn and 2 hours to weed a garden. What is the total time in minutes to mow 2 lawns and weed 1 garden?
def solve() -> int: time_mow_lawn = 3 * 60 time_weed_garden = 2 * 60 total_time = (2 * time_mow_lawn) + time_weed_garden result = total_time return result
There are 53 cows in a farm and three times as many donkeys as cows. The total number of chickens is a third of the number of cows and donkeys. If there are eight times the number of pigs as chickens, how many more cows are there than pigs?
def solve() -> int: num_cows = 53 num_donkeys = num_cows * 3 total = num_cows + num_donkeys num_chickens = total / 3 num_pigs = num_chickens * 8 result = num_cows - num_pigs return result
Student: A hotel charges $150 per night for a room, with an extra $25 per night for each additional guest. A family of 4 stays for 3 nights. How much do they need to pay?
def solve() -> int: room_price = 150 extra_guest_price = 25 num_guests = 4 num_nights = 3 total_price = room_price * num_nights + extra_guest_price * (num_guests - 1) * num_nights result = total_price return result
A recipe for a cake requires 2 cups of sugar for every 3 cups of flour. If we have 10 cups of flour, how many cups of sugar do we need?
def solve() -> int: sugar_per_flour = 2 / 3 flour = 10 x = flour * sugar_per_flour result = x return result
A teacher earns a $400 bonus for each student who scores above 90 in their final exam. If Amanda has 25 students and 20 of them scored above 90, what bonus will she receive?
def solve() -> int: num_students = 25 num_above_90 = 20 bonus_per_student = 400 total_bonus = num_above_90 * bonus_per_student result = total_bonus return result
A pizza has 8 slices. Alice ate 2 slices, Bob ate 3 slices, and Charlie ate 1 slice. How many slices are left for David?
def solve() -> int: slices_eaten = 2 + 3 + 1 slices_left = 8 - slices_eaten result = slices_left return result
Jonny is taking a quiz and there are 7 questions, each question worth 16 points. How many points can Jonny get if he gets all the questions right?
def solve() -> int: questions = 7 points = 16 total_points = questions * points result = total_points return result
A pool is 30 feet long and 20 feet wide, and 6 feet deep at the deep end and 4 feet deep at the shallow end. What is the average depth of the pool in feet?
def solve() -> int: length = 30 width = 20 shallow_depth = 4 deep_depth = 6 average_depth = (shallow_depth + deep_depth) / 2 result = average_depth return result
A pizza place claims that their large pizza has a diameter of 18 inches. Calculate the area of the pizza in square inches, given that pi is 3.14.
def solve() -> int: radius = 18/2 area = 3.14 * radius**2 result = area return result
Rachel bought a dress that was on sale for 20% off of the original price of $100. Before she checked out, the store applied an additional discount of 10%. How much did Rachel pay for the dress?
def solve() -> int: original_price = 100 discount_1_percent = 0.2 discount_2_percent = 0.1 discounted_price_1 = original_price*(1-discount_1_percent) discounted_price_2 = discounted_price_1*(1-discount_2_percent) result = discounted_price_2 return result
Jack and Jill share a bag of candies. Jack takes one third of the candies and Jill takes one fourth of the remaining candies. If there are 18 candies left in the bag, how many candies were there in the beginning?
def solve() -> int: left_after_jack = 18 / (1 - 1/4) left_before_jack = left_after_jack / (1 - 1/3) candies = left_before_jack result = candies return result
Student: A rectangle has a width of 12 cm and a length of 18 cm. If the area is decreased by 1/3, what is the new area of the rectangle?
def solve() -> int: width = 12 length = 18 area = width * length new_area = area * (1 - 1/3) result = new_area return result
A student gets $5000 every semester for college. He spends $3000 on tuition fees and spends $2000 on books and other supplies. If he saves half of the remaining amount, how much money does he save each semester?
def solve() -> int: income = 5000 tuition_fees = 3000 other_expenses = 2000 remaining_income = income - tuition_fees - other_expenses savings = remaining_income / 2 result = savings return result
Emma got a score of 74 out of 100 in her math test. How many more points will she need to score to get a grade of 85?
def solve() -> int: score = 74 total = 100 goal = 85 needed_score = (goal/100)*total - score result = needed_score return result
A store is having a 20% off sale. If an item originally cost $50, what is the new price?
def solve() -> int: original_price = 50 discount_percent = 0.2 discount = original_price * discount_percent new_price = original_price - discount result = new_price return result
A recipe calls for 2/3 cup of sugar for 12 muffins. How much sugar is needed for 24 muffins?
def solve() -> int: sugar_per_muffin = 2/3 num_muffins = 24 num_muffins_in_recipe = 12 total_sugar = sugar_per_muffin * (num_muffins/num_muffins_in_recipe) result = total_sugar return result
A skyscraper is expanding its number of floors from 10 to 30. On the first day, two floors are built, and three times this amount is built on the second day. How many more floors need to be built to complete the expansion?
def solve() -> int: initial_floors = 10 final_floors = 30 day1_floors = 2 day2_floors = 3 * day1_floors total_floors_built = day1_floors + day2_floors floors_left = final_floors - initial_floors - total_floors_built result = floors_left return result
A bookshelf contains 120 books. If 50% of the books are fiction and 25% of the books that are not fiction are self-help, how many books are self-help and fiction?
def solve() -> int: total_books = 120 fiction_books = total_books * 0.50 non_fiction_books = total_books - fiction_books self_help_books = non_fiction_books * 0.25 self_help_and_fiction_books = fiction_books + self_help_books result = self_help_and_fiction_books return result
There are 135 children in Susan's class. Susan divided the children into 5 groups, each with the same amount of children. How many children are in each group?
def solve() -> int: Total_children = 135 Num_groups = 5 Children_per_group = Total_children//Num_groups result = Children_per_group return result
In a town with a population of 50,000, the number of people who voted in an election increased by 25% from 2019 to 2020. If 60% of eligible voters actually voted in 2020, how many people voted in the election in 2020?
def solve() -> int: pop_2019 = 50000 incr_percent = 0.25 pop_2020 = pop_2019 * (1 + incr_percent) voted_percent = 0.6 voted_num = pop_2020 * voted_percent result = voted_num return result
Alexa purchased six times more candies for her little sister than for herself. If she bought 24 candies for herself, how many candies did she buy in total?
def solve() -> int: x = 24 sister_candies = 6 * x total_candies = x + sister_candies result = total_candies return result
Rebecca is making soap for her friends. Each soap requires 8 lavender petals, 14 rose petals, and three times as many jasmine petals as lavender petals. How many petals does she need for 11 soaps?
def solve() -> int: lavender_petals_per_soap = 8 rose_petals_per_soap = 14 jasmine_petals_per_soap = 3 * lavender_petals_per_soap soaps = 11 total_petals_needed = (lavender_petals_per_soap + rose_petals_per_soap + jasmine_petals_per_soap) * soaps result = total_petals_needed result retu...
A school trip had a total cost of $2000. 20 students planned to go but 6 students dropped out. The remaining students split the remaining cost equally. If each student had to pay $10 more than they originally planned, how many students went on the trip?
def solve() -> int: total_cost = 2000 num_students = 20 num_dropouts = 6 remaining_cost = total_cost - (num_dropouts * (total_cost / num_students)) new_cost_per_student = ((remaining_cost / (num_students - num_dropouts)) + 10) num_attendees = remaining_cost / new_cost_per_student result = nu...
Sarah has to send 900 pounds of clothes that are packed in bags of 15 pounds each. If the cost of sending each bag is $1.25, how much will Sarah pay for the shipment?
def solve() -> int: bags_weight = 15 total_weight = 900 cost_per_bag = 1.25 num_bags = total_weight // bags_weight total_cost = num_bags * cost_per_bag result = total_cost return result
Student: Kim ordered a pizza and a salad from a restaurant. The pizza cost $12 and the salad cost $6. She also gave a 15% tip to the delivery person. The delivery fee was $3. How much did she pay?
def solve() -> int: pizza_cost = 12 salad_cost = 6 tip_percentage = 0.15 delivery_fee = 3 total_cost = pizza_cost + salad_cost + delivery_fee + (pizza_cost + salad_cost + delivery_fee) * tip_percentage result = total_cost return result
Daniel has a mortgage of $200,000 on which he pays a monthly interest rate of 0.3%. If he wants to pay off the mortgage in 30 years, how much does he need to pay each month?
def solve() -> int: principal = 200000 years = 30 interest_rate = 0.003 months = years * 12 numerator = principal * interest_rate * ((1+interest_rate)**months) denominator = ((1+interest_rate)**months) - 1 monthly_payment = numerator / denominator result = monthly_payment return res...
A bag of marbles contains 8 red marbles, 5 blue marbles, and 3 green marbles. If you randomly draw one marble, what is the probability that it will be blue?
def solve() -> int: num_blue = 5 num_total = 8 + 5 + 3 probability = num_blue / num_total result = probability return result
A student bought 3 books, 2 pencils, and 1 ruler for $35. The cost of each book is $10, each pencil $1, and each ruler $5. How much did the student pay for the books?
def solve() -> int: books = 3 pencils = 2 rulers = 1 total_cost = 35 book_cost = 10 pencil_cost = 1 ruler_cost = 5 total_book_cost = books * book_cost total_pencil_cost = pencils * pencil_cost total_ruler_cost = rulers * ruler_cost book_percentage = total_book_cost / (total_b...
A factory produces screws with three dimensions: length, width and height. Any screw which is too long, too wide, or too high cannot be sold. The factory inspection has found that 2% are too long, 3% are too wide, and 1% are too high. What percent of screws produced by the factory can be sold?
def solve() -> int: good_screws = 0.97 * 0.98 * 0.99 result = good_screws * 100 return result
- Nina wants to buy some candy, a drink, and a toy. Candy costs 2 dollars, a drink costs 1.5 dollars and a toy costs 4 dollars. Nina has 5 dollars. How much more money should Nina save?
def solve() -> int: candy = 2 drink = 1.5 toy = 4 money = 5 total_cost = candy + drink + toy difference = total_cost - money result = difference return result
The perimeter of a square is 20cm. What is the length of each side of the square?
def solve() -> int: perimeter = 20 side_length = perimeter / 4 result = side_length return result
Noah has 15 candy bars. He eats 2 of them and gives 3 to his sister. Then he finds 4 more candy bars under his bed. How many candy bars does he have left?
def solve() -> int: candy_bars = 15 candy_bars = candy_bars - 2 - 3 candy_bars = candy_bars + 4 result = candy_bars return result
Amy has a rectangular garden that is 12 meters wide and 15 meters long. If she wants to put a fence around the entire garden, how many meters of fence will she need?
def solve() -> int: width = 12 length = 15 perimeter = 2*(width + length) result = perimeter return result
A store offers a 20% discount on items that are priced at $50 or more. What is the final price of an item that originally cost $75?
def solve() -> int: original_price = 75 discount_rate = 0.2 if original_price >= 50: discount_amt = original_price * discount_rate final_price = original_price - discount_amt else: final_price = original_price result = final_price return result
Ethan has 15 pencils and gives away 3 to his friends. If he wants to have 18 pencils in total, how many more pencils does he need to acquire?
def solve() -> int: initial_pencils = 15 pencils_given_away = 3 desired_total_pencils = 18 pencils_left = initial_pencils - pencils_given_away pencils_needed = desired_total_pencils - pencils_left result = pencils_needed return result
Brian and Danielle run a hair salon. Brian charges $30 for haircuts, $60 for perms, and $100 for dye jobs, but he needs to buy a box of hair dye for $35 to dye every head of hair. Today, he has four haircuts, two perms, and three dye jobs scheduled. If he makes $55 in tips, how much money will he have in dollars at the...
def solve() -> int: cost_cut = 30 cost_perm =60 cost_dye = 100 cost_dye_box = 35 num_cut = 4 num_perm = 2 num_dye = 3 tip = 55 total_cost_cut = num_cut*cost_cut total_cost_perm = num_perm*cost_perm total_cost_dye = num_dye*cost_dye total_cost_dye_box = num_dye*cost_...
Student: During a sale, a store offers a 20% discount on all items. If an item costs $50 before the discount, how much will it cost after the discount?
def solve() -> int: price_before_discount = 50 discount_percentage = 0.2 discount_amount = price_before_discount * discount_percentage price_after_discount = price_before_discount - discount_amount result = price_after_discount return result
A gardener is planting a garden with flowers. The gardener has planted fourteen flowers together already to make a circle. For each flower it planted into the circle, it wants to add three more flowers to fill out the garden. It knows a neighbor that has given a fifth of the flowers it needs. How many flowers will the ...
def solve() -> int: planted = 14 add_per_planted = 3 total_needed = (planted * add_per_planted) + planted given_by_neighbor = total_needed / 5 still_needed = total_needed - given_by_neighbor result = still_needed return result
A store is having a sale and all items are 20% off. If an item originally costs $50, how much will it cost with the discount?
def solve() -> int: original_price = 50 discount = 0.2 price_after_discount = original_price - (original_price * discount) result = price_after_discount return result
If David had 15 apples and shared them evenly with his 4 friends, how many apples did each person get?
def solve() -> int: apples = 15 friends = 4 result = apples / friends return result
One year ago, Emma was seven times the age of her baby cousin. In 8 years, her baby cousin will be 10. How old is Emma now?
def solve() -> int: baby_cousin_age_8_years = 10 emma_age_1_year_ago = baby_cousin_age_8_years - 8 - 7*(1+8) emma_age_now = emma_age_1_year_ago + 1 result = emma_age_now return result
Sue has 4 gallons of water. If she drinks a half gallon per day, how many days will it take Sue to drink all the water?
def solve() -> int: gallons = 4 drinks_per_day = 0.5 days = gallons/drinks_per_day result = f'{days}' result = days return result
Ben has 3 dogs. The big dog eats 2 cups of food twice a day, while the small dogs eat 1 cup of food twice a day. How much food will Ben need for the next 3 days? Samantha wanted to become a doctor. She went to college for 6 years to get a degree in biology. She then went on to get 3 more degrees in other medical-relate...
def solve() -> int: big_dog_cups_per_day = 2 * 2 small_dogs_cups_per_day = 1 * 2 total_cups_per_day = big_dog_cups_per_day + (small_dogs_cups_per_day * 2) total_cups_for_3_days = total_cups_per_day * 3 years_in_college = 6 other_degrees_years = 3 * 3 neurology_masters_years = 2 tota...
Alicia has a stack of 50 envelopes to mail out. She can mail 5 envelopes at a time. How many trips to the post office will Alicia need to make to mail all 50 envelopes?
def solve() -> int: envelopes_per_trip = 5 total_envelopes = 50 trips = total_envelopes // envelopes_per_trip result = trips return result
A digital camera costs $150. If Luna saves $5 every day, in how many days will she have enough money to buy the camera?
def solve() -> int: camera_cost = 150 daily_savings = 5 days_to_save = camera_cost / daily_savings result = days_to_save return result
A rectangle has one side that is equal to twice its width. If the rectangle’s perimeter is 60, what are its dimensions?
def solve() -> int: perimeter=60 side_width_ratio=3/2 side_length_ratio=5/2 total_ratio=side_width_ratio+side_length_ratio width=perimeter/total_ratio*side_width_ratio length=perimeter/total_ratio*side_length_ratio result=(width,length) return result
Ben downloads 10 podcasts every week, each with a size of 40 MB (megabytes). He wants to store them on a USB flash drive that has a capacity of 8 GB (gigabytes). How many weeks can he do this before the flash drive is full?
def solve() -> int: usb_capacity = 8 * 1024 podcast_size = 40 podcasts_per_week = 10 * podcast_size weeks = usb_capacity / podcasts_per_week weeks = int(weeks) result = weeks return result
There are 200 goodie bags in total and 40 are already given out. If there are 5 kids in a group and there are a total of 39 kids, how many groups can be formed using the remaining goodie bags?
def solve() -> int: remaining_goodie_bags = 200-40 groups = remaining_goodie_bags/5 result = f'{groups} groups can be formed using the remaining goodie bags' result = groups return result
A music store owner buys CDs for $6 each and sells them for $15. The owner has to pay $2500 in rent every month, 10% of their total profit in taxes, andIf Rachel can run twice as fast as John, and it takes Ann 1/4 longer to finish a race than it takes Rachel, and John can finish the race in 3 hours, how long will it ta...
def solve() -> int: john_time = 3 rachel_time = john_time / 2 ann_time = rachel_time * 5 / 4 total_time = john_time + rachel_time + ann_time result = total_time return result
Tom had a set of 25 crayons. He kept 5 of them for himself and gave 3 to his friend. Then, he evenly split the remaining crayons between his two younger siblings. How many crayons did each sibling get?
def solve() -> int: crayons_total = 25 crayons_kept = 5 crayons_given = 3 crayons_remaining = crayons_total - crayons_kept - crayons_given crayons_each_sibling = crayons_remaining / 2 result = crayons_each_sibling return result
Nina drew a total of 72 drawings. She drew 21 drawings on Monday and twice as much on Tuesday. How many drawings did Nina draw on Tuesday?
def solve() -> int: drawings_Monday = 21 drawings_Tuesday = 0 total_drawings = 72 drawings_Tuesday = (total_drawings - drawings_Monday) / 2 result = drawings_Tuesday return result
Student: A group of students bought 35 pencils and 18 erasers. The cost of each pencil was $0.75 and the cost of each eraser was $1.50. How much did they spend in total?
def solve() -> int: pencils = 35 erasers = 18 cost_pencil = 0.75 cost_eraser = 1.50 total_cost = pencils * cost_pencil + erasers * cost_eraser result = total_cost return result
Emma goes to the gym and hires a personal trainer. The trainer charges $50 per session and Emma trains with him twice a week. Her friend also hires the same trainer for one session a week. Emma's friend pays for half the cost and Emma pays the rest along with the gym membership, which is $30 per month. How much did Emm...
def solve() -> int: trainer_cost = 50 emma_sessions = 2 friend_sessions = 1 gym_membership = 30 emma_cost = trainer_cost * emma_sessions friend_cost = trainer_cost * friend_sessions total_cost = emma_cost + friend_cost + gym_membership result = total_cost return result...
Emily swims in a pool that is 30 feet long and 20 feet wide. For every 2 feet she swims horizontally, she moves 1 foot vertically. How far does she swim vertically when she travels from one corner of the pool to the opposite corner?
def solve() -> int: length = 30 width = 20 diagonal_distance = (length**2 + width**2)**0.5 vertical_distance_per_2_feet = 1 total_vertical_distance = vertical_distance_per_2_feet * (diagonal_distance / 2) result = total_vertical_distance return result
Anna has 18 candies. She wants to share them equally with her 2 best friends. How many candies does each person get?
def solve() -> int: c = 18 / 3 result = c return result
Q4. Peter wanted to bake some cupcakes to take to his grandparents. He decided to make a dozen cupcakes with lemon frosting and two dozen cupcakes with maple frosting. Peter ended up eating four cupcakes with lemon frosting and six times as many cupcakes with maple frosting. How many cupcakes were left for Peter to tak...
def solve() -> int: total = 12 + 24 eaten1 = 4 eaten2 = 6 * 24 eaten = eaten1 + eaten2 result = total - eaten return result
A bookshelf can hold 300 books. If there are already 150 books on the shelf and 25 books are added each day, how many days until the shelf is full?
def solve() -> int: bookshelf_capacity = 300 books_on_shelf = 150 books_added_per_day = 25 days_until_full = (bookshelf_capacity - books_on_shelf) // books_added_per_day result = int(days_until_full) return result
A radio station gave away 360 tickets to a concert. The ratio of the number of tickets given to VIP members to the number of tickets given to regular listeners is 7:13. How many tickets were given to VIP members?
def solve() -> int: ratio_5 = [7,13] total_tickets = 360 total_parts_5 = sum(ratio_5) value_of_part_5 = total_tickets / total_parts_5 vip_tickets = ratio_5[0] * value_of_part_5 result = vip_tickets return result
Five pizzas are ordered for a party. Each pizza can be divided into 8 slices. If there are 12 people at the party and each person eats 2 pizza slices, how many slices of pizza are left over?
def solve() -> int: num_pizzas = 5 num_slices_per_pizza = 8 num_people = 12 num_slices_per_person = 2 total_slices = num_pizzas * num_slices_per_pizza total_slices_eaten = num_people * num_slices_per_person leftover_slices = total_slices - total_slices_eaten result = leftover_s...
Student: Aaron has 52 stickers and he gave five-ninths of them to his sister. How many stickers are left with Aaron?
def solve() -> int: stickers_total = 52 fraction_given = 5/9 stickers_given = stickers_total * fraction_given stickers_left = stickers_total - stickers_given result = stickers_left return result
Student: David went to the gym for 1 hour. He lifted weights for 40 minutes and then ran on the treadmill for the remaining time. He ran at a speed of 14 km/h, but every 5 minutes he had to slow down to 8 km/h for 2 minutes due to exhaustion. How far did he run in total?
def solve() -> int: time_in_gym = 1 time_lifting_weights = 40 time_running = time_in_gym - time_lifting_weights speed_14 = 14 speed_8 = 8 time_slowing_down = 2 time_running_14 = time_running - (time_running // 5) * time_slowing_down time_running_8 = (time_running // 5) * time_slowing_dow...
Kelly is a teacher who needs to grade 200 papers before the end of the week. If she can grade 40 papers in an hour, how many hours will she need to finish grading all the papers?
def solve() -> int: papers_to_grade = 200 papers_per_hour = 40 hours_needed = papers_to_grade / papers_per_hour result = hours_needed return result
A pet adoption event has the following vet fees: cats are $14 and dogs are $19. If ten families adopt cats and eight adopt dogs, how much money did the vet receive?
def solve() -> int: dog_fees = 8 * 19 cat_fees = 10 * 14 vet_paid = dog_fees + cat_fees result = vet_paid return result
Noah is making sandwiches for a picnic. He has 20 slices of bread, 10 slices of cheese, and 15 slices of ham. He wants to make as many sandwiches as possible, and each sandwich needs one slice of bread on each side, one slice of cheese, and one slice of ham. It takes Noah 30 seconds to assemble each sandwich. How long ...
def solve() -> int: sandwiches = min(20 // 2, 10, 15) assembling_time = sandwiches * 30 result = assembling_time return result
In 8 years, Emily will be twice as old as Michael is now. Michael is currently 6 years less than three times as old as Sarah is now. Sarah is currently 3 years older than Kevin is now. If Kevin is currently 2 years old, how old will Emily be in 8 years?
def solve() -> int: kevin_age = 2 sarah_age = kevin_age + 3 michael_age = (3 * sarah_age) - 6 emily_age_future = 2 * michael_age emily_age_now = emily_age_future - 8 result = emily_age_future return result
A pizza joint sells pizza in small, medium, and large sizes priced at $8, $12, and $15 respectively. At the end of the day, they made a total of $510. If they sold 25 small pizzas and 30 medium pizzas, how many large pizzas did they sell?
def solve() -> int: small_price = 8 medium_price = 12 large_price = 15 small_pizzas = 25 medium_pizzas = 30 total_sales = 510 small_sales = small_pizzas * small_price medium_sales = medium_pizzas * medium_price large_sales = total_sales - small_sales - medium_sale...
Tyler wants to buy a new game. It costs $50 and he has $60 in his wallet. How much money will he have left after he buys the game?
def solve() -> int: cost_of_game = 50 money_in_wallet = 60 solution = money_in_wallet - cost_of_game result = solution return result
Jane can drive 140 miles with a full tank of gas. She uses her car for commuting and drives 15 miles a day. How many days can she use her car before she needs to refill the gas tank?
def solve() -> int: tank_capacity = 140 distance_per_day = 15 days = tank_capacity / distance_per_day result = days return result
When Emma is scared, she hugs her teddy bear. Each hug makes her feel safe by 2 minutes. One day, she was very scared and hugged half of the 12 teddy bears in her room. How many minutes did Emma feel safe from the hugs?
def solve() -> int: num_teddy_bears = 12 hugged_teddy_bears = num_teddy_bears / 2 minutes_per_hug = 2 total_minutes = hugged_teddy_bears * minutes_per_hug result = total_minutes return result
A book costs $24.99. If it's on sale for 20% off, what is the discounted price?
def solve() -> int: original_price = 24.99 discounted_price = original_price * 0.8 result = discounted_price return result
A company had 345 employees last year. This year, 12% of these employees retire, and then 23 new employees are hired. How many employees does the company have now?
def solve() -> int: employees_last_year = 345 retire = employees_last_year * 0.12 total_this_year = employees_last_year - retire + 23 result = total_this_year return result
Henry and his classmates ordered a box of cupcakes and asked to have it divided into 24 equally sized pieces. During snack time, they only ate one-sixth of the cupcakes. The next day, Henry ate one-fourth of the remaining cupcakes. Then his classmates each had 2 cupcakes. How many cupcakes were left?
def solve() -> int: total_cupcakes = 24 eaten_cupcakes = total_cupcakes / 6 remaining_cupcakes = total_cupcakes - eaten_cupcakes henry_cupcakes = remaining_cupcakes / 4 remaining_cupcakes -= henry_cupcakes classmates_cupcakes = 2 * (total_cupcakes - eaten_cupcakes - henry_cupcakes) remaining...
If Alex ate twice as many cookies as Sam and Sam ate 6 cookies, how many cookies did Alex eat in total?
def solve() -> int: sam_cookies = 6 alex_cookies = 2 * sam_cookies total_cookies = sam_cookies + alex_cookies result = total_cookies return result
Some possible questions are: A recipe for banana bread requires 2 bananas and 1/4 cup of milk for each loaf. A recipe for blueberry muffins requires 1/2 cup of milk and 1/4 cup of blueberries for each batch of 12 muffins. How much more milk is needed for 8 batches of muffins than for 6 loafs of banana bread?
def solve() -> int: from fractions import Fraction bananas_for_bread = 6 * 2 milk_for_bread = 6 * Fraction(1, 4) milk_for_muffins = 8 * Fraction(1, 2) blueberries_for_muffins = 8 * Fraction(1, 4) difference_in_milk = milk_for_muffins - milk_for_bread difference_in_milk_decimal = float(differ...
Amy is baking cupcakes for her class. She has 24 cupcake liners and 18 ounces of batter. She needs 2 ounces of batter for each cupcake. How many cupcakes can she make and how much batter will she have left?
def solve() -> int: liners = 24 batter = 18 batter_per_cupcake = 2 cupcakes = min(liners, batter // batter_per_cupcake) batter_left = batter - cupcakes * batter_per_cupcake result = (cupcakes, batter_left) return result
John buys 20 apples for $20 and sells them for $2 each. What is his profit or loss?
def solve() -> int: apples_bought = 20 cost_per_apple = 20 / 20 price_per_apple = 2 total_cost = apples_bought * cost_per_apple total_revenue = apples_bought * price_per_apple profit_or_loss = total_revenue - total_cost result = profit_or_loss return result
Anthony and his two coworkers decide to split the cost of a taxi ride. It is 10% more expensive than Anthony's old ride which costs $20. How much does Anthony save by splitting the ride compared to taking it alone? It took David six weeks to save up for a new bike. If he saved 25 dollars the first week and then saved a...
def solve() -> int: old_ride_cost = 20 taxi_ride_cost = old_ride_cost * 1.1 split_cost = taxi_ride_cost / 3 alone_cost = taxi_ride_cost - split_cost savings = alone_cost - old_ride_cost david_savings = 25 + 15*5 result = savings + david_savings ret...
Lisa wants to save $5000 for a trip in 6 months. She already has $2000, how much money does she need to save each month to reach her goal?
def solve() -> int: goal = 5000 current_savings = 2000 months = 6 money_needed = goal - current_savings monthly_savings = money_needed / months result = monthly_savings return result
A hotel room costs $80 per night. If Sam stays for 3 nights and gets a 20% discount, how much does he owe?
def solve() -> int: cost_per_night = 80 num_nights = 3 discount_percentage = 20 total_cost = cost_per_night * num_nights discount_amount = (total_cost * discount_percentage) / 100 final_cost = total_cost - discount_amount result = final_cost return result
Linda wants to buy a phone that costs $600. She has $400 saved up already. If she saves $50 each week, how many weeks will it take her to save enough money to buy the phone?
def solve() -> int: savings_needed = 600 - 400 weeks_needed = savings_needed / 50 result = weeks_needed return result
If it takes Sarah 3 more than seven times as long to finish a history project than to complete a science quiz, and she spent a total of 100 minutes, how much time did she spend on the science quiz?
def solve() -> int: science_quiz_time = (100 - 3) / (7 + 1) result = science_quiz_time return result
-Each of your question should have different numerical values from one another and from the example question. Leah earns $75,000 a year. She pays $18,000 for her mortgage every year, $6000 for her utilities every year, and $12,000 for her car loan every year. If she wants to save at least $30,000 every year, how much c...
def solve() -> int: earnings = 75000 mortgage = 18000 utilities = 6000 car_loan = 12000 savings = 30000 expenses = mortgage + utilities + car_loan + savings budget = earnings - expenses result = budget return result
If a company earns $5000 for the first week, and increases their earnings by 10% every week for the next 5 weeks, how much do they earn in total for the 6 weeks?
def solve() -> int: first_week_earnings = 5000 multiplier = 1.10 total_weeks = 6 total_earnings = first_week_earnings * ((multiplier ** total_weeks)-1) / (multiplier-1) result = total_earnings return result
Student: A shop sells 17 packets of paper clips and each packet contains 24 paper clips. How many paper clips does the shop have in total?
def solve() -> int: packets = 17 clips_per_packet = 24 total_clips = packets * clips_per_packet result = total_clips return result
A bakery sells 3 types of pastries: croissants, muffins, and scones. Each croissant costs $1.50 and weighs 80 grams. Each muffin costs $1.00 and weighs 60 grams. Each scone costs $0.75 and weighs 50 grams. A customer buys 6 croissants, 8 muffins, and 10 scones. How much money and weight does the customer pay and carry?
def solve() -> int: croissant_cost = 1.50 croissant_weight = 80 muffin_cost = 1.00 muffin_weight = 60 scone_cost = 0.75 scone_weight = 50 num_croissants = 6 num_muffins = 8 num_scones = 10 total_cost = croissant_cost * num_croissants + muffin_cost * num_muffins + ...
During a 1 hour and 15 minute movie, Ben got up to go to the bathroom during a 10-minute break. All the scenes were about 4 minutes long except for a 9-minute scene. How many scenes was he able to watch before leaving?
def solve() -> int: total_movie_duration = 1 * 60 + 15 break_duration = 10 scene_duration = 4 special_scene_duration = 9 total_scene_duration = total_movie_duration - break_duration regular_scenes = total_scene_duration // scene_duration special_scenes = 1 total_sce...
Lisa is 10 years older than John, whose age is 3 years less than half of Wendy's age. If Wendy is 40 years old, what is the age difference between Lisa and John?
def solve() -> int: wendy_age = 40 john_age = wendy_age/2 - 3 lisa_age = john_age + 10 age_difference = lisa_age - john_age result = age_difference return result
A box contains 24 pens. If each pen weighs 10 grams, what is the total weight of the pens in kilograms?
def solve() -> int: total_weight = (24 * 10) / 1000 result = total_weight return result
Student: A swimming pool has a volume of 24000 cubic feet. It is filled with water at the rate of 15 cubic feet per minute by a hose. If the pool is already 1/5 full, how long will it take to fill the pool completely?
def solve() -> int: volume = 24000 rate = 15 initial_fill = 1/5 remaining_volume = volume * (1 - initial_fill) time = remaining_volume / rate result = time return result
To make a spicy salsa, Jake needs to mix jalapeño peppers and tomato in a 5:4 ratio. If he has 32 ounces of salsa, what is 1/3 of the difference between the amount of jalapeño peppers and tomato he used?
def solve() -> int: jalapeno_peppers = 5 tomato = 4 total_salsa = 32 jalapeno_peppers_amount = (jalapeno_peppers / (jalapeno_peppers + tomato)) * total_salsa tomato_amount = (tomato / (jalapeno_peppers + tomato)) * total_salsa difference = jalapeno_peppers_amount - tomato_amount on...
A box of chocolates contains 24 pieces. Each piece has a mass of 15 grams. The box is 80% full. The chocolate has a density of 1.2 grams per cubic centimeter. The box has a length of 20 centimeters, a width of 15 centimeters, and a height of 5 centimeters. What is the mass of the empty box in grams?
def solve() -> int: pieces = 24 * 0.8 chocolate_mass = pieces * 15 chocolate_volume = chocolate_mass / 1.2 box_volume = 20 * 15 * 5 empty_volume = box_volume - chocolate_volume box_density = 0.8 empty_mass = empty_volume * box_density result = round(empty_mass, 2) return result
Emma is making bracelets with beads. She has 4 different colors of beads: red, blue, green, and yellow. She wants to make a bracelet with 6 beads, using at least one bead of each color. How many different bracelets can she make?
def solve() -> int: n = 4 r = 6 permutations = n ** r less_than_4_colors = 3 ** 6 + 3 * 2 ** 6 - 3 bracelets = permutations - less_than_4_colors result = bracelets return result
James ran 10 miles which is 6 miles less than three times as many miles as John ran. Emily ran 5 more miles than half as many as John ran. How many miles did Emily run?
def solve() -> int: john_miles = 10 / 3 + 6 emily_miles = (john_miles / 2) + 5 result = emily_miles return result
At a restaurant, the bill for a party of 6 comes out to be $78. They want to leave a 20% tip for the waiter. How much does each person need to pay?
def solve() -> int: bill = 78 tip_percentage = 20 num_of_people = 6 total_bill = bill + (bill * tip_percentage / 100) amount_per_person = total_bill / num_of_people result = amount_per_person return result
John wants to buy 3 books that cost $15 each and 2 that cost $10 each. How much money will he need in total for all the books?
def solve() -> int: total_cost = 15 * 3 + 10 * 2 result = total_cost return result
A refrigerator uses 250 watts of power. If it runs for 8 hours a day for a month, how many kilowatt-hours of energy does it use?
def solve() -> int: power_usage = 250 hours_per_day = 8 days_per_month = 30 energy_usage = (power_usage/1000) * hours_per_day * days_per_month result = energy_usage return result
Noah wants to buy a new phone. He has $1000 and the phone he wants costs $250 per GB of storage. If Noah needs to keep $200 for a case and half that amount for a screen protector, how many GB of storage can the phone have at most?
def solve() -> int: money_available = 1000 phone_cost_per_gb = 250 case_cost = 200 screen_protector_cost = case_cost / 2 total_cost = case_cost + screen_protector_cost money_available -= total_cost max_gb_storage = money_available // phone_cost_per_gb result = max_gb_stora...
A bookstore is having a sale on books. They are offering 25% off all purchases. If a book costs $20, how much will it cost after the discount?
def solve() -> int: original_price = 20 discount = 0.25 discount_amount = original_price * discount sale_price = original_price - discount_amount result = sale_price return result