question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A pool can be filled with water by two pipes together in 3.5 hours. If the first pipe is used for 4 hours and the second pipe is used for 2.5 hours, the pool will be almost full. How much longer does it take to finish filling the pool?
def solve() -> int: time_remaining = 1.6 * 3.5 result = time_remaining return result
Lily divided her 60 pages notebook into 6 equal parts. She only wrote on 2 parts of the notebook. How many pages are still blank?
def solve() -> int: total_pages = 60 parts = 6 written_parts = 2 blank_parts = parts - written_parts pages_per_part = total_pages / parts blank_pages = blank_parts * pages_per_part result = blank_pages return result
A recipe for a cake requires 2 cups of sugar for every 3 cups of flour. If you want to make a cake using 9 cups of flour, how much sugar will you need?
def solve() -> int: flour = 9 sugar = 2/3*flour result = sugar return result
A factory produces 5000 t-shirts each day. If the factory operates for 25 days each month, how many t-shirts does it produce in a month?
def solve() -> int: tshirts_per_day = 5000 days_per_month = 25 total_tshirts = tshirts_per_day * days_per_month result = total_tshirts return result
Jane went shopping and bought five cans of soda at $0.79 each, two bags of chips at $2.00 each and four pens at 97 cents each. She gave the cashier $15, how much change did she get?
def solve() -> int: price_soda = 0.79 price_chips = 2 price_pens = 0.97 total_spent = 15 amount_owed = (price_soda * 5) + (price_chips * 2) + (price_pens * 4) change_received = total_spent - amount_owed result = change_received return result
James wants to improve his basketball skills. He practices dribbling for 30 minutes every day and attends basketball training 3 times a week for 2 hours. How much time does James spend training each week?
def solve() -> int: dribbling_time = 30 training_frequency = 3 training_time = 2 training_time_minutes = training_time * 60 total_training_time = training_frequency * training_time_minutes total_time = total_training_time + (dribbling_time * 7) result = total_time ...
A train has 18 more seats than twice the number of windows. If the train has 24 windows, how many seats does it have?
def solve() -> int: windows = 24 two_windows = 2 * windows seats = two_windows + 18 result = seats return result
Kevin and his brother are raising money for a charity. Together they have collected a total of $180. They decide to donate $90 to the homeless shelter and the remaining amount to the food bank. How much did they donate to the food bank?
def solve() -> int: donation = 0 donation += 90 donation += (180-90) result = donation return result
A book is priced at $8.99 on a website. After a 20% discount is applied and a $2.50 shipping fee is added, what is the final price?
def solve() -> int: price_of_book = 8.99 discount_percentage = 20 discount = price_of_book * (discount_percentage/100) discounted_price = price_of_book - discount shipping_fee = 2.5 final_price = discounted_price + shipping_fee result = final_price return result
A soccer team collected $594 in ticket sales. If each ticket cost $12, how many tickets were sold?
def solve() -> int: total_ticket_sales = 594 one_ticket_cost = 12 ticket_sold = total_ticket_sales / one_ticket_cost result = ticket_sold return result
The angles in a triangle are in the ratio of 6:2:4. Find the measure of each angle.
def solve() -> int: total_angles = 180 angles = [6, 2, 4] sum_angles = sum(angles) angle1 = total_angles*angles[0]/sum_angles angle2 = total_angles*angles[1]/sum_angles angle3 = total_angles*angles[2]/sum_angles result = (angle1, angle2, angle3) return result
A bank offers a 10% annual interest rate for a savings account. The interest is compounded monthly, meaning that each month, the interest is calculated based on the current balance and added to the balance. How much money will a person have in the account after 5 years if they deposit $1000 initially and do not withdra...
def solve() -> int: balance = 1000 monthly_rate = 0.1 / 12 for i in range(5): for j in range(12): balance = balance * (1 + monthly_rate) result = round(balance, 2) return result
A class has 30 students. The ratio of boys to girls is 2:3. How many boys are there in the class?
def solve() -> int: total_students = 30 boys_ratio = 2 girls_ratio = 3 total_ratio = boys_ratio + girls_ratio boys = (boys_ratio/total_ratio)*total_students result = boys return result
Grace has a bag of candy that weighs 500 grams. She eats 10% of the candy and gives 20% of the candy to her brother. How much candy is left in the bag in grams?
def solve() -> int: ate = 500 * 0.1 gave = 500 * 0.2 left = 500 - ate - gave result = left return result
A car travels at a speed of 30 miles per hour. How many minutes would it take to travel 15 miles?
def solve() -> int: speed = 30 distance = 15 time_hours = distance / speed time_minutes = time_hours *60 result = time_minutes return result
If a cake has 454 calories and it is cut into 6 slices, how many calories are in each slice?
def solve() -> int: calories = 454 slices = 6 result = calories / slices return result
A library has 3000 books in its collection. If it adds 200 books every month, how many books will it have after 2 years?
def solve() -> int: books_in_collection = 3000 books_added_per_month = 200 months_in_two_years = 2 * 12 total_books = books_in_collection + (books_added_per_month * months_in_two_years) result = total_books return result
Dylan has 7 times as many books as magazines. If he has 35 books and magazines combined, how many magazines does he have?
def solve() -> int: books = 35 / (7 + 1) result = books * 1 return result
John needs to paint a wall which is 10 meters by 10 meters. He paints at a rate of 6 meters per hour. How many hours will it take to John to completely paint the wall?
def solve() -> int: wall_length = 10 wall_width = 10 painting_rate = 6 time = (wall_length + wall_width) / painting_rate result = time return result
Peter packs 4 jars of peanuts, each jar having 25 peanuts. He has 20 coworkers, but only 55% of them want peanuts. How many peanuts does each coworker get?
def solve() -> int: jars = 4 peanuts_per_jar = 25 total_peanuts = jars * peanuts_per_jar coworkers = 20 coworker_percentage = 0.55 coworkers_taking_peanuts = coworkers * coworker_percentage peanuts_per_coworker = total_peanuts / coworkers_taking_peanuts result = peanuts_per_cow...
Dionysus needs to replace the grapes for his wine every year. He trades gold coins to Demeter the farmer toSara can bake 20 cookies in 15 minutes. If she needs to bake 100 cookies, how long will it take her?
def solve() -> int: cookies_baked = 20 time_taken = 15 cookies_needed = 100 time_required = (cookies_needed / cookies_baked) * time_taken result = time_required return result
Leo has a 2-liter bottle of juice that he wants to pour into 250-milliliter cups. He already filled 3 cups and spilled some juice on the floor. He estimates that he spilled about 10% of the juice. How many more cups can he fill with the remaining juice?
def solve() -> int: juice_volume = 2 * 1000 juice_spilled = juice_volume * 0.1 juice_left = juice_volume - juice_spilled - (3 * 250) cups_left = juice_left // 250 result = cups_left return result
Student: The perimeter of a rectangle is 30 cm. One side is 7 cm. What is the length of the other side?
def solve() -> int: perimeter = 30 side1 = 7 side2 = perimeter - side1 result = side2 return result
Emily wants to get a computer for her studies and she can afford to spend a fifth of her savings account. If her savings account has $1200, how much money does she need to spend to get the computer?
def solve() -> int: savings_account = 1200 cost_of_computer = savings_account / 5 result = cost_of_computer return result
Jasmine has a rectangular-shaped garden measuring 12 meters by 8 meters. She wants to plant flowers that require 15 seeds per square meter. One bag of seeds contains 500 seeds and costs $10. How much does Jasmine need to spend to buy enough seeds for her garden?
def solve() -> int: length = 12 width = 8 area = length * width seeds_per_square_meter = 15 seeds_needed = area * seeds_per_square_meter seeds_per_bag = 500 cost_per_bag = 10 bags_needed = seeds_needed / seeds_per_bag total_cost = bags_needed * cost_per_bag result = total_cost ...
A parcel delivery van is loaded with 402 boxes of similar weights. Every day, the driver unloads 40% of the boxes. How many boxes are left in the van after 6 days?
def solve() -> int: num_boxes = 402 unload_percent = 0.4 days = 6 boxes_unloaded = num_boxes * unload_percent boxes_left = num_boxes - boxes_unloaded total_unloaded = boxes_unloaded * days total_left = num_boxes - total_unloaded result = total_left return result
Leo is a plumber who fixes leaks in pipes. He charges a fixed rate of $60 for the service, plus $5 for each meter of pipe he has to replace. He fixes a leak that requires him to replace 12 meters of pipe. However, he also gives a 10% discount to his regular customers. How much does he charge for the job?
def solve() -> int: fixed_rate = 60 pipe_price = 5 pipe_length = 12 discount_rate = 0.1 cost_before_discount = fixed_rate + pipe_price * pipe_length discount_amount = cost_before_discount * discount_rate cost_after_discount = cost_before_discount - discount_amount result = cost_af...
Nate had 18 toy cars before Monday. On Tuesday, he sold three times the number of toy cars he sold on Monday. Then, on Wednesday, he sold half of the total amount of toy cars sold during the first two days. How many toy cars does Nate have left?
def solve() -> int: cars_before_monday = 18 cars_on_monday = 5 cars_on_tuesday = 3 * cars_on_monday total_cars_sold = cars_on_monday + cars_on_tuesday cars_on_wednesday = total_cars_sold / 2 cars_left = cars_before_monday - total_cars_sold + cars_on_wednesday re...
A coffee shop offers two sizes of coffee: small (12 oz) for $2.50 and large (16 oz) for $3.50. If 60% of customers order small and 40% of customers order large, what is the average revenue per customer?
def solve() -> int: small_size = 12 small_price = 2.5 large_size = 16 large_price = 3.5 small_percentage = 0.6 large_percentage = 0.4 average_revenue = (small_percentage * small_price) + (large_percentage * large_price) result = round(average_revenue, 2) return result
Student: 7. Martin and Shane both want to buy new headphones. Shane purchased the headphones for $70. How much should Martin budget if he wants to spend $30 more than Shane?
def solve() -> int: shanes_price = 70 martins_price = shanes_price + 30 result = martins_price return result
Student: There are 893 people in the movie theater. If they are charging $3 per person, how much money did they collect?
def solve() -> int: people = 893 price_per_person = 3 total_amount = people * price_per_person result = total_amount return result
In a class of 50 students, 28 students play football, and 18 students play cricket. If 10 students play both games, how many students do not play either game?
def solve() -> int: football_players = 28 cricket_players = 18 both = 10 neither = 50 - (football_players + cricket_players - both) result = neither return result
A company is providing a bonus of $100 for every 10 completed tasks by an employee. If an employee completes an average of 8 tasks and there are 30 employees, how much bonus does the company provide?
def solve() -> int: total_tasks = 8 * 30 company_bonus = (total_tasks // 10) * 100 result = company_bonus return result
There are 28 bottles of juice in the refrigerator containing varying amounts of juice. The first bottle contains 4 times as much juice as the number of juice in the second bottle. The number of juice in the second bottle is 3/2 times the number of juice in the third bottle and the number of juice in the third bottle is...
def solve() -> int: bottle1_juice = 0 bottle2_juice = 0 bottle3_juice = 12 bottle1_juice = bottle2_juice*4 bottle2_juice = bottle3_juice*2/3 total_juice = bottle1_juice + bottle2_juice + bottle3_juice result = total_juice return result
am owns a shop and sells games for $25 each. He earns a profit of $15 from each sale. If Sam made a total of $500 in one day, how many games did he sell?
def solve() -> int: sale_price = 25 profit = 15 total_earning = 500 revenue = total_earning + profit num_of_games_sold = revenue / sale_price result = num_of_games_sold return result
It takes 60 seconds to fill a bucket with water, and two buckets can fill a barrel in 120 seconds. How long does it take to fill 10 barrels with water?
def solve() -> int: bucket_time = 60 barrel_time = 120 num_of_barrels = 10 time = 0 first_barrel_time = num_of_barrels * barrel_time for num in range(num_of_barrels): time += first_barrel_time time += (num_of_barrels * bucket_time) result = time return result
The population of whales in Barracuda Point has increased by 10%. If there were 72 whales originally, how many whales are currently in Barracuda Point?
def solve() -> int: original_whales = 72 increase_in_whales = original_whales * 0.1 current_whales = original_whales + increase_in_whales result = current_whales return result
A rectangle has a perimeter of 26 cm. If one of its sides is 4 cm, what is the length of the other side?
def solve() -> int: perimeter = 26 side1 = 4 side2 = (perimeter - 2*side1) / 2 result = side2 return result
am's cornfield is in the shape of a rectangle with a width of 250 meters and a length of 600 meters. Calculate the total area of the cornfield?
def solve() -> int: width = 250 length = 600 area = width * length result = area return result
For a school trip, there are 60 students and 40 chaperones. If each group needs an equal number of students and chaperones, how many groups can be formed? Emily, Ava, and Lily made cakes for a bake sale. Emily's cake had 34 slices, Ava's cake had 12 less slices than Emily, and Lily's cake had half the slices of Emily a...
def solve() -> int: students = 60 chaperones = 40 groups = min(students, chaperones) result = groups emily_slices = 34 ava_slices = emily_slices - 12 lily_slices = (emily_slices + ava_slices) / 2 total_earnings = (emily_slices + ava_slices + lily_slices) retu...
Ethan is filling a swimming pool at the rate of 10 gallons every minute. If the swimming pool can hold 500 gallons of water, how much more water does he need to pour into the pool if he filled it for 20 minutes?
def solve() -> int: rate = 10 capacity = 500 time = 20 water_filled = rate * time water_needed = capacity - water_filled result = water_needed return result
Michael bikes for 60 minutes every day during weekdays. This week, he biked 20 minutes less on Tuesday and 35 minutes more on Thursday. How many hours did Michael bike this week?
def solve() -> int: monday = 60 tuesday = monday - 20 wednesday = monday thursday = monday + 35 friday = monday total_minutes = monday + tuesday + wednesday + thursday + friday total_hours = total_minutes / 60 result = total_hours return result
Rachel buys a shirt that costs $25. She later returns the shirt and gets a refund for $20. How much did Rachel pay for the shirt in the end?
def solve() -> int: shirt_cost = 25 refund_amount = 20 final_cost = shirt_cost - refund_amount result = final_cost return result
Student: Sam can cover 30 miles on his bike in 2 hours. If he wants to cover 45 miles, how long will it take?
def solve() -> int: miles = 30 hours = 2 target = 45 speed = miles / hours time = target / speed result = time return result
John works at a factory that pays him $12.50 per hour. He works 10 hours a day for 5 days in a week. How much is his monthly salary if he missed three days?
def solve() -> int: hourly_rate = 12.50 hours_per_day = 10 days_per_week = 5 days_missed = 3 weekly_salary = hourly_rate * hours_per_day * (days_per_week - days_missed) monthly_salary = weekly_salary * 4 result = monthly_salary return result
There are 36 students in a class. If 1/4 of them are absent, how many students are present in the classroom?
def solve() -> int: total_students = 36 absent_students = total_students * 1/4 present_students = total_students - absent_students result = present_students return result
Emily bakes 3 cakes, each cut into 6 slices. One sixth of the slices are given to charity. Half of the remaining slices are eaten by Emily. If there are 4 slices left, how many slices were in the cakes to begin with?
def solve() -> int: cakes = 3*6 charity_slices = cakes//6 remaining_slices = cakes - charity_slices emily_slices = remaining_slices//2 remaining_slices -= emily_slices remaining_slices -= 4 result = remaining_slices return result
It takes Jenny 20 seconds to type a word, 15 seconds to format a paragraph, and 2 minutes to proofread her essay. If her essay has 500 words and 20 paragraphs, how much time will she need to finish her essay?
def solve() -> int: word_time = 20 paragraph_time = 15 proofread_time = 2 * 60 num_words = 500 num_paragraphs = 20 total_word_time = num_words * word_time total_paragraph_time = num_paragraphs * paragraph_time total_time = total_word_time + total_paragraph_time + proofread_time...
Amy has 8 candies in her pocket. She eats 3 candies and then gets 5 more candies from her mom. How many candies does Amy have in her pocket now?
def solve() -> int: candies = 8 candies_eaten = 3 candies_from_mom = 5 candies_final = candies - candies_eaten + candies_from_mom result = candies_final return result
Bill saved $150 on Monday and $300 on Tuesday. If he saved twice as much on Tuesday, how much did he save on Monday?
def solve() -> int: tuesday_savings = 300 monday_savings = tuesday_savings / 2 total_savings = tuesday_savings + monday_savings result = total_savings - tuesday_savings return result
Student: In a bag, there are 2 green marbles, 4 blue marbles and 3 red marbles. What is the probability of getting a green marble from the bag?
def solve() -> int: total = 2 + 4 + 3 green = 2 probability = green / total result = probability return result
Possible questions: Alice wants to make a fruit salad for her family. She needs to buy 5 apples, 4 oranges, 3 bananas, 2 pears, and 1 pineapple. The prices of the fruits are $0.8, $0.6, $0.4, $0.5, and $3.5 respectively. She also needs to buy a bottle of yogurt for $2. How much does she spend in total?
def solve() -> int: apples = 5 oranges = 4 bananas = 3 pears = 2 pineapple = 1 price_apple = 0.8 price_orange = 0.6 price_banana = 0.4 price_pear = 0.5 price_pineapple = 3.5 cost_fruits = apples * price_apple + oranges * price_orange + bananas * price_banana + pears * price_p...
Frank's sister bought a pack of 36 cupcakes. She shares them equally with her 6 friends. If each friend eats 1 cupcake every day, how many days will it take to finish the pack of cupcakes?
def solve() -> int: cupcakes_in_pack = 36 friends = 6 cupcakes_per_day = 1 total_cupcakes_eaten = friends * cupcakes_per_day days_to_finish = cupcakes_in_pack / total_cupcakes_eaten result = days_to_finish return result
8. A shop sells cups for $200 each. During a sale, the store offered discounts that totaled to 1/5 of the original prices. How much did the customer pay for the cups?
def solve() -> int: original_price = 200 discount = original_price * 1/5 sale_price = original_price - discount result = 160 return result
Nevada Mountain received 225 centimeters of snow and Arizona Mountain received 1.5 meters of snow. How many more centimeters of snow did Arizona Mountain receive?
def solve() -> int: snow_n = 225 snow_a = 1.5 * 100 difference = snow_a - snow_n result = difference return result
Jack has $12. Jill has $8. If Jack gives Jill half of what he has, Jill will have more than Jack. But then Jill spends $3. How much more money does Jill have than Jack?
def solve() -> int: jack_money = 12 jill_money = 8 jack_money = jack_money / 2 jill_money = jill_money + jack_money jill_money = jill_money - 3 difference = jill_money - jack_money result = difference return result
Rebecca took 30 pictures during her vacation. If she took 9 pictures on Monday, how many pictures did she take the rest of the week?
def solve() -> int: total_pictures = 30 pictures_on_monday = 9 pictures_the_rest_of_the_week = total_pictures - pictures_on_monday result = pictures_the_rest_of_the_week return result
If there are 600 students in a school and 25% of them were absent today, how many students attended school today?
def solve() -> int: total_students = 600 percent_absent = 25 percent_present = 100 - percent_absent students_present = (percent_present/100) * total_students result = students_present return result
A store buys 20 pairs of shoes for $50 each. If they sell all of them for $70 each, how much profit do they make?
def solve() -> int: cost = 20 * 50 revenue = 20 * 70 profit = revenue - cost result = profit return result
Karen bought three times as many apples as Jim. If Jim paid $2 for each apple and bought 50 apples, calculate the cost of Karen's apples.
def solve() -> int: jim_apples = 50 jim_cost = jim_apples * 2 karen_apples = jim_apples * 3 karen_cost = karen_apples * 2 result = karen_cost return result
A bus travels at an average speed of 60 km/h for the first 3 hours of its 5-hour journey. If the bus travels the remaining distance at an average speed of 80 km/h, what is the total distance traveled by the bus?
def solve() -> int: distance_first_3_hours = 60 * 3 remaining_time = 5 - 3 remaining_distance = 80 * remaining_time total_distance = distance_first_3_hours + remaining_distance result = total_distance return result
-Clear the output before submitting Possible new questions and programs: Mia is a baker. She made 24 cupcakes and 36 cookies for a party. She sold each cupcake for $1.50 and each cookie for $0.75. She also gave away 6 cookies to her friends. How much money did Mia earn from the party?
def solve() -> int: cupcakes = 24 cookies = 36 cupcake_price = 1.50 cookie_price = 0.75 free_cookies = 6 sold_cookies = cookies - free_cookies cupcake_revenue = cupcakes * cupcake_price cookie_revenue = sold_cookies * cookie_price money_earned = cupcake_revenue + cookie_revenue r...
Student: Mrs. Brown had 300 cookies, and she sold two fifths of them. How many cookies are left?
def solve() -> int: cookies = 300 sold = cookies * 2/5 left = cookies - sold result = left return result
A cake recipe calls for 2 and 1/2 cups of sugar. If you want to make half of the recipe, how much sugar do you need?
def solve() -> int: full_recipe = 2.5 half_recipe = full_recipe/2 result = half_recipe return result
If the circumference of a circle is 20π inches, what is its diameter in inches?
def solve() -> int: circumference = 20 * 3.14159 diameter = circumference / 3.14159 result = diameter return result
Diana has five times as many dimes as nickels in her purse. She decides to exchange 1/2 of the dimes for quarters at the bank. If she has 40 nickels, calculate the combined number of quarters, dimes, and nickels she has after exchanging 1/2 of the dimes.
def solve() -> int: dimes_before = 5 * 40 dimes_exchanged = dimes_before // 2 quarters = dimes_exchanged // 2 dimes_after = dimes_before - dimes_exchanged combined = quarters + dimes_after + 40 result = combined return result
Student: 45% of Maya's coins are silver and the rest are gold. If she has 27 silver coins, how many gold coins does she have?
def solve() -> int: silver_coins = 27 percentage_silver = 45 total_coins = silver_coins / (percentage_silver / 100) gold_coins = total_coins - silver_coins result = gold_coins return result
``` A group of 20 friends went to a restaurant. They ordered 5 pizzas and then decided to share them equally. Each pizza has 8 slices. How many pieces of pizza will each friend get?
def solve() -> int: num_friends = 20 num_pizzas = 5 num_slices = num_pizzas * 8 num_slices_per_friend = num_slices // num_friends result = num_slices_per_friend return result
In a class of 30 students, 15 are female and 10 of the females are seniors. What percentage of the class are senior females?
def solve() -> int: n_students = 30 n_females = 15 n_seniors = 10 percent_senior_females = n_seniors / n_students * 100 result = percent_senior_females return result
Tania has a shop that contains 90 bicycles, 80 skateboards, and 54 scooters. If she gives away 10 bicycles, 12 skateboards, and 16 scooters, how many items would she still have?
def solve() -> int: items_collection = 90 + 80 + 54 amount_given = 10 + 12 + 16 items_left = items_collection - amount_given result = items_left return result
An apple pie recipe calls for 8 apples. If Sally only has 6 apples, what fraction of the recipe can she make?
def solve() -> int: apples_needed = 8 apples_available = 6 fraction_possible = apples_available / apples_needed result = fraction_possible return result
A car rental company charges $50 per day to rent a car. If a customer rents a car for 5 days, but receives a 10% discount for being a member, what is their final bill?
def solve() -> int: daily_rate = 50 num_days = 5 discount = 0.10 total_cost = daily_rate * num_days final_cost = total_cost - (total_cost * discount) result = final_cost return result
Ben collects stamps from different countries. He has 80 stamps in total. 25% of his stamps are from Canada, 15% are from Japan, and the rest are from other countries. How many stamps does he have from other countries?
def solve() -> int: total_stamps = 80 canada_percent = 0.25 japan_percent = 0.15 canada_stamps = total_stamps * canada_percent japan_stamps = total_stamps * japan_percent other_stamps = total_stamps - canada_stamps - japan_stamps result = other_stamps return result
An item is sold for $25 with a markup of 20%. What was the original cost of the item?
def solve() -> int: markup_percent = 20 markup_decimal = markup_percent / 100 selling_price = 25 original_cost = selling_price / (1 + markup_decimal) result = original_cost return result
Olivia flew to India and her suitcase weighed 10 pounds. She bought 2 saris that weighed 1.5 pounds each, 3 pairs of earrings that weighed 2 ounces each, 4 boxes of spices that weighed 7 ounces each and 6 bottles of water that weighed 1.1 pounds each. Considering 16 ounces is the same as 1 pound, how much did Olivia's ...
def solve() -> int: earrings_weight = 3 * 2 / 16 spices_weight = 4 * 7 / 16 total_weight = 10 + 2 * 1.5 + earrings_weight + spices_weight + 6 * 1.1 result = total_weight return result
Jack has a pencil box with 12 pencils, but some of them are broken. He throws away 3 broken pencils and gives 4 pencils to his classmates. He then sharpens the remaining pencils, but they become shorter by 1 cm. How long are the pencils now?
def solve() -> int: pencil_box = 12 broken_pencils = 3 pencils_given = 4 remaining_pencils = pencil_box - broken_pencils - pencils_given shortened_pencil_length = 1 pencil_length = 0 if remaining_pencils > 0: pencil_length = pencil_box - broken_pencils - pencils_given - sho...
Student: A recipe calls for 2 cups of flour, 1 cup of sugar, and 1/2 cup of butter. If you want to make half the recipe, how much of each ingredient do you need?
def solve() -> int: flour = 2 sugar = 1 butter = 0.5 flour_half = flour/2 sugar_half = sugar/2 butter_half = butter/2 result = flour_half + sugar_half + butter_half return result
1. John used 2/3 of his 9-gallon gas tank to travel 20 miles. How many miles per gallon does he get?
def solve() -> int: total_miles = 20 total_gallons = 9 used_gallons = total_gallons * (2/3) mpg = total_miles/used_gallons result = mpg return result
Rebecca packs 9 sandwiches, 6 apples, and 3 juice boxes for her picnic. If she is going with 2 friends, how many snacks did she bring in total?
def solve() -> int: sandwiches = 9 apples = 6 juice_boxes = 3 friends = 2 total_snacks = sandwiches + apples + juice_boxes result = total_snacks return result
The hotel has 8 floors and 12 rooms per floor. Each room has a bed, a TV, and a lamp. The bed costs $200, the TV costs $150, and the lamp costs $50. How much money did the hotel spend on the furniture for the rooms?
def solve() -> int: floors = 8 rooms_per_floor = 12 bed_cost = 200 tv_cost = 150 lamp_cost = 50 rooms_total = floors * rooms_per_floor beds_cost = rooms_total * bed_cost tvs_cost = rooms_total * tv_cost lamps_cost = rooms_total * lamp_cost...
Richard needs to buy boxes for his moving day. Each box costs $2.50 and he needs to buy 15 boxes. How much will Richard spend on boxes?
def solve() -> int: cost_per_box = 2.50 boxes_required = 15 total_cost = cost_per_box * boxes_required result = total_cost return result
If the area of a square is 64 square inches, what is the length of one side of the square?
def solve() -> int: area = 64 side_length = area**(1/2) result = side_length return result
A bakery sells cupcakes for $2 each. However, for every 4 cupcakes bought, the customer gets a free one. How many cupcakes can a customer get if they have $20 to spend?
def solve() -> int: cupcake_price = 2 money = 20 cupcakes_bought = money // cupcake_price cupcakes_free = cupcakes_bought // 4 cupcakes_total = cupcakes_bought + cupcakes_free result = cupcakes_total return result
Edward has half as many cookies as Maria has. Olivia has 3 times as many cookies as Maria has. If Edward has 4 cookies, how many cookies does Olivia have?
def solve() -> int: maria_cookies = 8 edward_cookies = 4 olivia_cookies = 3 * maria_cookies result = olivia_cookies return result
Sara bikes to work every day. She covers a distance of 3.2 miles each way. If she works 5 days a week and her company is open 48 weeks a year, how many miles does she bike in a year?
def solve() -> int: distance = 3.2 days = 5 weeks = 48 result = distance * days * weeks return result
A garden is 6 feet by 8 feet. If Maria plants 2 rows of flowers, which takes up 2 feet of the width of the garden, and each plant is 1 foot long, how many plants can she plant in total?
def solve() -> int: width = 8 - 2 length = 6 available_space = width * length plants_per_row = width // 1 total_plants = 2 * plants_per_row result = total_plants return result
Jack can push a sled with 300 pounds for 25 meters. He can increase his weight by 25% if he only pushes forThe Johnson family goes to the zoo. A child ticket is $5. An adult ticket is $10. A family ticket for 2 adults and 2 children is $25. Mr. and Mrs. Johnson each buy an adult ticket. Their two children each get a ch...
def solve() -> int: child_ticket_price = 5 adult_ticket_price = 10 family_ticket_price = 25 num_adults = 2 num_children = 2 total_cost = (num_adults * adult_ticket_price) + (num_children * child_ticket_price) result = total_cost return result
arah has 50 marbles. She gives 20 of her marbles to Susan who has 30 marbles. How many marbles do they both have now?
def solve() -> int: sarah_marbles = 50 susan_marbles = 30 sarah_marbles -= 20 susan_marbles += 20 result = sarah_marbles + susan_marbles return result
If you take the highest temperature recorded in Antarctica and add 30 to it, then divide it by 2 and add 10, the answer is 32. What was the highest temperature recorded in Antarctica?
def solve() -> int: highest_temp = ((32 - 10) * 2) - 30 result = highest_temp return result
Colin has 35 apples. His dad gave him 10 more apples. If he wants to split the apples into groups of 5, how many groups did he make?
def solve() -> int: number_of_apples = 45 group_size = 5 number_of_groups = number_of_apples // group_size result = number_of_groups return result
A school has a total of 350 students. If 3/7 of the students are boys and the rest are girls, how many girls are in the school?
def solve() -> int: total_students = 350 boys = total_students * 3/7 girls = total_students - boys result = girls return result
Emily wants to make the same amount of money as her friend who babysits. Last week, her friend babysat for 20 hours at $10 per hour. Emily can only charge $8 per hour. How many more hours does Emily need to babysit to earn the same amount as her friend?
def solve() -> int: friend_hours = 20 friend_rate = 10 emily_rate = 8 friend_earnings = friend_hours * friend_rate emily_earnings = 0 emily_hours = 0 while emily_earnings < friend_earnings: emily_hours += 1 emily_earnings = emily_hours * emily_rate r...
A garden has a rectangular shape with a length of 8 meters and a width of 5 meters. Olivia wants to put tiles on the garden. Each tile measures 30 cm by 30 cm. How many tiles does she need to cover the entire garden?
def solve() -> int: garden_length = 8 garden_width = 5 tile_length = 0.3 tile_width = 0.3 total_garden_area = garden_length * garden_width total_tile_area = tile_length * tile_width total_tiles_needed = total_garden_area / total_tile_area result = int(total_tiles_needed) return ...
- Noah has 7 more cars than Liam. Liam has 3 times as many cars as Olivia. If Olivia has 4 cars, how many does Noah have?
def solve() -> int: olivia = 4 liam = 3 * olivia noah = liam + 7 result = noah return result
If a store sells jeans for $50 and t-shirts for $20, and it sold 50 items for a total of $1200, how many t-shirts were sold?
def solve() -> int: jeans_price = 50 t_shirt_price = 20 no_of_items = 50 total_amount = 1200 total_jeans_price = jeans_price * no_of_items total_t_shirt_price = total_amount - total_jeans_price no_of_t_shirts = total_t_shirt_price/t_shirt_price result = no_of_t_shirts return result
Katie has 9 quarters and 8 dimes. If she gives 3 quarters away, how many more dimes does she need to have $2 in total?
def solve() -> int: quarters_left = 9 - 3 money_left = 2 - (quarters_left*0.25) dimes_needed = round(money_left / 0.10) result = dimes_needed return result
A certain restaurant charged $12.50 for a meal and 10% tax was added to the bill. If the total cost was $17.38, what was the tax amount?
def solve() -> int: total_cost = 17.38 meal_cost = 12.50 tax_percent = 10 tax_amount = (total_cost - meal_cost) / (tax_percent / 100) result = tax_amount return result
Student: Amy collected 30 coins in an hour. Her friend, Ben, collected 25 coins in an hour. How many more coins did Amy collect than Ben in 2.5 hours?
def solve() -> int: amy_coins = 30 ben_coins = 25 amy_total = amy_coins * 2.5 ben_total = ben_coins * 2.5 difference = amy_total - ben_total result = difference return result
A water tank can hold 500 liters of water. There are two taps that can fill the tank. The first tap can fill the tank in 20 minutes, and the second tap can fill the tank in 30 minutes. How long will it take to fill the tank if both taps are turned on at the same time?
def solve() -> int: rate1 = 500 / 20 rate2 = 500 / 30 rate = rate1 + rate2 time = 500 / rate result = time return result
A cell phone plan costs $30 a month plus $0.10 per minute. If Sarah talks on the phone for 275 minutes in one month, how much will her phone bill be?
def solve() -> int: minutes = 275 cost = 30 + minutes * 0.1 result = f'<<<{cost}>>>' result = cost return result