question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
An athlete runs for 30 minutes everyday for 2 weeks. If the athlete runs at 8 km/h, how many kilometers does the athlete run in the 2 weeks?
def solve() -> int: n_days = 14 time_per_day_h = 0.5 speed_kmph = 8 total_hours = n_days * time_per_day_h total_distance_km = total_hours * speed_kmph result = total_distance_km return result
Lily bought 10 candy bars for $1 each and 2 bags of chips for $3 each. She used the money to buy a $25 dress. How much money does she have left?
def solve() -> int: candy_bars = 10 candy_bar_price = 1 chips = 2 chip_price = 3 dress = 25 total_spending = (candy_bars * candy_bar_price) + (chips * chip_price) + dress starting_money = 50 remaining_money = starting_money - total_spending result = remaining_mon...
Student: Grandma’s Bakery has a rectangular ceramic tile in its storefront with an area of 216 square inches. If the tiles length is 18 inches, what is the width of the tile?
def solve() -> int: length = 18 area = 216 width = area / length result = width return result
``` There are 24 children in a school classroom. The teacher divides them into equal groups of 4. How many groups are there?
def solve() -> int: no_of_children = 24 children_per_group = 4 no_of_groups = no_of_children // children_per_group result = no_of_groups return result
The population of a city grows by 2% every year. If the current population is 100,000, what will be the population after 5 years?
def solve() -> int: current_population = 100000 growth_percent = 0.02 growth_years = 5 population_growth = current_population * (1 + growth_percent) ** growth_years result = population_growth return result
A carton of juice is 4 centimeters deep, 6 centimeters wide, and 1 meter high. What is the volume of the carton?
def solve() -> int: depth = 4 width = 6 height = 100 volume = depth * width * height result = volume return result
It takes 2 hours to mow a lawn. Mark has 5 lawns to mow and each lawn is 500 square feet, but 20% of the lawns have rough terrain. How long will it take for him to finish all the lawns?
def solve() -> int: lawn_area = 500 total_lawns = 5 rough_terrain_percentage = 20 rough_terrain_lawns = total_lawns * rough_terrain_percentage / 100 smooth_terrain_lawns = total_lawns - rough_terrain_lawns time_per_lawn = 2 total_time = (smooth_terrain_lawns + rough_terrai...
A pizza costs $8.50 per slice. If Jane had $51, how many slices of pizza can she buy?
def solve() -> int: num_slices = 51/8.50 result = num_slices return result
A flight is 3.5 hours long. If the plane travels at an average speed of 500 miles per hour, how far will the plane travel in that time?
def solve() -> int: flight_time = 3.5 avg_speed = 500 distance_traveled = flight_time * avg_speed result = distance_traveled return result
If a car travels 70km/hour for 5 hours, how many kilometers did it travel in total?
def solve() -> int: distance = 70 * 5 result = distance return result
Max purchased a shirt for $30 and a pair of shoes for $70. His friend gave him a $15 discount on the costs. How much does Max owe?
def solve() -> int: shirt = 30 shoes = 70 discount = 15 total_cost = shirt + shoes cost_with_discount = total_cost - discount result = cost_with_discount return result
Three numbers are in the ratio of 3:6:7 and their sum is 640. What is the smallest number?
def solve() -> int: x = 40 smallest_number = 3 * x result = smallest_number return result
Jennie made 10 dozen cookies and packaged each dozen into 4 separate plastic bags. How many cookies are there in each bag?
def solve() -> int: numDozen = 10 numBags = 4 totalCookies = numDozen * 12 cookiesPerBag = totalCookies // numBags remainingCookies = totalCookies % numBags result = cookiesPerBag return result
John can paint a room in 6 hours but his assistant can do it in 4 hours. How long will it take them to paint the room together?
def solve() -> int: rate_john = 1/6 rate_assistant = 1/4 time_taken = 1/(rate_john + rate_assistant) result = int(time_taken * 60) return result
Ella and Owen played a game of bowling. Each game has 10 frames and each frame has a maximum score of 10. Ella scored 7 points in each of the first 5 frames and 8 points in each of the last 5 frames. Owen scored 6 points in each of the first 4 frames, 9 points in each of the next 4 frames, and 10 points in each of the ...
def solve() -> int: ella_first_5 = 7 ella_last_5 = 8 owen_first_4 = 6 owen_next_4 = 9 owen_last_2 = 10 ella_total = (ella_first_5 + ella_last_5) * 5 owen_total = (owen_first_4 + owen_next_4 + owen_last_2) * 2 difference = owen_total - ella_total result = differ...
Rachel is buying presents for her friends. She has $200 to spend. She wants to spend twice as much on her best friend as on her other friends. If she has 5 friends, how much money does she spend on each friend?
def solve() -> int: best_friend_ratio = 2 other_friends_ratio = 1 total_ratio = (best_friend_ratio * 1) + (other_friends_ratio * 4) best_friend_money = (best_friend_ratio / total_ratio) * 200 other_friends_money = (other_friends_ratio / total_ratio) * 200 money_per_friend = (best_friend_money + ...
If a car travels at a constant speed of 50mph, how many miles will it travel in 3 hours?
def solve() -> int: speed = 50 time = 3 distance = speed * time result = distance return result
Mike has 2 bags with 32 apples each. He wants to give 4 apples to each of his 13 friends. How many apples will Mike have left?
def solve() -> int: apples_per_bag = 32 number_of_bags = 2 total_apples = apples_per_bag * number_of_bags number_of_friends = 13 apples_given_out = number_of_friends * 4 apples_left = total_apples - apples_given_out result = apples_left return result
John runs 3 miles every day for a week. On the 8th day, he ran 6 miles. How many miles has John run in total?
def solve() -> int: distance_run_per_day = 3 days_ran_for_week = 7 extra_miles_on_8th_day = 6 total_miles = (distance_run_per_day * days_ran_for_week) + extra_miles_on_8th_day result = total_miles return result
ome possible new questions and python programs are: Kevin likes to collect stamps. He has 48 stamps in his album. On Monday, he bought 12 more stamps from a shop. On Tuesday, he traded some of his stamps with his friend and gave away one-fourth of his total stamps. On Wednesday, he found 6 more stamps in his attic. On ...
def solve() -> int: stamps = 48 stamps = stamps + 12 stamps = stamps - stamps / 4 stamps = stamps + 6 stamps = stamps - 8 result = stamps return result
Sarah had already cooked 5 burgers when her friend Jack took over and started cooking at a rate of 2 burgers every 3 minutes. When Jack stopped, they had cooked a total of 17 burgers. For how many minutes did Jack cook?
def solve() -> int: sarah_burgers = 5 total_burgers = 17 jack_burgers = total_burgers - sarah_burgers jack_rate = 2/3 jack_time = jack_burgers / jack_rate result = jack_time return result
Student: Normally Sarah can swim 100 meters in 2 minutes. However, the pool is crowded today and she swims 100 meters in 3.5 minutes. If Sarah needs to swim a total of 2 kilometers, how much longer would it take her to swim it all?
def solve() -> int: distance = 2000 normal_speed = 100 / 2 crowded_speed = 100 / 3.5 time_normal = distance / normal_speed time_crowded = distance / crowded_speed time_difference = time_crowded - time_normal total_time = time_crowded result = total_time return result
John has $560 in his bank account. He withdrew $50 each day for 9 days. What is the current balance in his account?
def solve() -> int: balance = 560 withdrawal = 50 days = 9 current_balance = balance - (withdrawal * days) result = current_balance return result
5. Daniella has a collection of 747 helmets. 70 of them cost her $6 each, and the rest each cost her 50% of the initial cost. How much did Daniella spend on the helmets in her collection?
def solve() -> int: helmets = 747 oldPrice = 6 fraction = 0.5 totalCost = oldPrice * 70 + ((helmets - 70) * fraction * oldPrice) result = totalCost return result
Ryan has twice as many marbles as Ashley. If Ashley has 15 marbles, how many marbles does Ryan have?
def solve() -> int: ashley_marbles = 15 ryan_marbles = 2 * ashley_marbles result = ryan_marbles return result
She spent $18 on a notebook and a pen. She then bought four books, each costing the same amount. She had $24 left after buying the books. How much did each book cost, in dollars?
def solve() -> int: remaining = 120 - 18 cost = remaining / 4 result = cost return result
Lily is on vacation with her family and her aunt. They all checked into a hotel with 6 rooms and decided to split the cost. If the total cost for the 6 rooms is $600, how much should each person pay?
def solve() -> int: total_cost = 600 num_people = 4 cost_per_person = total_cost / num_people result = cost_per_person return result
A company needs to hire 100 employees. They have received 1200 applications, of which 30% are men and the rest are women. If 40% of the men are accepted and 60% of the women are accepted, how many men and women will be hired?
def solve() -> int: total_applications = 1200 total_hires = 100 men_percent = 0.3 women_percent = 1 - men_percent men_accepted_percent = 0.4 women_accepted_percent = 0.6 total_men = men_percent * total_applications men_accepted = total_hires * men_accepted_percent women_accepted = to...
Mary has 20 apples. She wants to make apple pies that require 4 apples each. How many apple pies can she make and how many apples will she have left over?
def solve() -> int: num_pies = 20 // 4 num_left = 20 % 4 result = (num_pies, num_left) return result
Student: On Monday, Brad started painting his room at 9am and finished at 1:30pm. On Tuesday, he started at 1pm and finished at 5:15pm. On Wednesday, he started at 10am and finished at 3pm. What's the total time for which Brad painted?
def solve() -> int: start_monday = 9 end_monday = 13.5 start_tuesday = 13 end_tuesday = 17.25 start_wednesday = 10 end_wednesday = 15 total_time = end_monday - start_monday + end_tuesday - start_tuesday + end_wednesday - start_wednesday result = total_time return result
A retail store sells chairs and tables. A chair costs $25, and a table costs $50. If the store earns a total of $3750 by selling 100 chairs and tables, how many tables did it sell?
def solve() -> int: chairs_sold = 100 table_cost = 50 chair_cost = 25 total_revenue = 3750 total_tables_sold = (total_revenue - (chairs_sold * chair_cost)) / table_cost result = total_tables_sold return result
John's lemonade stand has an automatic lemonade dispenser. For every 4 cups of lemonade dispensed, he has to pay 1 dollar for dispensing fees. How much would he have to pay for dispensing 12 cups of lemonade?
def solve() -> int: cups_dispensed = 12 dispensing_fee_per_group = 1 number_of_groups = cups_dispensed // 4 dispensing_fee_total = number_of_groups * dispensing_fee_per_group result = dispensing_fee_total return result
Tracy planted 8 plants last month. This month, she planted twice as many plants than last month. How many plants did Tracy plant this month?
def solve() -> int: number_last_month = 8 number_this_month = 2 * number_last_month result = number_this_month return result
Jake sells 50 t-shirts for $10 each. He spends $200 on blank t-shirts and screen printing. What is his profit?
def solve() -> int: num_tshirts = 50 price_tshirt = 10 costs = 200 revenue = num_tshirts * price_tshirt profit = revenue - costs result = profit return result
A pizza cafe sells slices of pizza for $3.50 each with a $1.50 delivery fee. If Mark ordered 4 slices of pizza, what was his total cost including delivery fee?
def solve() -> int: total_cost = 4 * 3.5 + 1.5 result = total_cost return result
Oliver ordered 9 pizzas. He shared the pizzas with his family and each of them ate 2 slices of pizza. How many slices of pizza were left?
def solve() -> int: num_pizzas = 9 slices_per_pizza = 8 slices_per_person = 2 total_slices = num_pizzas * slices_per_pizza slices_eaten = slices_per_person * num_pizzas result = total_slices - slices_eaten return result
Emma's pet dog's birthday is next week. The dog will be half as old as Emma was when she adopted it. On the dog's birthday, Emma gives it $3 for every month old it is. How much money will Emma give it?
def solve() -> int: dog_age = 0 emma_age = 0 dog_age += 1 emma_age = dog_age * 2 money_given = dog_age * 3 result = money_given return result
A farmer has 100 chickens. If the farmer sells 25% of them and then buys 20 more, how many chickens does he have now?
def solve() -> int: chickens = 100 sold_percent = 25 sold_chickens = chickens * (sold_percent / 100) chickens -= sold_chickens new_chickens = chickens + 20 result = new_chickens return result
A car travels at a speed of 60 miles per hour. If the car drives for 4 hours, how far does it travel?
def solve() -> int: distance_traveled = 60*4 result = distance_traveled return result
David had 3 boxes of chocolates. Each box contains 36 chocolates. His friends came to visit him and he gave them 1/5 of the chocolates. How many chocolates did David give away?
def solve() -> int: total_boxes = 3 total_chocolates = total_boxes * 36 fraction_given_away = 1/5 result = total_chocolates * fraction_given_away return result
A pizza has a diameter of 16 inches. What is its circumference?
def solve() -> int: radius = 16 / 2 circumference = 2 * 3.14 * radius result = circumference return result
A marathon is 42.195 km long. If an athlete runs at a pace of 6 minutes per kilometer, how long will it take to finish the marathon?
def solve() -> int: distance = 42195 pace = 6 * 60 time = pace * distance / 1000 result = time return result
A video streaming service charges $9.99 per month for unlimited access to their library of films. If a customer watches an average of 10 movies per month priced at $4.99 per movie, how much money will they save by subscribing to the streaming service?
def solve() -> int: streaming_service_cost = 9.99 movie_price = 4.99 movies_watched = 10 total_movie_cost = movies_watched * movie_price total_cost = total_movie_cost - streaming_service_cost result = total_cost return result
A train travels 240 miles in 4 hours at a constant speed. What is its speed in miles per hour?
def solve() -> int: distance = 240 time = 4 speed = distance / time result = speed return result
You go to a fruit stand and buy 3 pounds of apples for 5 dollars and 2 pounds of oranges for 3 dollars. How much did you pay per pound for the fruit?
def solve() -> int: apples_pounds = 3 apples_cost = 5 oranges_pounds = 2 oranges_cost = 3 total_pounds = apples_pounds + oranges_pounds total_cost = apples_cost + oranges_cost cost_per_pound = total_cost / total_pounds result = cost_per_pound return result
Andrew brings his files to be organized. He leaves 25 papers and three times as many folders as papers in the shelf. When he returns he finds 46 folders and one-third the number of papers. How many items are missing?
def solve() -> int: papers = 25 folders = 3 * papers total_items = papers + folders folders_returned = 46 papers_returned = papers / 3 total_returned = folders_returned + papers_returned missing_items = total_items - total_returned result = missing_items return re...
ppose I have 5 third of squares and 4 fourth of squares, what is the total number of squares?
def solve() -> int: thirds = 5 fourths = 4 result = thirds + (fourths * 4) return result
Fran bought a book and a mystery box for a combined total of $25. The book costs $15 and the mystery box costs $10. How much money did he spend on the book?
def solve() -> int: total = 25 price_box = 10 result = total - price_box return result
Frank saved $70 from his allowance. He wants to buy a skateboard that costs $45 and a helmet that costs $20. How much money will he have left?
def solve() -> int: savings = 70 skateboard = 45 helmet = 20 total_cost = skateboard + helmet remaining = savings - total_cost result = remaining return result
A pizza restaurant offers 5 sizes of pizzas - small, medium, large, extra-large and family. The prices of the pizzas are 10, 15, 20, 25 and 30 dollars respectively. On a particular day, the restaurant sold 15 small pizzas, 8 medium pizzas, 5 large pizzas, 3 extra-large pizzas and 1 family pizza. What was the total reve...
def solve() -> int: small_price = 10 medium_price = 15 large_price = 20 extra_large_price = 25 family_price = 30 small_sold = 15 medium_sold = 8 large_sold = 5 extra_large_sold = 3 family_sold = 1 total_revenue = small_price * small_sold + medium_price * medium_sold + large_p...
Student: Tom wants to buy 5 notebooks for school. At the store, the notebooks come in packs of 4. If each pack is $2.50, how much money will Tom need to buy all the notebooks?
def solve() -> int: notebooks = 5 pack_size = 4 pack_price = 2.50 packs_needed = notebooks // pack_size + (notebooks % pack_size > 0) total_price = packs_needed * pack_price result = total_price return result
A farmer has 32 cows and half as many horses. If each cow produces 15 liters of milk per day and each horse consumes 10 liters of water per day, how many more liters of milk does the farmer have than liters of water consumed by the horses per day?
def solve() -> int: horses = 32 / 2 milk = 32 * 15 water = horses * 10 difference = milk - water result = difference return result
A textbook is 2 inches thick. If 500 pages fit in one inch, how many pages are in the textbook to the nearest 100?
def solve() -> int: thickness = 2 pages_per_inch = 500 total_pages = thickness * pages_per_inch result = round(total_pages, -2) return result
Student: Sue is creating a garden with 2 4 ft long by 7 ft wide garden beds and 5 3 ft long by 5 ft wide garden beds. How many sq ft of growing space will her garden have?
def solve() -> int: bed1_length = 4 bed1_width = 7 bed2_length = 4 bed2_width = 7 bed3_length = 3 bed3_width = 5 bed4_length = 3 bed4_width = 5 bed5_length = 3 bed5_width = 5 bed1_area = bed1_length * bed1_width bed2_area = bed2_length * bed2_width bed3_area = bed3_le...
Student: Jake makes bookmarks to sell. Each bookmark takes 1 sheet of paper. Each sheet of paper costs $0.10. Jake also needs 1 pair of scissors, 1 glue stick and 1 pack of stickers for every 10 bookmarks. Each pair of scissors costs $3, each glue stick costs $1 and each pack of stickers costs $2. How much money will J...
def solve() -> int: paper_cost = 0.10 * 100 scissors_cost = 3 * 10 glue_stick_cost = 1 * 10 stickers_cost = 2 * 10 total_cost = paper_cost + scissors_cost + glue_stick_cost + stickers_cost total_gain = 100 * 1 total_profit = total_gain - total_cost result = total_profit return ...
A local grocery store offers a "Create Your Own Pizza" deal. A basic pizza costs $8.00, any kind of cheese is $2.00 extra, each meat topping costs $2.50 and vegetables cost $1.50 per topping. If Aiden orders a pizza with pepperoni, mushrooms, onions and two types of cheese, how much will his pizza cost?
def solve() -> int: basic_pizza_cost = 8.00 cheese_cost = 2.00 meat_topping_cost = 2.50 vegetable_topping_cost = 1.50 number_of_cheeses = 2 number_of_meat_toppings = 1 number_of_vegetable_toppings = 3 total_cost = basic_pizza_cost + (cheese_cost * number_of_cheeses) + (meat_top...
If a man can mow a lawn in 2 hours, how long will it take 3 men to mow the same lawn?
def solve() -> int: man_mow_time = 2 num_men = 3 total_mow_time = man_mow_time / num_men result = total_mow_time return result
Alex walked from home to the grocery store and back for a total of 15 kilometers. His walking speed is 5 kilometers per hour. How many more hours did he walk?
def solve() -> int: walking_speed = 5 total_distance = 15 time_to_store = total_distance / walking_speed time_back_home = time_to_store total_time = time_to_store + time_back_home additional_time = total_time - (total_distance / walking_speed) result = additional_tim...
A factory produces 1000 units of product A and 500 units of product B each day. If the production rate for product A increases by 10% and the production rate for product B decreases by 20%, what is the new total daily production rate?
def solve() -> int: product_A_daily_production = 1000 product_B_daily_production = 500 product_A_increase_percentage = 10 product_B_decrease_percentage = 20 product_A_new_production = product_A_daily_production * (100 + product_A_increase_percentage) / 100 product_B_new_production = product_B_da...
The ages of three friends are in the ratio of 2:3:4. If the sum of their ages is 54, how old is the youngest friend?
def solve() -> int: total_age = 54 ratio_of_ages = 2 + 3 + 4 age_of_youngest = (2/ ratio_of_ages) * total_age result = age_of_youngest return result
A basketball court is 84 feet long and 50 feet wide. What is the perimeter of the court in feet?
def solve() -> int: length = 84 width = 50 perimeter = 2 * (length + width) result = perimeter return result
Student: If a car travels 50 kilometers per hour and drives for 2 and a half hours, how many kilometers does it travel in total?
def solve() -> int: speed = 50 time = 2.5 distance = 0 distance = speed * time result = distance return result
A store owner makes a 20% profit by selling an item for $120. What did it cost the store owner to purchase the item?
def solve() -> int: profit_percentage = 20 selling_price = 120 cost_price = selling_price / ( 1 + (profit_percentage/100)) result = cost_price return result
Adam hired 2 electricians to fix his house's wiring. They worked for 9 hours on the first day, 10 hours on the second day, and finished the job on the third day after working for 8 hours. If Adam paid each of them $25 per hour of work, calculate the total amount of money they received altogether? Sara picked up a bag o...
def solve() -> int: electrician1_hours = 9 electrician2_hours = 10 electrician3_hours = 8 hourly_rate = 25 total_hours = electrician1_hours + electrician2_hours + electrician3_hours total_pay = total_hours * hourly_rate result = total_pay pieces_left = 7 pieces_eaten =...
Tina has 9 pizzas, each has 8 slices. She gives 6 slices to each of her 5 friends. How many slices of pizza does Tina have left?
def solve() -> int: total_pizzas = 9 slices_each_pizza = 8 num_friends = 5 total_slices_for_friend = 6*num_friends total_slices = total_pizzas*slices_each_pizza tina_remaining_slices = total_slices - total_slices_for_friend result = tina_remaining_slices return result
A swimming pool has a depth of 8 feet. If 3 feet of water are drained from the pool, how deep is the pool now?
def solve() -> int: depth = 8 - 3 result = depth return result
Student: In a swimming pool, there are 24 swimmers. 19 swimmers complete their lap in 30 minutes, while 5 swimmers complete their lap in 20 minutes. How much time will it take to all the swimmers to finish the total of 150 laps?
def solve() -> int: swimmers_total = 24 swimmers_fast = 5 swimmers_slow = swimmers_total - swimmers_fast laps_total = 150 laps_fast = swimmers_fast * (60/20) laps_slow = swimmers_slow * (60/30) total_time = (laps_fast + laps_slow) / swimmers_total * laps_total result = total_time re...
The width of a rectangle is 7 meters less than the length. If the perimeter of the rectangle is 30 meters, what is the length of the rectangle?
def solve() -> int: length = 11 result = f'The length of the rectangle is {length} meters.' result = length return result
Sophia was 120 centimeters tall on her 10th birthday. If she grows 5 centimeters each year, how tall will she be on her 15th birthday?
def solve() -> int: height_on_10th_birthday = 120 growth_per_year = 5 years_passed = 15 - 10 height_on_15th_birthday = height_on_10th_birthday + (growth_per_year * years_passed) result = height_on_15th_birthday return result
A classroom of 30 students each bought a textbook for $20 with 300 pages each. How many pages did they collectively purchase?
def solve() -> int: students = 30 price_per_textbook = 20 pages_per_textbook = 300 total_pages_purchased = students * pages_per_textbook result = total_pages_purchased return result
Maria has 18 candy bars. She gives ¼ of them to her little brother. After that, she eats 3 bars and then gives half of what's left to her friend. How many candy bars does Maria have left?
def solve() -> int: maria_candy = 18 brother_candy = maria_candy/4 maria_candy -= brother_candy maria_candy -= 3 friend_candy = maria_candy/2 maria_candy -= friend_candy result = maria_candy return result
The Turner family went on a family vacation. They spent a total of $3000. How much money each member needs to pay if the family consists of 4 members?
def solve() -> int: num = 3000 member = 4 pay_per_member = num / member result = pay_per_member return result
John and Jane ate at a restaurant. John's meal cost $19. Jane's meal cost $27. After adding an 18% tip to the total, how much did they pay for dinner?
def solve() -> int: meal_price_john = 19 meal_price_jane = 27 total_before_tip = meal_price_john + meal_price_jane tip_percentage = 18/100 tip = tip_percentage * total_before_tip total_after_tip = total_before_tip + tip result = total_after_tip return result
Possible questions and programs are: Rita is making a batch of cookies for her friends. She needs 3 eggs for every 12 cookies she makes. She also needs 2 cups of flour for every 18 cookies she makes. How many eggs and cups of flour does she need to make 72 cookies?
def solve() -> int: eggs = (72 / 12) * 3 flour = (72 / 18) * 2 result = eggs + flour return result
Joan and Sarah decided to split the cost of a new bike that costs $200. Joan paid $60 more than Sarah. How much did each person pay?
def solve() -> int: total_cost = 200 joan_extra = 60 sarah_share = (total_cost - joan_extra) / 2 joan_share = sarah_share + joan_extra result = (sarah_share, joan_share) return result
Emma is a tutor, she charges $12 per hour for math and $20 per hour for science. If she tutored 5 hours of math last Monday, 3 hours of science last Tuesday and 7 hours of math and science combined last Wednesday, how much does she earn in total?
def solve() -> int: math_hours = 5 science_hours = 3 combined_hours = 7 math_earnings = math_hours * 12 science_earnings = science_hours * 20 combined_earnings = (math_hours + science_hours) * 20 total_earnings = math_earnings + science_earnings + combined_earnings result ...
A car can drive 60 miles on one gallon of gasoline. What is the most miles the car can drive on 8 gallons of gas?
def solve() -> int: distance = 8 * 60 result = distance return result
Laura's gift shop ordered 356 gift baskets for a special sale. They sold 156 baskets and have 89 baskets left in the storage room. How many baskets did they have before the sale?
def solve() -> int: total_baskets_ordered = 356 baskets_sold = 156 baskets_left = 89 baskets_before_sale = total_baskets_ordered - baskets_sold - baskets_left result = baskets_before_sale return result
Alex is a teacher and he gives his students three types of assignments. The first type takes three times as long as the second type, while the third type takes five times as long as the second. If the third type takes 40 minutes to complete, how long would it take the students to complete all the assignments?
def solve() -> int: second_type = 1 first_type = 3 * second_type third_type = 5 * second_type total_time = first_type + second_type + third_type time_to_complete_all = total_time * 40 result = time_to_complete_all return result
Jack collected 12 buckets of berries from his family's farm. His mother took 8 buckets, and his father took 6 buckets. How many buckets does Jack have left?
def solve() -> int: buckets_total = 12 buckets_mother = 8 buckets_father = 6 buckets_jack = buckets_total - (buckets_mother + buckets_father) result = buckets_jack return result
A school fundraising committee is planning to sell tickets for a raffle. They want to sell a total of 1200 tickets. If each ticket costs $5, what is the total amount of money the committee will raise?
def solve() -> int: num_tickets = 1200 ticket_cost = 5 total_raised = num_tickets * ticket_cost result = total_raised return result
Kyle purchased a square above-ground pool with sides that each measure 12 feet in length. He would like to fill the pool with water and has 4 hoses that can each fill it with 3 gallons of water per minute. How many hours will it take Kyle to completely fill the pool with 16,000 gallons of water?
def solve() -> int: gallons = 16000/4 minutes = gallons/3 hours = minutes/60 result = hours return result
Student: Lily wants to buy a new camera that costs $250. She has $100 in her savings account and $50 in her birthday card. She can earn $12 per hour by walking dogs. She also gets $5 for every 3 dogs she walks as a tip. How many dogs does she need to walk to buy the camera?
def solve() -> int: camera_cost = 250 savings_account = 100 birthday_card = 50 hourly_wage = 12 tip_per_3_dogs = 5 total_money = savings_account + birthday_card num_dogs = (camera_cost - total_money) // (hourly_wage + (tip_per_3_dogs // 3)) total_earning = num_dogs * (hourly_wage + (tip_...
If a car travels at a constant speed of 60 miles per hour, how long will it take the car to travel a distance of 240 miles, in hours?
def solve() -> int: distance = 240 speed = 60 time = distance / speed result = round(time, 2) return result
Emily has 10 more books than David and Steve has twice as many books as David. If David has 7 books, how many books do the three of them have combined?
def solve() -> int: num_books_david = 7 num_books_emily = num_books_david + 10 num_books_steve = num_books_david * 2 total_books = num_books_david + num_books_emily + num_books_steve result = total_books return result
A store is having a sale where everything is 20% off. If a shirt originally costs $25, what is the sale price?
def solve() -> int: original_price = 25 discount = 0.2 discount_amount = original_price * discount sale_price = original_price - discount_amount result = sale_price return result
Pamela has 19 marbles, and each marble is either red, blue or green. If the total amount of red marbles is twice as much as the total amount of blue and green marbles combined, how many red marbles does Pamela have?
def solve() -> int: blue_green_marbles = 19 - 2 * (19 // 2) red_marbles = blue_green_marbles * 2 result = red_marbles return result
Student: Dany has a total of 10 animals in his farm. If he has 2 cows and the rest are sheep, how many bushels should he have to suffice the animals for a day if every animal eats 1 bushel?
def solve() -> int: total_animals = 10 cows = 2 sheep = total_animals - cows bushels = total_animals result = bushels return result
John has twice as many cats as Michael who has 3 less cats than Amanda. If Amanda has 10 cats, how many cats does John have?
def solve() -> int: cats_amanda = 10 cats_michael = cats_amanda - 3 cats_john = cats_michael * 2 result = cats_john return result
A rectangular room is 12 feet wide by 15 feet long. The floor needs to be covered with tiles which are 1 square foot each. How many tiles are needed?
def solve() -> int: room_width = 12 room_length = 15 tile_area = 1 total_tiles = room_width * room_length / tile_area result = total_tiles return result
Amy and Bob are playing a game with dice. They each roll a fair six-sided die and add up their scores. If Amy's score is more than Bob's, she wins 2 points. If Bob's score is more than Amy's, he wins 3 points. If their scores are equal, they both win 1 point. They play the game 10 times. What is the probability that Am...
def solve() -> int: from scipy.stats import binom result = 1 - binom.cdf(5, 10, 0.4166666666666667) return result
John bought a pair of shoes for 30 dollars. He then spent 5 dollars for socks. What percentage of his total spending is the socks?
def solve() -> int: shoes = 30 socks = 5 total = shoes + socks percentage = (socks/total) * 100 result = percentage return result
There are 20 students in the class. Each student brought 1/2 dozen muffins to the class party. How many muffins did all the students bring together?
def solve() -> int: students = 20 muffins = 1/2 * 12 result = students * muffins return result
``` A bag contains 8 red balls and 6 blue balls. What is the probability of picking a red ball randomly from the bag?
def solve() -> int: num_red_balls = 8 num_blue_balls = 6 total_balls = num_red_balls + num_blue_balls probability_red = num_red_balls / total_balls result = probability_red return result
A grocery store has a sale on apples. A bag of 10 apples normally costs $6, but this week it is on sale for 20% off. How much does the sale price of the bag of apples cost?
def solve() -> int: regular_price = 6 discount = 20/100 sale_price = regular_price - (regular_price * discount) result = sale_price return result
Student: George and his friends are building a treehouse. The treehouse is 10.5 feet wide, 7 feet long, and 2.5 feet tall. How much wood do they need to build it in square feet?
def solve() -> int: width = 10.5 length = 7 height = 2.5 area = width * length result = area * height return result
A rectangular garden has a length of 20 meters and a width of 15 meters. Ben wants to plant flowers along the perimeter of the garden. He needs one flower for every meter of the perimeter. How many flowers does he need in total?
def solve() -> int: length = 20 width = 15 perimeter = 2 * (length + width) flowers = perimeter result = flowers return result
A restaurant sells 25 pizzas at $12 each, 50 burgers at $8 each, and 30 salads at $6 each. If the restaurant offers a 20% discount on the total cost, how much does the customer have to pay in all?
def solve() -> int: pizza_price = 12 num_pizzas = 25 burger_price = 8 num_burgers = 50 salad_price = 6 num_salads = 30 discount = 0.2 total_cost = (pizza_price * num_pizzas) + (burger_price * num_burgers) + (salad_price * num_salads) discount_amt = total_cost * discount final_cos...
A calculator has a 3% sales tax. If the original price of the calculator is $100, calculate the total amount that the customer pays.
def solve() -> int: original_price = 100 sales_tax_rate = 0.03 sales_tax = original_price * sales_tax_rate total_price = original_price + sales_tax result = total_price return result
At a restaurant, a meal costs $25 and each desert costs $8. With taxes, the total bill was $61. How many deserts did the customer order?
def solve() -> int: num_deserts = 0 bill_total = 0 while bill_total < 61: num_deserts = num_deserts + 1 bill_total = 25 + 8*num_deserts + 0.05*(25 + 8*num_deserts) result = num_deserts return result