question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Amy has a large round swimming pool. The diameter of the pool is 16 meters. What is the circumference of the pool?
def solve() -> int: diameter = 16 radius = diameter / 2 circumference = 2 * 3.14 * radius result = circumference return result
A pizza restaurant sells pizzas at 20 dollars each. If 60% of the customers order double pizza and rest order single pizza, then what is the total revenue for the restaurant after selling 20 single pizzas and 10 double pizzas?
def solve() -> int: single = 20 double = 20*2 totalpizzas = single*20 + double*10 result = totalpizzas*20 return result
Oliver has 15 books on his bookshelf. He gave 4 books to his friend and then bought 6 more books. What percent of the original number of books does he now have?
def solve() -> int: original_books = 15 current_books = original_books - 4 + 6 percent = current_books / original_books * 100 result = percent return result
If a toy store sells two dolls and four action figures for $27.50, and a doll costs $7.50, what is the cost of three dolls and one action figure?
def solve() -> int: doll_price = 7.50 action_figure_price = (27.50 - (2 * doll_price)) / 4 total_cost = (3 * doll_price) + action_figure_price result = total_cost return result
A class has 25 students. If each study group has 5 students, how many study groups can be formed?
def solve() -> int: num_of_students_in_class = 25 num_of_students_in_study_group = 5 num_of_study_groups = num_of_students_in_class // num_of_students_in_study_group result = num_of_study_groups return result
A coffee store owner found that 40% of her customers order lattes. Of those who order lattes, 75% want whipped cream on top. If a random customer is picked, what are the odds they order a latte and want whipped cream on top?
def solve() -> int: prob_latte = 0.4 prob_whipped_cream_given_latte = 0.75 prob_latte_and_whipped_cream = prob_latte * prob_whipped_cream_given_latte result = prob_latte_and_whipped_cream return result
If Tim has 5 fewer marbles than twice as many marbles as his sister, and his sister has 30 marbles, how many marbles do Tim and his sister have combined?
def solve() -> int: sister_marbles = 30 tim_marbles = 2 * sister_marbles - 5 total_marbles = sister_marbles + tim_marbles result = total_marbles return result
A farmer observed that the number of cows on his farm was 4 times the number of goats. If there were 80 goats, calculate the total number of animals on the farm.
def solve() -> int: goats = 80 cows = goats * 4 total_animals = cows + goats result = total_animals return result
Amy wants to make a sandwich using only ham and cheese. She will use a total of 8 slices of ingredients. If she uses one third as many slices of cheese as ham, how many slices of cheese will be used in the sandwich?
def solve() -> int: total = 8 fraction = 1 / 3 ham = total / (fraction + 1) cheese = ham * fraction result = cheese return result
A train travels 450 miles in 7.5 hours. What is its speed in miles per hour?
def solve() -> int: distance = 450 time = 7.5 speed = distance / time result = speed return result
Alice has 24 candies. She eats 6 candies and then shares the rest equally with her two friends Bob and Claire. Bob has 16 candies and he eats 4 candies and then gives 2 candies to Claire. Claire has 12 candies and she eats 3 candies and then gives 1 candy to Alice. How many candies does Alice have now?
def solve() -> int: alice_candies = 24 alice_eat = 6 alice_share = (alice_candies - alice_eat) // 2 bob_candies = 16 bob_eat = 4 bob_give = 2 claire_candies = 12 claire_eat = 3 claire_give = 1 alice_now = alice_share + claire_give bob_now = bob_candies - bob_eat - bob_give ...
Mia has 100 apples and she wants to make some apple pies. Each pie requires 6 apples and 2 cups of flour. Mia has 20 cups of flour in her kitchen. How many apple pies can she make with the ingredients she has?
def solve() -> int: pies_from_apples = 100 // 6 pies_from_flour = 20 // 2 pies_from_ingredients = min(pies_from_apples, pies_from_flour) result = pies_from_ingredients return result
You have 100$ to spend on games. You purchase a board game for 30$, a video game for 40$, and 1/2 of what's left on a card game. How much money do you have left?
def solve() -> int: remaining = 100 - 30 - 40 card_game = remaining / 2 result = remaining - card_game return result
10. If 20 books are shared between 5 children, how many books does each child get?
def solve() -> int: total_books = 20 number_children = 5 result = total_books/number_children return result
Ryan is planning a vacation with his family. He needs to book a flight, a hotel, and a rental car for a week. The flight costs $400 per person, and there are four people in his family. The hotel charges $150 per night, and the car rental costs $50 per day plus a $100 deposit. Ryan has a 10% discount coupon for the car ...
def solve() -> int: flight_cost = 400 * 4 hotel_cost = 150 * 7 car_rental_cost = (50 * 7) * 0.9 + 100 total_cost = flight_cost + hotel_cost + car_rental_cost total_cost = round(total_cost, 2) result = total_cost return result
Student: A store is having a sale. They are offering a 20% discount on all items. If an item is originally $50, how much does it cost with the discount?
def solve() -> int: original_price = 50 discount_rate = 0.2 discount_amount = original_price * discount_rate final_price = original_price - discount_amount result = final_price return result
John received a bill for his electricity usage which came to $75. He paid $25 in cash and took a loan from a friend to pay the remainder amount. He paid back the loan after one month with a 5% interest. How much did John pay back in total?
def solve() -> int: bill = 75 cash_paid = 25 loan_amount = bill - cash_paid interest_rate = 0.05 interest_amount = loan_amount * interest_rate total_paid = loan_amount + interest_amount result = total_paid return result
Student: A furniture store has a 25% discount on all items today. A sofa originally priced at $800 is now $600 after the discount. What was the percentage of discount given on the sofa?
def solve() -> int: original_price = 800 discounted_price = 600 discount_amount = original_price - discounted_price discount_percentage = discount_amount / original_price * 100 result = discount_percentage return result
Janice has half as many cups as Jordan, who has 15 more than Reuben. If Reuben has 12 cups, how many does Janice have?
def solve() -> int: reuben_cups = 12 jordan_cups = reuben_cups + 15 janice_cups = jordan_cups / 2 result = janice_cups return result
Hannah needs to raise $315 for a school trip to the museum. She has $130 already and plans to earn the rest by doing odd jobs. She gets paid $7 per job and expects to complete 35 more jobs. How many odd jobs does Hannah need to do to reach her goal?
def solve() -> int: goal = 315 current_money = 130 payment_per_job = 7 remaining_jobs = 35 money_needed = goal - current_money jobs_needed = money_needed / payment_per_job odd_jobs_needed = jobs_needed - remaining_jobs result = odd_jobs_needed return result
A family went on a road trip and drove 500 miles. The car gets 25 miles per gallon of gas. How many gallons of gas did the car use?
def solve() -> int: miles_driven = 500 mpg = 25 gallons_used = miles_driven / mpg result = gallons_used return result
A car traveled 150 miles in 3 hours. How many miles per hour was the car traveling?
def solve() -> int: total_distance = 150 total_time = 3 miles_per_hour = total_distance / total_time result = miles_per_hour return result
A salad recipe requires 2 cups of lettuce, 1 cup of cherry tomatoes, and 1/2 cup of onion. If the recipe is increased by 3 times, how many cups of all ingredients are needed?
def solve() -> int: lettuce = 2 cherry_tomatoes = 1 onion = 1/2 recipe_multiplier = 3 total_lettuce = lettuce * recipe_multiplier total_cherry_tomatoes = cherry_tomatoes * recipe_multiplier total_onion = onion * recipe_multiplier total_ingredients = total_lettuce + total_cherry_tomatoes ...
Tom bought a guitar for $600. After 3 months, its value had decreased by 25%. The next year, the value of the guitar dropped another 10%. How much is the guitar worth now?
def solve() -> int: original_price = 600 discount_1 = 0.25 discount_2 = 0.10 new_price = original_price - original_price * discount_1 result = new_price - new_price * discount_2 print (result) return result
Lily and her friends made some bracelets. Lily made five times as many bracelets as Anna did. Anna made two less bracelets than Eva did. If Eva made 10 bracelets, how many bracelets did Lily make?
def solve() -> int: anna_bracelets = 10 - 2 lily_bracelets = anna_bracelets * 5 result = lily_bracelets return result
There are five friends. They decided to share a pizza equally. If each person eats 2/7 of a pizza, how many pizzas should they order?
def solve() -> int: friends = 5 pizza_per_friend = 2/7 total_pizzas = friends * pizza_per_friend result = total_pizzas return result
A store sells a jacket for $45. The store owner increases the price by 25% and then offers a 10% discount. What is the final price of the jacket?
def solve() -> int: original_price = 45 increase_percent = 25 discount_percent = 10 price_after_increase = original_price * (1 + (increase_percent / 100)) price_after_discount = price_after_increase * (1 - (discount_percent / 100)) result = price_after_discount return result
Mike walks his dog 4 miles twice a day. In the evening, he walks an extra mile to enjoy the view of the sunset. How many miles does he walk per day?
def solve() -> int: dog_walk_distance = 4 total_dog_walk_distance = dog_walk_distance * 2 total_distance_per_day = total_dog_walk_distance + 1 result = total_distance_per_day return result
An office has 28 employees, and 60% of them are male. How many female employees are in the office?
def solve() -> int: num_employees = 28 percent_male = 60 percent_female = 100 - percent_male num_female_employees = num_employees * percent_female / 100 result = num_female_employees return result
Jacob has a rectangular mat that is 3 meters by 9 meters. If he wants to cut it into a square and use all the mat, how long is each side of the square?
def solve() -> int: length = 9 width = 3 area = length * width side_length = area ** 0.5 result = side_length return result
Sophia and David are saving for a wedding which will cost them $80,000. If they save at their current rates, it will take them 2 years to save enough. Calculate how much each of them needs to save per month if they share the monthly savings.
def solve() -> int: total_cost = 80000 time = 2 monthly_savings = total_cost / (time * 12) sophia_savings = monthly_savings / 2 david_savings = monthly_savings / 2 result = sophia_savings + david_savings return result
A music composer wrote 20 songs in 4 days. How many songs per day did the composer write?
def solve() -> int: total_songs = 20 days = 4 songs_per_day = total_songs / days result = 5.0 return result
A group of friends is splitting the cost of a vacation rental. The rental costs $2000 for the week, and there are 6 people in the group. If they also need to pay a $100 cleaning fee, how much does each person need to pay?
def solve() -> int: rental_cost = 2000 num_people = 6 cleaning_fee = 100 total_cost = rental_cost + cleaning_fee per_person_cost = total_cost / num_people result = per_person_cost return result
Chris wants to buy a carpet for his bedroom. The dimensions of the bedroom are 7 feet and 12 feet. How many square feet of carpeting will he need?
def solve() -> int: length = 12 width = 7 total_square_feet = length * width result = total_square_feet return result
A company employs 500 people. If every month 2% of the workers quit their job, how many employees will be left after 6 months?
def solve() -> int: employees = 500 quit_rate = 0.02 for i in range(6): employees -= employees * quit_rate result = employees return result
Student: In a high school of 500 students, 60% of students take calculus, and 30% of students take physics. What percent of students take both calculus and physics if 20% of the students do not take any of these courses?
def solve() -> int: total_students = 500 calculus_students = total_students * 0.6 physics_students = total_students * 0.3 no_course_students = total_students * 0.2 both_courses_students = calculus_students + physics_students - no_course_students result = both_courses_students / total_students * ...
Possible math questions and programs: Lila bought a pack of 24 pencils and gave away 3 pencils to each of her 5 friends. How many pencils did she have left?
def solve() -> int: gave_away = 3 * 5 left = 24 - gave_away result = left return result
A company has 8 departments with an average of 20 employees. In the first department, 7 employees started with 2 more coming in later. In the second department, the number of employees was twice that of the first department. How many employees in total did not work that day?
def solve() -> int: num_departments = 8 avg_employees = 20 first_dept_employees = 7 + 2 second_dept_employees = 2 * first_dept_employees total_employees = num_departments * avg_employees not_working = total_employees - (first_dept_employees + second_dept_employees) ...
A rectangular field has a length of 80 meters and a width of 40 meters. If the field is fenced, how much fence is needed?
def solve() -> int: length = 80 width = 40 perimeter = 2 * (length + width) result = perimeter return result
A carpenter has 120 meters of wood. He wants to build 10 identical bookshelves. Each bookshelf needs two shelves that are 2 meters long each and four legs that are 1 meter long each. How much wood will he have left after building the bookshelves?
def solve() -> int: wood_per_bookshelf = 2 * 2 + 4 * 1 wood_for_bookshelves = 10 * wood_per_bookshelf wood_left = 120 - wood_for_bookshelves result = wood_left return result
Mike's watch costs 30% more than his bracelet. His bracelet costs $20. How much did Mike pay for his watch?
def solve() -> int: bracelet_cost = 20 watch_cost = 1.3 * bracelet_cost result = watch_cost return result
Jake has four times more keys than books. He also has 3 fewer coins than books. If he spends 5/6th of his money on each item, how much money will he save if he has $60 to begin with?
def solve() -> int: number_of_keys = 4*20 number_of_coins = number_of_keys - 3 spending_fraction = 5/6 cost_of_keys = round(number_of_keys * spending_fraction) cost_of_books = round(20 * spending_fraction) cost_of_coins = round(number_of_coins * spending_fraction) total_cost = cost_of_keys +...
The area of a parallelogram is 20 square meters. If the base is 5 meters, what is the height?
def solve() -> int: area = 20 base = 5 height = area/base result = height return result
If a recipe calls for 2/3 cup of sugar to make 15 cookies, how much sugar is needed to make 30 cookies?
def solve() -> int: cookies1 = 15 sugar1 = 2/3 cookies2 = 30 sugar2 = (sugar1 * cookies2) / cookies1 result = sugar2 return result
Rachel has a sled dog team that she usesIf Maria takes twice the time to bake a cake than to write a chapter, and it takes her 3 hours to bake a cake, how many chapters can she write in an hour?
def solve() -> int: cake_time = 3 chapter_time = cake_time / 2 chapters_per_hour = 1 / chapter_time result = chapters_per_hour return result
In a class of 24 students, 16 of them have a cell phones. What is the fraction of the students in the class that have cell phones?
def solve() -> int: num_students = 24 num_with_cellphones = 16 result = num_with_cellphones / num_students return result
Lauren and her friends ordered a large pizza that had 10 slices. If each person had 2 slices and there were 6 people, how many slices were left over?
def solve() -> int: total_slices = 10 slices_per_person = 2 num_people = 6 slices_eaten = slices_per_person * num_people slices_left = total_slices - slices_eaten result = slices_left return result
The sum of the first 20 even numbers is...
def solve() -> int: n = 20 sum_of_evens = n*(n+1) result = sum_of_evens return result
Carlos had 3.6 ounces of candy. Raj had 4 ounces more than 7 ounces of candy. How many fewer ounces of candy did Carlos have than Raj?
def solve() -> int: carlos = 3.6 raj = 7 + 4 result = raj - carlos return result
Alice and Ben bought some books from a bookstore. Alice bought 3 books for $12 each and Ben bought 4 books for $15 each. The bookstore offered them a 10% discount for buying more than 5 books together. How much did they pay in total?
def solve() -> int: alice_price = 3 * 12 ben_price = 4 * 15 total_price = alice_price + ben_price discount = total_price * 0.1 final_price = total_price - discount result = final_price return result
Some possible questions and codes are: Ben went to a bookstore and bought 3 novels for $12 each, 2 magazines for $4 each, and a gift card for $20. He used a coupon that gave him 20% off his total purchase. How much did he pay after the discount?
def solve() -> int: subtotal = 3 * 12 + 2 * 4 + 20 total = subtotal * 0.8 result = total return result
Jacob is 25 and his husband Ethan is 33 years old. Their daughter, Ava was born when Ethan was 27. How old was Jacob when he gave birth to Ava?
def solve() -> int: jacob_age = 25 ethan_age = 33 ava_age = ethan_age - 27 jacob_age_at_ava_birth = jacob_age + (ava_age - 0.5) result = jacob_age_at_ava_birth return result
Michelle needs to pay her bills for the month. She earns $800/month. Her rent is $400, her car payment is $200 and she needs to pay $50 for electricity, $50 for water, $50 for internet and $50 for phone service. How much money will she have left after paying all her bills?
def solve() -> int: total_spent = 400 + 200 + 50 + 50 + 50 + 50 money_left = 800 - total_spent result = money_left return result
A pizza restaurant offers a large pizza for $12 and a small pizza for $8. Veronica bought three large pizzas and four small pizzas. She used the money to buy two bottles of cola for $3 each. How much money does she have left?
def solve() -> int: total_cost = (3*12) + (4*8) + (2*3) remaining_money = 50 - total_cost result = remaining_money return result
Here are 10 different questions: Three friends went trick-or-treating together. Savannah collected 8 bars of Kit-kats, 4 bars of Milky Ways, and 20 mini Hershey bars. Nick collected 10 bars of Kit-kats, 6 bars of Milky Ways, and 30 mini Hershey bars. Emma collected 8 bars of Kit-kats, 10 bars of Milky Ways, and 25 mini...
def solve() -> int: total_kit_kats = 8 + 10 + 8 total_milky_ways = 4 + 6 + 10 total_hershey_bars = 20 + 30 + 25 total_candy = total_kit_kats + total_milky_ways + total_hershey_bars result = total_candy return result
Kelly, Ryan, and Toby were sharing a pizza that had 16 slices. Kelly ate 5 slices, Ryan ate 4 slices, and Toby ate 3 slices. They wanted to give the remaining slices to their teacher as a thank you gift. How many slices did their teacher get?
def solve() -> int: eaten = 5 + 4 + 3 pizza = 16 left = pizza - eaten result = left return result
Max is making necklaces to sell at an art and craft show. Each necklace requires twice as much gold beads as it does silver beads. If each necklace uses 14 units of silver beads, and Max has 420 units of gold and silver beads combined, how many necklaces can he make for the art and craft show?
def solve() -> int: silver_beads = 14 gold_beads = 2 * silver_beads total_beads = 420 necklaces = total_beads // (silver_beads + gold_beads) result = necklaces return result
Rachel has 55 candies and wants to give them out in bags with seven candies in each. How many more candies does she need to prepare 20 bags?
def solve() -> int: candies = 55 candies_per_bag = 7 bags_needed = 20 total_candies_needed = bags_needed * candies_per_bag candies_needed = total_candies_needed - candies result = candies_needed return result
A store owner buys an item for $30 and sells it at a profit of 25%. How much profit does the store owner make?
def solve() -> int: cost_price = 30 profit_percentage = 25 profit = (cost_price * profit_percentage) / 100 result = profit return result
An art museum has 8 exhibition rooms. Each room has 16 paintings, and each painting is framed with 4 frames. How many frames are there?
def solve() -> int: rooms = 8 paintings_per_room = 16 frames_per_painting = 4 total_frames = rooms * paintings_per_room * frames_per_painting result = total_frames return result
A school has 80 students in total. Seventy percent of the students passed their math test, and 60% passed their English test. How many students passed both math and English test?
def solve() -> int: total_students = 80 math_passed = total_students * 7/10 english_passed = total_students * 6/10 both_passed = math_passed + english_passed - total_students result = both_passed return result
Student: Q9. Justine needs to clean the house in 1 hour. She has already vacuumed for 35 minutes. How many more minutes will Justine need to finish cleaning?
def solve() -> int: total_time = 1 vacuum_time = 35 minutes_per_hour = 60 total_time_minutes = total_time * minutes_per_hour remaining_time = total_time_minutes - vacuum_time result = remaining_time return result
In one day, 150 people visit the Museum of Natural History in New York City. Half of the visitors are from outside of New York. Of the out-of-state visitors, 40% are college students. If the cost of a college student ticket is $9, how much money does the museum get from college students from outside of NY?
def solve() -> int: total_guests = 150 total_out_of_state = total_guests * 0.5 total_students = total_out_of_state * 0.4 total_cost = total_students * 9 result = total_cost return result
A company produces 500 boxes of cookies per hour. How many boxes of cookies can they produce in 8 hours?
def solve() -> int: boxes_per_hour = 500 time = 8 boxes_produced = boxes_per_hour * time result = boxes_produced return result
Paul bought 8 books for $12 each. He also bought a set of 10 pencils for $5. How much money did he pay in total?
def solve() -> int: books = 8 * 12 pencils = 10 * 5 result = books + pencils return result
Student: Four times as many yellow books were sold as blue books. If there were 24 blue books sold in total, how many yellow books were sold?
def solve() -> int: blue_books = 24 yellow_books = 4 * blue_books result = yellow_books return result
Possible questions and programs: Mary reads 30 pages of a book every day for 4 days a week and 50 pages a day for the other 3. How many pages does she read in a week?
def solve() -> int: pages_day_1 = 30 pages_day_2 = 50 days_1 = 4 days_2 = 3 pages_1 = pages_day_1 * days_1 pages_2 = pages_day_2 * days_2 pages_total = pages_1 + pages_2 result = pages_total return result
In a class, the number of boys is 5 more than the number of girls, and the number of girls is 7 less than the number of people in the class. If the total number of students in the class is 50, how many girls are there?
def solve() -> int: total_students = 50 students_excluding_girls = total_students - 7 boys = students_excluding_girls - 5 girls = students_excluding_girls - boys result = girls return result
During a sale, a dress is discounted at 30% off and now costs $35. What was the original price of the dress?
def solve() -> int: discounted_price = 35 percentage_discount = 0.3 original_price = discounted_price / (1 - percentage_discount) result = original_price return result
If a person walks at a rate of 5 km/h for 2 hours and then runs at a rate of 10 km/h for 1 hour, what is the total distance covered in km?
def solve() -> int: distance_walked = 5 * 2 distance_ran = 10 * 1 total_distance_covered = distance_walked + distance_ran result = f'{total_distance_covered} km' result = total_distance_covered return result
Stacy, a teacher, bought 20 kg less of pencils than of notebooks, which weigh 4 kg more than markers. While carrying the school supplies to the classroom, 1/5 weight of pencils and 1/10 weight of markers were lost. If the notebooks weighed 40 kgs, then how much did the remaining school supplies weigh?
def solve() -> int: notebooks_weight = 40 markers_weight = notebooks_weight - 4 pencils_weight = notebooks_weight - 20 lost_pencils_weight = pencils_weight / 5 lost_markers_weight = markers_weight / 10 remaining_notebooks_weight = notebooks_weight remaining_markers_weight = markers...
A bakery orders 1200 bags of flour. They have used 3/5 of the bags of flour. How many bags of flour are left?
def solve() -> int: bags_ordered = 1200 bags_used = bags_ordered * 0.6 bags_left = bags_ordered - bags_used result = bags_left return result
Rita spent 2 hours reading books and 5 hours of watching videos. How many hours did she spend in total?
def solve() -> int: hours_for_reading = 2 hours_for_watching = 5 total_hours = hours_for_reading + hours_for_watching result = total_hours return result
Betty's age is half that of her father. If her father is 50 years old, calculate Betty's age.
def solve() -> int: father_age = 50 betty_age = father_age / 2 result = f'<<<{betty_age}>>>' result = betty_age return result
If a person walks at a speed of 4 km/h for 3 hours, how many kilometers has he walked?
def solve() -> int: speed = 4 time = 3 distance = speed * time result = distance return result
Emma wants to buy a dress that costs $100 at MSRP. She has a loyalty card that gives her 10% off the MSRP, but she also has to pay a $15 alteration fee and a $20 expedited shipping fee. The tax rate is 14% on the final amount. How much does Emma have to pay for the dress?
def solve() -> int: price_after_loyalty_card = 100 * 0.9 sub_total = price_after_loyalty_card + 15 + 20 tax = sub_total * 0.14 total = sub_total + tax result = total return result
A cake recipe calls for 2 cups of flour and makes 8 servings. How much flour is in each serving?
def solve() -> int: flour_cups = 2 servings = 8 flour_per_serving = flour_cups / servings result = flour_per_serving return result
Student: A school has a water fountain that dispenses 0.1 liters of water per minute. The water fountain is turned on from 8 a.m. to 3 p.m. on weekdays, and from 9 a.m. to 12 p.m. on Saturdays. How much water does the water fountain dispense in a month of 30 days?
def solve() -> int: liters_per_minute = 0.1 weekday_hours = 7 saturday_hours = 3 days_in_month = 30 weekday_liters = weekday_hours * liters_per_minute * 60 saturday_liters = saturday_hours * liters_per_minute * 60 total_liters = (weekday_liters * 25) + (saturday_liters * 5) result = tota...
Student: John bought a set of tools for $68 and 6 batteries for $12. If the set of tools cost 5 times more than a battery, how much does a battery cost?
def solve() -> int: tools = 68 batteries = 12 battery = batteries / 6 tools_without_batteries = tools - 6 * battery tool = tools_without_batteries / 5 result = battery return result
A recipe for a cake requires 2 cups of flour, 1 cup of sugar, 3 eggs, and 1/4 cup of oil. How many cakes can you make with 10 cups of flour, 5 cups of sugar, 15 eggs, and 1 cup of oil?
def solve() -> int: result = min(10 / 2, 5 / 1, 15 / 3, 1 / 0.25) return result
Mary spent 20% of her salary for rent, 30% for utilities, 10% for food, and another 20% for her personal needs. If her salary is $3500, how much did she spend on utilities and personal needs?
def solve() -> int: salary = 3500 rent = salary * 0.2 utilities = salary * 0.3 food = salary * 0.1 personal_needs = salary * 0.2 total_spent = rent + utilities + food + personal_needs utilities_and_personal_needs = utilities + personal_needs result = utilities_and_personal_needs retu...
A bookstore has 20 books on the shelves. After purchasing 11 more books, how many books are there in total?
def solve() -> int: total_books = 0 num_of_books = 20 total_books += num_of_books additional_books = 11 total_books += additional_books result = total_books return result
A bakery sold 520 cupcakes in a day. If they sold twice as many vanilla as chocolate cupcakes and also sold 60% more strawberry than vanilla cupcakes, how many chocolate cupcakes were sold that day?
def solve() -> int: total_cupcakes = 520 chocolate_cupcakes = total_cupcakes * 1/5 vanilla_cupcakes = chocolate_cupcakes * 2 strawberry_cupcakes = vanilla_cupcakes * 160/100 result = chocolate_cupcakes return result
Leo is ordering some pizza for his friends and the pizza cost is equal to a flat $15.00 fee plus $2.00 per topping. If Leo orders a pizza with 6 toppings, how much does he pay for the pizza?
def solve() -> int: flat_fee = 15.00 cost_per_topping = 2.00 toppings = 6 pizza_cost = flat_fee + cost_per_topping * toppings result = pizza_cost return result
Maxine runs 6 miles every day. If she runs for 24 days, how many miles would she have run in total?
def solve() -> int: miles_per_day = 6 num_days = 24 total_miles = miles_per_day * num_days result = total_miles return result
**** Tony and Lauren each have a stack of books that includes a total of 15 books. If Tony wants to have the same number of books as Lauren, how many books should he take from his stack of books?
def solve() -> int: total_books = 15 number_of_people = 2 books_per_person = (total_books // number_of_people) result = books_per_person return result
A farmer has 300 cows and wants to divide them into equal groups. If they put 25 cows in each group, how many groups of cows will there be?
def solve() -> int: cows = 300 cows_per_group = 25 groups = cows // cows_per_group result = groups return result
At the candy shop, you can buy a chocolate bar for $1.50, a gummy bear for $0.50, and a lollipop for $0.25. If you order a sweet treat bag, you get 3 chocolate bars, 5 gummy bears, and 4 lollipops for $5. If you order a sour blast bag, you get 2 chocolate bars, 8 gummy bears, and 6 lollipops for $4.50. Mr. Smith buys 4...
def solve() -> int: individual_cost = 4 * (3 * 1.5 + 5 * 0.5 + 4 * 0.25) + 2 * (2 * 1.5 + 8 * 0.5 + 6 * 0.25) bag_cost = 4 * 5 + 2 * 4.5 difference = bag_cost - individual_cost result = difference return result
Larry and Mike want to buy ice cream cones. Each ice cream cone costs $1.50. If they have $7.50, how many ice cream cones can they buy in total?
def solve() -> int: cash = 7.50 ice_cream_price = 1.50 number_of_ice_creams = cash // ice_cream_price result = number_of_ice_creams return result
- Tara made 21 bracelets. Umar made 6 bracelets less than one-half of Tara's bracelets. How many bracelets did the 2 makers make in total?
def solve() -> int: tara = 21 umar = tara / 2 - 6 total = tara + umar result = total return result
Ben collects baseball cards and sells them online. He buys a pack of 10 cards for $8 and sells each card for $1.2. He also pays a 10% fee to the online platform for each sale. What is his net income after selling all the cards in a pack?
def solve() -> int: cost_per_pack = 8 revenue_per_card = 1.2 fee_per_card = 0.1 * revenue_per_card net_income_per_card = revenue_per_card - fee_per_card total_net_income = net_income_per_card * 10 result = total_net_income - cost_per_pack return result
In a class of 30 students, 17 are girls and 13 are boys. If 60% of the girls and 40% of the boys passed the test, what is the total percentage of students who passed the test?
def solve() -> int: girls = 17 boys = 13 girls_passed = 0.6 * girls boys_passed = 0.4 * boys total_students = girls + boys total_students_passed = girls_passed + boys_passed percentage_passed = (total_students_passed / total_students) * 100 result = percentage_passed ...
Harry has a rectangular garden of length 25m and breadth 10m. He wants to put a fence around the garden. If the cost of fencing is $12 per metre, how much will it cost him?
def solve() -> int: perimeter = 2*(25+10) cost_of_fencing = perimeter * 12 result = cost_of_fencing return result
A concert ticket costs $75. If you buy 4 tickets, how much money will you spend?
def solve() -> int: ticket_price = 75 num_tickets = 4 total_cost = ticket_price * num_tickets result = total_cost return result
Student: A swimming pool is 25 meters long, 15 meters wide, and 2 meters deep. If it is filled with water and the density of water is 1000 kg/m^3, what is the total mass of water in the pool?
def solve() -> int: length = 25 width = 15 depth = 2 density = 1000 volume = length * width * depth mass = volume * density result = mass return result
You spend $8 on a movie ticket and $5 on popcorn. How much did you spend in total if you also bought a soda for $2.50?
def solve() -> int: ticket_cost = 8 popcorn_cost = 5 soda_cost = 2.5 total_cost = ticket_cost + popcorn_cost + soda_cost result = total_cost return result
Q2: Gina has 9 balls and wants to divide them into equal groups of 3. How many groups can she make?
def solve() -> int: remainder = 9 % 3 groups = 9 // 3 result = groups + remainder return result
Student: There are 40 students in a class, and 1/5 of them are absent. How many students are in class today?
def solve() -> int: total_students = 40 absent_students = total_students * 1/5 present_students = total_students - absent_students result = present_students return result
Student: A toy company sold 54000 toys last year for a total of $810000. If they plan to increase their sales by 20% this year and sell each toy for $17.50, how much revenue will the company make this year?
def solve() -> int: toys_sold_last_year = 54000 total_revenue_last_year = 810000 percent_increase = 0.2 price_per_toy = 17.50 toys_sold_this_year = toys_sold_last_year * (1 + percent_increase) total_revenue_this_year = toys_sold_this_year * price_per_toy result = total_revenue_this_year ...
Alex needs to buy a new laptop and it is priced at $850. His employer is offering to subsidize the purchase and will pay 50% of the original price. If Alex uses the subsidy, how much will he have to pay for the laptop?
def solve() -> int: price = 850 discount = 0.5 payment = price * (1 - discount) result = payment return result