question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: The price of three pizzas and six drinks is $44.10. If a pizza is $12, how much is the price of four pizzas and three drinks?
def solve() -> int: pizza_price = 12 num_pizzas = 3 num_drinks = 6 total_price = 44.10 num_pizzas_new = 4 num_drinks_new = 3 total_price_new = (num_pizzas_new * pizza_price) + (num_drinks_new * (total_price - (num_pizzas * pizza_price)) / num_drinks) result = total_price_new return ...
Alex is twice the age of his sister Lily, and his sister was born in 2001. If Alex has born in 1995, how old is he?
def solve() -> int: sister_birth_year = 2001 alex_birth_year = 1995 sister_age = 2021 - sister_birth_year alex_age = 2021 - alex_birth_year result = alex_age return result
Ben and Jack are brothers who want to go to the cinema together. A ticket costs 8 € for an adult and 5 € for a child. Ben is 15 years old and Jack is 12 years old, so Ben pays the adult price and Jack pays the child price. They also buy a large popcorn to share, which costs 6 €. They have a coupon that gives them a 20%...
def solve() -> int: original_cost = 8 + 5 + 6 discount_amount = 0.2 * original_cost final_cost = original_cost - discount_amount result = round(final_cost, 2) return result
It takes 9 bags of mulch to cover a garden that is 18 feet by 25 feet. How many bags of mulch does it take to cover a rectangular garden measuring 30 feet by 30 feet?
def solve() -> int: base1 = 18 width1 = 25 area1 = base1*width1 base2 = 30 width2 = 30 area2 = base2*width2 mulch_needed = area2/area1 result = mulch_needed return result
If a person walks 5 miles per hour, how many hours would it take for them to travel the same distance as a train that travels at a speed of 75 miles per hour for 2 days straight?
def solve() -> int: train_speed = 75 train_time = 2 * 24 person_speed = 5 distance = train_speed * train_time person_time = distance / person_speed result = person_time return result
Kevin has 18 coins in his piggy bank. He has four times as many pennies as nickels. The rest of his coins are dimes. If Kevin has 2 nickels, how many dimes does he have?
def solve() -> int: penny = 4 * 2 not_penny_nickel = 18 - penny - 2 dime = not_penny_nickel result = dime return result
The lengths of the sides of a right triangle are 3, 4, and 5. What is the area of the triangle?
def solve() -> int: base = 3 height = 4 area = 0.5 * base * height result = area return result
A bakery uses a ratio of 2 cups of flour to 1 egg in a cake recipe. If the bakery needs to use 8 eggs, how many cups of flour will they need?
def solve() -> int: flour = 2/1 * 8 result = flour return result
Ben sold 32 magazines at a fundraiser and earned $16. He then sold another 8 magazines to his neighbor for every 6 magazines that his friend Amy sold. If Amy sold 42 magazines, how much money did Ben earn in total?
def solve() -> int: magazines_sold = 32 money_earned = 16 magazines_price = money_earned / magazines_sold amy_sold = 42 ratio = 8 / 6 neighbor_sold = amy_sold * ratio neighbor_money = neighbor_sold * magazines_price total_money = money_earned + neighbor_money r...
David is buying 2 dozen apples at the grocery store. If each apple weighs 0.25 pounds, how many pounds of apples is David buying?
def solve() -> int: num_apples = 2 * 12 apple_weight = 0.25 total_weight = num_apples * apple_weight result = total_weight return result
A car travels 30 miles per gallon of gas. If gas costs $3 per gallon, how much will it cost to drive 300 miles?
def solve() -> int: mpg = 30 distance = 300 cost_per_gallon = 3 gallons_needed = distance / mpg cost = gallons_needed * cost_per_gallon result = round(cost, 2) return result
A shoe store has 8 types of shoes. They sell sneakers four times as much as sandals, and boots twice as much as loafers. The boots sell one-fifth as much as sneakers. If they sold 16 pairs of loafers today, how many pairs of sandals did they sell?
def solve() -> int: sneakers = 4 sandals = 1 boots = 2 loafers = 1/2 * sneakers sold_loafers = 16 sold_sandals = sold_loafers / (sandals/loafers + boots/loafers + sneakers/loafers) result = sold_sandals return result
A piece of art is worth $200 and an additional 10% tax needs to be paid. How much money will the art cost after tax?
def solve() -> int: initial_price = 200 tax_rate = 0.10 tax = initial_price * tax_rate total_price = initial_price + tax result = total_price return result
There are 50 students in a class and there are 30 girls. What percentage of the class are boys?
def solve() -> int: total_students = 50 num_girls = 30 num_boys = total_students - num_girls percent_boys = num_boys / total_students * 100 result = percent_boys return result
A box contains 24 pens. If 9 pens are removed, what percentage of pens still remain in the box?
def solve() -> int: total_pens = 24 pens_removed = 9 pens_remaining = total_pens - pens_removed percent_remaining = pens_remaining / total_pens * 100 result = percent_remaining return result
If a car can travel 80 kilometers on 5 liters of fuel, how far can it travel on 20 liters of fuel?
def solve() -> int: distance_on_5_liters = 80 distance_on_1_liter = distance_on_5_liters / 5 total_distance_on_20_liters = distance_on_1_liter * 20 result = total_distance_on_20_liters return result
Mrs. Chen divided a certain amount of money equally among her three daughters, Lisa, Mira, and Ria. If Mira gave $500 of her share to Ria, and Ria had a total of $2000, how much was the money divided?
def solve() -> int: x = (2000 - 500) * 3 result = x return result
Here are some possible new questions and python programs: A bakery makes 200 loaves of bread per hour. They sell each loaf for $2.50. If they work for 8 hours a day and sell all their bread, how much money will they earn in a day?
def solve() -> int: loaves_per_day = 200 * 8 revenue = loaves_per_day * 2.50 result = revenue return result
Student: An amusement park has 4 rollercoasters. Each rollercoaster has 3 cars with 8 seats each. If there are 5 tracks in the park with the same number of seats, calculate the total number of seats on all tracks.
def solve() -> int: num_rollercoasters = 4 num_cars = 3 num_seats = 8 num_tracks = 5 total_seats = num_rollercoasters * num_cars * num_seats * num_tracks result = total_seats return result
Amy and Ben went to a bookstore. Amy bought 4 books for $7.50 each and Ben bought 3 books for $8.00 each. They also bought a bookmark for $1.50 and a pen for $2.00. If they used a 10% off coupon for their entire purchase, how much did they pay in total?
def solve() -> int: book_price_amy = 7.50 book_price_ben = 8.00 bookmark_price = 1.50 pen_price = 2.00 total_price = 4 * book_price_amy + 3 * book_price_ben + bookmark_price + pen_price discount = total_price * 0.1 final_price = total_price - discount result = final_price return resu...
Student: A printer can print 20 pages per minute, and uses 0.01 liters of ink per page. If the ink costs $5 per liter, and the printer runs for 6 hours a day, how much does it cost to print 1000 pages?
def solve() -> int: pages_per_minute = 20 ink_per_page = 0.01 ink_cost_per_liter = 5 minutes_per_hour = 60 hours_per_day = 6 total_pages = 1000 total_ink = total_pages * ink_per_page total_ink_cost = total_ink * ink_cost_per_liter total_minutes = total_pages / pages_per_minute to...
A bookshelf has 5 shelves and can hold a total of 50 books. If each shelf can hold the same amount of books, how many books can each shelf hold?
def solve() -> int: no_of_shelves = 5 total_books = 50 books_per_shelf = total_books/no_of_shelves result = books_per_shelf return result
A tank has 600 gallons of water. If 40% of the tank is filled with water, how many gallons of water are in the tank?
def solve() -> int: total_gallons = 600 percentage_filled = 40 gallons_filled = (percentage_filled / 100) * total_gallons result = gallons_filled return result
Possible new questions and programs: Ms. Lee is making cupcakes for the class party. She uses one egg for every 3 cupcakes. A dozen eggs cost 4 dollars. If she made 45 cupcakes, how much did she spend on eggs?
def solve() -> int: eggs = 45 // 3 cost_per_egg = 4 / 12 cost = eggs * cost_per_egg result = cost return result
Student: In a metropolitan area, half of the population is above the age of 50, while the other half is below the age of 50. Out of the population of people above the age of 50, 40% are women. Out of the population of people below the age of 50, 20% are women. What percentage of the entire population is female?
def solve() -> int: population_above_50 = 0.5 population_below_50 = 0.5 percentage_women_above_50 = 0.4 percentage_women_below_50 = 0.2 total_women = population_above_50 * percentage_women_above_50 + population_below_50 * percentage_women_below_50 total_population = population_above_50 + populat...
Michael is planning a party. He needs to buy 3 pizzas and each pizza costs $15. How much money will Michael have to spend on pizzas?
def solve() -> int: pizza_cost = 15 num_pizzas = 3 total_cost = pizza_cost * num_pizzas result = total_cost return result
Student: Three friends have packs of gummy bears. The first friend has 1 and a half packs, the second has two and a quarter packs, and the third has one and three quarters packs. How many packs do the three friends have in total?
def solve() -> int: first = 1.5 second = 2.25 third = 1.75 total = first + second + third result = total return result
A triangle has a base of 12 cm and a height of 9 cm. A rectangle has the same base and height as the triangle. What is the difference between the areas of the triangle and the rectangle, in square centimeters?
def solve() -> int: area_triangle = 0.5 * 12 * 9 area_rectangle = 12 * 9 area_difference = area_rectangle - area_triangle result = area_difference return result
Robert's boss gave him 1000 dollars as a bonus and his wife gave him 500 dollars as a gift. He donated 250 dollars to a charity and earned 750 dollars from stock investments. How much money does he have now?
def solve() -> int: bonus = 1000 gift = 500 donation = 250 investment = 750 total_money = bonus + gift - donation + investment result = total_money return result
There are 3 red apples, 4 green apples, and 2 yellow apples in a basket. What's the probability of picking a green apple first and then a red apple?
def solve() -> int: red_apples = 3 green_apples = 4 yellow_apples = 2 total_apples = red_apples + green_apples + yellow_apples prob_green_first = green_apples / total_apples prob_red_after_green = red_apples / (total_apples - 1) total_prob = prob_green_first * prob_red_after_green result...
Emily needs to paint all the walls of her house, which has dimensions of 45 feet by 30 feet and is 8 feet high. Each wall needs one coat of primer and two coats of paint. If Emily can paint 20 square feet per hour, how many hours will it take her to paint the house?
def solve() -> int: length = 45 width = 30 height = 8 front_back_wall = height * length side_walls = height * width * 2 total_area = front_back_wall * 2 + side_walls * 2 total_painting_area = total_area * 3 painting_time = total_painting_area / 20 result = pa...
A pet store sold 12 cats for $50 each and 20 dogs for $100 each. If the store had to pay $2000 to purchase the pets, how much profit did the store make?
def solve() -> int: cat_price = 50 n_cats = 12 dog_price = 100 n_dogs = 20 purchase_cost = 2000 total_sales = cat_price*n_cats + dog_price*n_dogs profit = total_sales - purchase_cost result = profit return result
Student: A farm has 40 more chickens than ducks every week. If the farm has 80 ducks every week, how many chickens and ducks will it have in a year?
def solve() -> int: chickens = 0 ducks = 0 weeks_in_year = 52 chickens = 80 + 40 ducks = 80 total_chickens = chickens * weeks_in_year total_ducks = ducks * weeks_in_year result = total_chickens + total_ducks return result
Mia is making bracelets for her friends. She has 20 beads of each color: red, blue, green, and yellow. She wants to make 5 bracelets, each with 12 beads. She wants each bracelet to have 3 beads of each color. How many beads will she have left over after making 5 bracelets?
def solve() -> int: total_beads = 20 * 4 needed_beads = 5 * 12 leftover_beads = total_beads - needed_beads result = leftover_beads return result
Student: Q5: Johnny needs 960 screws to complete his project. Each screw costs $2. How much will Johnny spend to buy the screws?
def solve() -> int: screws_needed = 960 cost_per_screw = 2 total_cost = screws_needed * cost_per_screw result = total_cost return result
A deli sold 600 sandwiches, 30 salads, and 25 drinks last month. If they charged $4 for each sandwich, $3.50 for each salad, and $1.75 for each drink, how much money, in dollars, did the deli receive from these sales?
def solve() -> int: result = 600 * 4 + 30 * 3.5 + 25 * 1.75 print (result) return result
Joe is enrolling in university and is planning to pay for his tuition in monthly payments for 3 years. He estimates his tuition to be $20,000 with a 5% annual interest rate. How much will his monthly payments be?
def solve() -> int: student_tuition = 20000 loan_duration = 3 interest_rate =.05 total_interest = student_tuition*interest_rate*loan_duration total_amount = student_tuition + total_interest monthly_payment = total_amount/(loan_duration*12) result = monthly_payment r...
Student: Tim has a rectangle-shaped swimming pool. The length is 30 feet and the width is 15 feet. If he wants to pave the pool area with stone tiles which cover an area of 6 square feet each, how many tiles would Tim need?
def solve() -> int: length = 30 width = 15 tile_area = 6 pool_area = length * width tiles = pool_area / tile_area result = tiles return result
The numerator of a fraction is increased by 30%, and the denominator is decreased by 20%. If the new fraction is 3/4, what is the original fraction?
def solve() -> int: numerator_change = 0.3 denominator_change = 0.2 new_numerator = 3 new_denominator = 4 original_numerator = new_numerator / (1 + numerator_change) original_denominator = new_denominator / (1 - denominator_change) result = original_numerator / original_denominator retur...
A book club is ordering books for 20 people. The total cost of the books is $600. The first 10 people will get 1 book each, but the remaining 10 people will split the remaining books evenly. How much is each book and how many books will each of the second 10 people get?
def solve() -> int: total_people = 20 total_cost = 600 num_books_first_group = 10 num_people_second_group = 10 remaining_books = total_people - num_books_first_group remaining_cost = total_cost / num_books_first_group price_per_book = remaining_cost / remaining_books num_books_per_person...
In a survey, it was found that 65% of people like dogs, and 40% of people like cats. If 25% of people like both dogs and cats, what percent of people like only dogs or only cats?
def solve() -> int: percent_dogs = 65 percent_cats = 40 percent_both = 25 percent_neither = 100 - (percent_dogs + percent_cats - percent_both) percent_only_animal = percent_dogs + percent_cats - percent_both - percent_neither result = percent_only_animal return result
A factory made 480 bags of sweets. Each bag contained 500gm of sweets. If 50 bags were lost in transit, how many kilograms of sweets were left?
def solve() -> int: total_sweets = 480 * 500 sweets_left = (480-50) * 500 kgs_left = sweets_left/1000 result = kgs_left return result
David practiced 1/2 hour of soccer every day for 5 days. Sarah practiced 1 hour of soccer every day for 10 days. How many hours did they practice soccer in total?
def solve() -> int: david_practice_per_day = 1/2 david_days = 5 sarah_practice_per_day = 1 sarah_days = 10 david_total_practice = david_practice_per_day * david_days sarah_total_practice = sarah_practice_per_day * sarah_days total_practice = david_total_practice + sarah_total_pract...
Jackson owns the fastest lap record at the local go-kart track. He can complete the track in 1 minute and 10 seconds. Mariah wants to beat his record and is currently able to complete the track in 1 minute and 30 seconds. How many seconds faster must she complete the track to beat Jackson's record?
def solve() -> int: jackson_time = 70 mariah_time = 90 difference = jackson_time - mariah_time result = difference return result
A cafeteria had 400 trays of food on a particular day. The number of trays increased by 100 on the second day, with 50 trays of food being wasted. On the third day, the total number of new trays of food served was 200 with 100 trays of food being wasted. What's the total number of trays of food on the third day?
def solve() -> int: trays_day1 = 400 trays_day2 = trays_day1 + 100 - 50 trays_day3 = trays_day2 + 200 - 100 result = trays_day3 return result
There are 24 chocolates in a box, out of which 6 are dark chocolates and the rest are milk chocolates. If the ratio of dark chocolates to milk chocolates is 1:3, how many milk chocolates are there in the box?
def solve() -> int: total_chocolates = 24 dark_chocolates = 6 milk_chocolates = total_chocolates - dark_chocolates ratio = 1/3 milk_chocolates = (1 / (1 + ratio)) * total_chocolates milk_chocolates = round(milk_chocolates) result = milk_chocolates return result
Ahmad and Jordan bought a total of 34 ice cream cones. Ahmad bought twice as many as Jordan. How many ice cream cones did Ahmad buy?
def solve() -> int: jordan_cones = 34/3 ahmad_cones = jordan_cones * 2 result = ahmad_cones return result
Hilda goes to the store to buy 400 apples. She pays for 5 times as many apples as she can hold in her basket. How many apples can Hilda carry in her basket?
def solve() -> int: apple_in_basket = 0 apple_in_store = 0 apple_in_store = apple_in_store + 400 apple_in_basket = apple_in_basket + (apple_in_store / 5) result = apple_in_basket return result
arah is taking a boat from Miami to Orlando, traveling at an average speed of 50 km/hour. How much time will she take to reach Orlando from Miami?
def solve() -> int: distance = 280 time = distance/50 result = time return result
Noah has a coin that is biased, meaning that it has a 60% chance of landing on heads and a 40% chance of landing on tails. He flips the coin 8 times. What is the expected number of heads that he will get?
def solve() -> int: head_prob = 0.6 tail_prob = 0.4 flip = 8 expect = flip * head_prob result = round(expect, 2) return result
A company produces 200 widgets each hour. How many widgets can they produce in 9 hours and 15 minutes?
def solve() -> int: widgets_per_hr = 200 time_in_hrs = 9.25 widgets_produced = widgets_per_hr * time_in_hrs result = widgets_produced return result
Mary needs to do her laundry. She has 5 pairs of jeans and 10 shirts. It takes her 30 minutes to wash and 45 minutes to dry each pair of jeans, and 20 minutes to wash and 30 minutes to dry each shirt. How long, in minutes, will it take Mary to wash and dry all her clothes?
def solve() -> int: jeans = 5 shirts = 10 jeans_wash_time = 30 jeans_dry_time = 45 shirt_wash_time = 20 shirt_dry_time = 30 total_wash_time = jeans * jeans_wash_time + shirts * shirt_wash_time total_dry_time = jeans * jeans_dry_time + shirts * shirt_dry_time total_time = total_wash_t...
am can run a lap around the track in 90 seconds. He wants to improve his speed, so he starts training. After a month, he can run a lap in 80 seconds. After another month, he can run a lap in 72 seconds. How much faster is he running now compared to when he started, in percentage?
def solve() -> int: s = 1/72 result = (s - 1/90) / (1/90) * 100 return result
Student: Foa and Moa are employed to deliver medical supplies in their area. They were each paid $75 for every delivery they made during the month of June. Foa made 1/4 more deliveries than Moa. Calculate the difference in how much they were paid that month.
def solve() -> int: moa_deliveries = 100 foa_deliveries = 1.25 * moa_deliveries moa_payment = moa_deliveries * 75 foa_payment = foa_deliveries * 75 payment_difference = foa_payment - moa_payment result = payment_difference return result
A store sells oranges for $0.25 each and apples for $0.35 each. If John buys 4 oranges and 6 apples, what will be his total cost?
def solve() -> int: total_price = 0.25 * 4 total_price += 0.35 * 6 result = total_price return result
Student: 3. There are 7 pencils and 4 pens in the drawer. How many writing implements are in the drawer?
def solve() -> int: pencils = 7 pens = 4 result = pencils + pens return result
Q5: Michele sold 3 times as many apples as oranges. If she sold 48 apples, how many oranges did she sell?
def solve() -> int: apples = 48 oranges = apples / 3 result = oranges return result
Student: If Hannah can knit 6 scarfs in 8 hours, how long would it take for her to knit 18 scarfs?
def solve() -> int: scarfs = 18 scarfs_per_hour = 6 hours = 8 time = scarfs / scarfs_per_hour * hours result = time return result
arah has 24 toy cars and wants to sell them all at a garage sale. During the day, she sold 12 toy cars but then bought 4 toy cars from a neighbor. She then sold 5 more cars before lunchtime. How many toy cars did she sell after lunchtime?
def solve() -> int: toy_cars = 24 toy_cars -= 12 toy_cars += 4 toy_cars -= 5 result = toy_cars return result
Amanda ran for 20 minutes at a constant speed of 8 mph. How many miles did she run?
def solve() -> int: time_in_hours = 20/60 speed = 8 distance = time_in_hours * speed result = distance return result
Rajesh invests $4000 in a savings account with 4% annual interest. He makes a $200 deposit every six months for 8 years. How much money is in his account at the end of the 8-year period?
def solve() -> int: P = 4000 r = 0.04 q = 6 m = 200 n = 16 monthly_interest = r/q payment = m*(((1+monthly_interest)**n - 1)/(monthly_interest*(1+monthly_interest)**n)) outstanding = P + payment interest = outstanding * monthly_interest * (n/q) r...
Cole has 6 more eggs than Dana who has a third of the number of eggs as Eve. Eve has 15 eggs. How many eggs does Cole have?
def solve() -> int: dana_eggs = 15 / 3 cole_eggs = dana_eggs + 6 result = cole_eggs return result
Possible questions and programs: Lisa is making a quilt for her granddaughter and needs 12 squares of fabric that measure 10 inches by 10 inches and 8 triangles of fabric that measure 5 inches by 5 inches by 7 inches. How many square inches of fabric does Lisa need to buy?
def solve() -> int: squares = 12 square_length = 10 square_width = 10 triangles = 8 triangle_base = 5 triangle_height = 5 triangle_hypotenuse = 7 square_area = square_length * square_width triangle_area = triangle_base * triangle_height / 2 total_area = squares * square_area + tr...
Lily has a rectangular garden that is 12 meters long and 6 meters wide. She wants to plant flowers along the diagonal of the garden, leaving 1 meter of space on each side. How many meters of flowers can she plant, rounded to the nearest integer?
def solve() -> int: a = 12 b = 6 c = (a**2 + b**2)**0.5 diagonal_with_space = c - 2 result = round(diagonal_with_space) return result
Sarah wants to create a scrapbook for her best friend. She needs to choose photos, cut them to size, and glue them onto the pages. Each step takes her 15 minutes to complete, and they take 15 minutes to dry. How long will it take Sarah to finish creating her scrapbook?
def solve() -> int: photos = 60 cutting = 60 gluing = 60 drying = 60 total_time = photos + cutting + gluing + drying + drying + drying result = total_time/60 return result
Student: Trevor and Liam have 28 pet snails, and they give 3 of them away, how many snails do they have left?
def solve() -> int: snails = 28 snails_given_away = 3 snails_left = snails - snails_given_away result = snails_left return result
Tyler and his sister collect coins. Tyler has 20 more coins than his sister, and together they have 135 coins. How many coins does Tyler's sister have?
def solve() -> int: total_coins = 135 tyler_coins = total_coins/2 + 20 sister_coins = total_coins/2 - 20 result = f'<<<{sister_coins}>>>' result = sister_coins return result
John buys 4 times more apples than Tim does. If John buys 200 apples, how many apples does Tim buy?
def solve() -> int: john_apples = 200 tim_apples = john_apples/4 result = tim_apples return result
Claire wants to purchase 2000 books to sell in her bookstore, twice the number of books she currently has. After selling 80% of the total stock, her uncle buys 500 more books, and after five days, sells 200. How many books are remaining in the store?
def solve() -> int: books_currently_have = 2000 / 2 books_to_sell = 2000 books_sold = books_to_sell * 0.8 books_remaining = books_to_sell - books_sold books_remaining += 500 books_remaining -= 200 result = books_remaining return result
There are 12 pens on the table. If 1/4 of the pens are removed, how many are left?
def solve() -> int: pens1 = 12 removed = 1/4 left = pens1 * (1 - removed) result = left return result
John wants to purchase a graphic T-shirt that costs $25.00 with a 15% discount. He will also need to pay $7.50 for shipping and a $2.00 processing fee. How much will he be charged in total?
def solve() -> int: shirt_cost = 25.00 discount = 0.15 shipping_cost = 7.50 processing_fee = 2.00 discount_amount = shirt_cost * discount total_cost = shirt_cost - discount_amount + shipping_cost + processing_fee result = total_cost return result
A car is originally priced at $25,000, but is discounted to $22,500. What is the percentage discount?
def solve() -> int: original_price = 25000 discounted_price = 22500 discount_percentage = (original_price - discounted_price) / original_price result = discount_percentage return result
If a train can carry 300 passengers and the next train can carry only a third of what the first can, how many fewer passengers can the next train carry?
def solve() -> int: train1_capacity = 300 train2_capacity = train1_capacity / 3 passenger_difference = train1_capacity - train2_capacity result = passenger_difference return result
Anthony is tiling a rectangular floor with 48 square tiles. If the width of the Floor is 6 tiles, what is the length of the floor?
def solve() -> int: total_tiles = 48 width = 6 length = total_tiles/width result = length return result
Eva and Noah gave a survey to 100 students in their class. If 40% of the students preferred chocolate ice cream and 35% of the students preferred vanilla ice cream, how many students preferred neither flavor?
def solve() -> int: chocolate = 0.4 * 100 vanilla = 0.35 * 100 neither = 100 - (chocolate + vanilla) result = neither return result
A recipe has a ratio of 3 cups of flour to 4 cups of sugar. If there are 12 cups of flour in the pantry, how much sugar is needed to make the recipe?
def solve() -> int: flour_to_sugar_ratio = 3/4 sugar_needed = (flour_to_sugar_ratio * 12) / 1 result = sugar_needed return result
A coffee shop has fixed cost of $200 and each cup of coffee costs $. 6 to make. The shop sells their coffee for $2. How many cups does the shop have to sell in order to break even?
def solve() -> int: fixed_cost = 200 cost_per_cup = 0.6 price_per_cup = 2 break_even_qty = fixed_cost/(price_per_cup - cost_per_cup) result = int(break_even_qty) return result
Lucas has a coupon that gives him 20% off any purchase at a bookstore. He decides to buy a hardcover book for $25, a paperback book for $15 and a magazine for $5. He also has to pay 5% sales tax on the total amount after the discount. How much does Lucas pay for his purchase?
def solve() -> int: hardcover = 25 paperback = 15 magazine = 5 subtotal = hardcover + paperback + magazine discount = 0.2 * subtotal discounted = subtotal - discount tax = 0.05 * discounted total = discounted + tax result = total return result
If a car travels 348 miles in 6 hours, what is its average speed in miles per hour?
def solve() -> int: distance = 348 time = 6 speed = distance / time result = speed return result
Henry saves $10 every week for 1 year to purchase a new bookshelf. He had to use $50 from his savings to buy a gift for his friend. How much money is left in his savings account? In Abby's collection, there are 15 more green markers than red markers and three times as many red markers as highlighters. There are also te...
def solve() -> int: weekly_savings = 10 weeks_in_a_year = 52 total_savings = weekly_savings * weeks_in_a_year gift_cost = 50 remaining_savings = total_savings - gift_cost highlighters = 10 red_markers = 3 * highlighters green_markers = red_markers + 15 blue_markers = highlighter...
Warren wants to build a round pond in his yard. He wants it to have a circumference of 40 feet. How much water-resistant material will Warren need to buy for the pond’s perimeter?
def solve() -> int: r = 40/2/3.14 c = 40 result = r * c return result
At a carnival, children had to guess the weight of a watermelon. A scale determined that the watermelon weighed 16 pounds. When the children guessed, the total amount was 44 pounds. How many children guessed?
def solve() -> int: weight_watermelon = 16 total_guess_weight = 44 result = total_guess_weight - weight_watermelon return result
John wants to take a trip to Hawaii and found a deal for $500 per ticket for a round-trip flight. He is also staying in a hotel for 7 nights that costs $100 per night. If he is planning on spending $50 per day on food, how much will he spend in total on his trip?
def solve() -> int: flight_cost = 500 hotel_cost = 100 * 7 food_cost = 50 * 7 total_cost = flight_cost + hotel_cost + food_cost result = total_cost return result
In 2015, there were some students in a classroom. In 2016, half of the number of students came to the classroom as compared to 2015. In 2017, 3/4 as many students came to the classroom as in 2016. If there were 30 students in the classroom in 2017, how many students came to the classroom in 2015?
def solve() -> int: students_2017 = 30 students_2016 = students_2017 / (3/4) students_2015 = students_2016 * 2 result = students_2015 return result
Student: John had 18 years of experience at his job. Rachel had 4 times more experience than John. 3 years ago, Rachel had twice as much experience as John. What is their combined experience now?
def solve() -> int: john_experience = 18 rachel_experience = 4 * john_experience rachel_experience_3_years_ago = 2 * (john_experience - 3) rachel_experience_now = rachel_experience_3_years_ago + 3 total_experience = john_experience + rachel_experience_now result = total_experience return re...
At the start of the school year, the Spanish class had 30 students, with 10 new students. At the end of the year, 15% of the class had transferred out, how many students were in the class?
def solve() -> int: start_students = 30 new_students = 10 transferred_out = 0.15 * (start_students + new_students) remaining_students = start_students + new_students - transferred_out result = remaining_students return result
Tim bought notebooks for his six students. Each student received 18 small notebooks and 42 big notebooks. They gathered their notebooks together and took them from the group whenever they needed them. After the first month, they had taken a total of 60 notebooks from the group. After the second month, they had taken an...
def solve() -> int: total_notebooks_per_student = 18 + 42 total_notebooks = total_notebooks_per_student * 6 total_notebooks_taken = 60 + 54 remaining_notebooks = total_notebooks - total_notebooks_taken notebooks_each_student = remaining_notebooks // 6 result = notebooks_each_student result ...
Emily drives from her house to the grocery store every day. The store is 4 miles away and it takes 15 minutes for her to reach there. The next day, she is driving to the mall which is 25 miles away from the store. If she drives at the same speed, how long will the drive take?
def solve() -> int: distance_to_store = 4 time_to_store = 15 distance_to_mall = 25 time_to_store_hours = time_to_store / 60 speed_to_store = distance_to_store / time_to_store_hours time_to_mall = distance_to_mall / speed_to_store result = time_to_mall * 60 re...
Jocelyn has $30 in her bank account. Her phone bill was $15, and she spent $5 on food. How much money does she have left?
def solve() -> int: starting_money = 30 phone_bill = 15 food_spent = 5 total_spent = phone_bill + food_spent money_left = starting_money - total_spent result = money_left return result
5. Ralph wants to build a rectangular garden that is 8 feet wide and 20 feet long. How much fencing material will he need to border the garden?
def solve() -> int: length = 20 width = 8 perimeter = (length + width)*2 result = perimeter return result
An art teacher wants to buy enough canvases for her class of 20. She needs 2 canvases per student plus an extra 5 canvases. If canvases are sold in boxes of 10, how many boxes should she buy?
def solve() -> int: students = 20 canvases_needed = students * 2 + 5 boxes_of_canvases_needed = canvases_needed / 10 result = boxes_of_canvases_needed return result
Alisa and Bruce have a combined total of 121 books. If Alisa has 3/5 of the total books, how many books does Bruce have?
def solve() -> int: total_books = 121 fraction_alisa = 0.6 brue_books = total_books - (total_books * fraction_alisa) result = brue_books return result
Ella spent 15 minutes each day practicing piano for 5 days. She spent 10 minutes each day practicing guitar for 7 days. She spent 5 minutes each day practicing violin for 3 days. How many minutes did she spend practicing music in total?
def solve() -> int: minutes_piano = 15 * 5 minutes_guitar = 10 * 7 minutes_violin = 5 * 3 total_minutes = minutes_piano + minutes_guitar + minutes_violin result = total_minutes return result
Emma drives 50 mph for 10 minutes and then five times as long for five times the speed. How far did she drive in total?
def solve() -> int: speed1 = 50 time1 = 10/60 time2 = 5*time1 speed2 = 5*speed1 distance1 = speed1*time1 distance2 = speed2*time2 total_distance = distance1 + distance2 result = total_distance return result
Student: Lisa buys a phone for $400 plus accessories that cost $25 each. How much does she spend in total after a discount of 10% on the accessories?
def solve() -> int: phone_price = 400 accessories_price = 25 total_price = phone_price + accessories_price discount = 0.1 * accessories_price result = total_price - discount return result
If a recipe uses 2 eggs to make 12 pancakes, how many eggs are needed to make 36 pancakes?
def solve() -> int: num_pancakes = 36 num_eggs = (num_pancakes * 2) / 12 result = num_eggs return result
John has a business that gets 28000 visits a month, for a normal 28 day month. He gets $0.08 per visit. How much does he make per week?
def solve() -> int: visits = 28000 gain_per_visit = 0.08 days_in_month = 28 days_in_week = 7 result = visits * gain_per_visit * days_in_month / days_in_week return result
For every 4 cups of flour, Emily needs one egg to make pancakes. A carton of eggs contains 12 eggs and costs $3. If Emily wants to make pancakes for a family of 8 people, how many cartons of eggs does she need and how much would it cost?
def solve() -> int: flour_cups = 4 * 8 eggs_needed = flour_cups // 4 cartons_needed = (eggs_needed + 11) // 12 cost = cartons_needed * 3 result = f'{cartons_needed} cartons of eggs are needed, costing ${cost}.' return result
If a recipe calls for 2 cups of flour to make 12 cookies, how many cups of flour are needed to make 36 cookies?
def solve() -> int: cups_flour_for_12_cookies = 2 cookies_needed = 36 cups_flour_needed = cups_flour_for_12_cookies * cookies_needed / 12 result = cups_flour_needed return result
A worker worked 42.5 hours in a week. If he is paid $17.75 per hour for the first 40 hours, and $26.625 for the last 2.5 hours, how much money did he earn in total?
def solve() -> int: hours_worked = 42.5 wage_rate1 = 17.75 wage_rate2 = 26.625 if hours_worked <= 40: earning = hours_worked * wage_rate1 else: earning = 40 * wage_rate1 + (hours_worked - 40) * wage_rate2 result = earning return result