question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Jane gets a monthly salary of $800 and spends $20 every month for subscription. How many months will it take for Jane to save $10,000?
def solve() -> int: savings_goal = 10000 monthly_salary = 800 subscription = 20 savings_per_month = monthly_salary - subscription num_of_months = savings_goal // savings_per_month result = num_of_months return result
Leah has 20 more yellow balloons in her room than pink balloons. She pops half of the yellow balloons and 1/4 of the pink balloons. If she initially had 80 pink balloons, how many balloons are left in her room altogether?
def solve() -> int: p = 80 y = p + 20 y = y - y/2 p = p - p/4 result = y + p return result
``` A tank is filled with 500 liters of water. If 20% of the water is poured out, how many liters are left?
def solve() -> int: result = 500*0.8 return result
Student: There are 320 candies. They are to be split among 8 kids, but each kid should get 5 less than the previous one. How many candies will the last kid receive?
def solve() -> int: candies = 320 num_kids = 8 difference = 5 last_kid_candies = candies - (num_kids - 1) * difference result = last_kid_candies return result
Grace and Jack went to a bookstore. Grace bought six fiction books, Jack bought four non-fiction books, and they both bought two poetry books. If a fiction book costs $10, a non-fiction book costs $12, and a poetry book costs $7, how much money did they spend?
def solve() -> int: fiction_books = 6 non_fiction_books = 4 poetry_books = 2 fiction_book_cost = 10 non_fiction_book_cost = 12 poetry_book_cost = 7 total_cost = (fiction_books * fiction_book_cost) + (non_fiction_books * non_fiction_book_cost) + (poetry_books * poetry_book_cost) ...
Aliya is baking cupcakes for a fundraiser. She has 3 boxes of cake mix and each box can make 24 cupcakes. She also has 2 cans of frosting and each can can frost 18 cupcakes. How many cupcakes can Aliya bake and frost with her supplies?
def solve() -> int: boxes = 3 cupcakes_per_box = 24 cans = 2 cupcakes_per_can = 18 cupcakes_baked = boxes * cupcakes_per_box cupcakes_frosted = cans * cupcakes_per_can cupcakes = min(cupcakes_baked, cupcakes_frosted) result = cupcakes return result
Student: Addison has driven 580 miles and used 30 gallons of gasoline. At this rate, how many miles would she drive using 18 gallons of gasoline?
def solve() -> int: miles_driven = 580 gallons_used = 30 gallons_needed = 18 miles_per_gallon = miles_driven / gallons_used miles_driven_with_18_gallons = miles_per_gallon * gallons_needed result = miles_driven_with_18_gallons return result
To cheer up their friend David, who just went through a tough time, Mark and Paul decided to treat him. Mark bought him a watch worth $800, while Paul presented him with a travel voucher worth double the price of the watch. If their friend Roger also gifted him something worth eight times the value of the watch, what w...
def solve() -> int: watch_price = 800 paul_voucher = watch_price * 2 roger_gift = watch_price * 8 total_value = watch_price + paul_voucher + roger_gift result = total_value return result
A square-shaped room has a perimeter of 48 feet. What is the length of one side of the room?
def solve() -> int: perimeter = 48 side = perimeter / 4 result = side return result
The perimeter of a square is 20 cm. What is the length of one of its sides?
def solve() -> int: perimeter_square = 20 side_length = perimeter_square/4 result = side_length return result
The farm has 80 goats where 3/4 are billies and the rest are nanny goats. Only one-third of the nanny goats can give birth. How many goats does the farm have that cannot give birth?
def solve() -> int: billies = 80 * 3/4 nanny_goats = 80 - billies nanny_goats_giving_birth = nanny_goats * 1/3 goats_cannot_give_birth = nanny_goats - nanny_goats_giving_birth result = goats_cannot_give_birth return result
ome possible questions and python programs are: Amanda has a recipe that calls for 8 cups of flour, 6 cups of sugar, and 4 cups of butter. She decides to halve the amount of flour and sugar, but keep the butter the same. Then, she adds 2 cups of chocolate chips and 1 cup of nuts. How many cups of ingredients does she h...
def solve() -> int: flour = 8 sugar = 6 butter = 4 flour = flour / 2 sugar = sugar / 2 chocolate = 2 nuts = 1 total = flour + sugar + butter + chocolate + nuts result = total return result
A bookshelf can hold 55 books. There are already 33 books on the shelf. If 12 more books are added, what percent of the shelf will be filled?
def solve() -> int: max_books = 55 current_books = 33 added_books = 12 total_books = current_books + added_books filled_percent = (total_books / max_books) * 100 result = filled_percent return result
Kaitlyn has 6 purple marbles and 9 blue marbles. If Lily has 1 less than five times as many marbles as Kaitlyn, how many marbles does Lily have?
def solve() -> int: kaitlyn_purple_marbles = 6 kaitlyn_blue_marbles = 9 lily_marbles = 5 * (kaitlyn_purple_marbles + kaitlyn_blue_marbles) - 1 result = lily_marbles return result
A cyclist starts cycling from point A to point B, and a car starts at the same time from point B to point A. The distance between A and B is 150 miles. If the cyclist travels at the speed of 10 miles per hour and the car travels at the speed of 50 miles per hour, at what time will they meet?
def solve() -> int: total_distance = 150 time_to_meet = total_distance / (10 + 50) result = time_to_meet return result
Student: Sydney is making chocolate bars. She needs 3/4 cups of cocoa powder for every 5 bars she makes. If she wants to make 35 bars, how much cocoa powder does she need?
def solve() -> int: bars = 35 cocoa_per_bar = 3/4 cocoa_needed = bars * cocoa_per_bar result = cocoa_needed return result
ve bought 4 DVDs at 20% off and 5 books at 50% off. If the DVDs cost $8 each and the books cost $14 each, how much did he pay in total?
def solve() -> int: price_dvds = 4 * 8 discounted_books = 0.5 * 5 * 14 result = price_dvds + discounted_books return result
A company had 8 employees last year and has 12 employees this year. What is the percent increase in the number of employees?
def solve() -> int: percent_increase = ((12-8)/8) * 100 result = percent_increase return result
The area of a square is 81 square inches. What is the length of each side?
def solve() -> int: area = 81 side_length = area ** 0.5 result = side_length return result
At the gym, the trainer does 3 sets of 15 reps on the bench press. If he adds 10 kg to the weight each set, and the weight he started with was 50 kg, what is the total weight lifted in one workout?
def solve() -> int: sets = 3 reps = 15 start_weight = 50 increment_weight = 10 total_reps = sets * reps total_weight = ((start_weight + (start_weight + ((sets-1)*increment_weight))) / 2) * total_reps result = total_weight return result
A grocery store is having a sale of 20% off on all items. If an item originally costs $50, what is the sale price of the item?
def solve() -> int: original_price = 50 discount = 0.2 sale_price = original_price - (original_price * discount) result = sale_price return result
Emily is trying to reduce her smoking habit by cutting down on the number of cigarettes she smokes per day. She currently smokes 20 cigarettes per day. If she reduces the number of cigarettes she smokes by 4 each day, how many days will it take her to only smoke 8 cigarettes per day?
def solve() -> int: cigarettes_per_day = 20 reduction_per_day = 4 target_cigarettes_per_day = 8 days = (cigarettes_per_day - target_cigarettes_per_day) / reduction_per_day result = days return result
Alex has 160 crayons. He donates 15 crayons to a charity. The rest of the crayons are divided equally among 8 of his classmates. If Alex keeps 2 crayons from each classmate's share, how many crayons are in one share?
def solve() -> int: total_crayons = 160 donated_crayons = 15 remaining_crayons = total_crayons - donated_crayons num_classmates = 8 share_crayons = remaining_crayons // num_classmates alex_keeps = 2 one_share = share_crayons - alex_keeps result = one_sh...
arah entered a competition to win a toy. The competition asked entrants to solve 5 math questions in 15 minutes. If Sarah finished all the questions after 10 minutes, how many minutes did she have left for the competition?
def solve() -> int: time_allowed = 15 time_used = 10 time_remaining = time_allowed - time_used result = time_remaining return result
If a rectangular box has dimensions of 4 x 6 x 8, what is the volume of the box?
def solve() -> int: length = 4 width = 6 height = 8 volume = length*width*height result = volume return result
Jason spends 2 hours at the gym. He uses $0.75 for every 10 minutes. How much money did he spend, in dollars?
def solve() -> int: hours_at_gym = 2 minutes_at_gym = hours_at_gym * 60 cost_per_minute = 0.75 / 10 total_cost = minutes_at_gym * cost_per_minute result = total_cost return result
Amy has 3 apples, 4 oranges, and 2 pineapples. Bob has twice as many apples as Amy, half as many oranges as Amy, and 3 times as many pineapples as Amy. How many fruits does Bob have in total?
def solve() -> int: amy_apples = 3 amy_oranges = 4 amy_pineapples = 2 bob_apples = amy_apples * 2 bob_oranges = amy_oranges / 2 bob_pineapples = amy_pineapples * 3 bob_total_fruits = bob_apples + bob_oranges + bob_pineapples result = bob_total_fruits return result
One pizza requires half pound (0.5 lbs) of cheese and 1 cup of tomato sauce. If 1 pound of cheese costs $5 and 1 can of tomato sauce costs $2, how much will it cost to make 8 pizzas?
def solve() -> int: cheese_in_one_pizza = 0.5 cup_of_tomato_sauce_in_one_pizza = 1 cheese_cost_per_pound = 5 tomato_sauce_cost_per_can = 2 no_of_pizzas = 8 total_cheese_required = cheese_in_one_pizza * no_of_pizzas total_tomato_sauce_required = cup_of_tomato_sauce_in_one_pizza* no_of_pizzas ...
A zookeeper needs to buy 540 bananas. Banana supplier sells 25 bananas per crate. How many crates does the zookeeper need to order?
def solve() -> int: count = 540 // 25 result = count return result
It takes a group of scientists, the Lab Rats, 35 minutes to complete a chemistry experiment. On Wednesday, they completed one experiment. Then they received 4 more requests that day and 9 requests on Thursday. Calculate the total time, in minutes, the Lab Rats spent completing chemistry experiments over those two days.
def solve() -> int: experiment_time = 35 wednesday_experiments = 1 wednesday_time = wednesday_experiments * experiment_time thursday_experiments = 9 thursday_time = thursday_experiments * experiment_time total_time = wednesday_time + thursday_time result = total_time return result
A jewelry store sells necklaces for $100, earrings for $50, and bracelets for $80. If Sarah buys one necklace, two pairs of earrings, and one bracelet, how much did she spend in total?
def solve() -> int: necklace_cost = 100 earring_cost = 50 bracelet_cost = 80 num_necklaces = 1 num_earrings = 2 num_bracelets = 1 total_cost = (necklace_cost*num_necklaces)+(earring_cost*num_earrings)+(bracelet_cost*num_bracelets) result = total_cost return result
Student: A cake shop has 60 cupcakes that are to be divided equally to 5 boxes. If each box will have 12 cupcakes, how many cupcakes will be left?
def solve() -> int: cupcakes = 60 boxes = 5 box_capacity = 12 cupcakes_needed = boxes * box_capacity cupcakes_left = cupcakes - cupcakes_needed result = cupcakes_left return result
A class of 24 students collected 150 cans for a recycling drive. Each student had the same number of cans, except for one student who had 3 more cans than the others. How many cans did the student with the most cans have?
def solve() -> int: total_cans = 150 students = 24 cans_per_student = total_cans // students most_cans = cans_per_student + 3 result = most_cans return result
Rachel and Mark are both doing laundry at a laundromat. Rachel does a certain number of loads and Mark does that many loads minus 2. If they do a total of 12 loads, how many loads does Rachel do?
def solve() -> int: rachel_loads = 0 mark_loads = 0 rachel_loads = 12 mark_loads = rachel_loads - 2 result = rachel_loads return result
John has 20 candy bars. He eats 3 candy bars every day. How many candy bars will he have after 1 week (7 days)?
def solve() -> int: starting_bars = 20 bars_per_day = 3 days = 7 remaining_bars = starting_bars - (bars_per_day * days) result = remaining_bars return result
A cake costs $30 and can feed 10 people. How much would it cost to feed 25 people?
def solve() -> int: cost = 30 people = 10 cost_per_person = cost / people total_cost = cost_per_person * 25 result = total_cost return result
Eric has 128 pens and 5% of the pens do not work. He purchases an additional 90 pens. How many pens does he have now that work?
def solve() -> int: total_pens1 = 128 percent_not_working = 0.05 additional_pens = 90 not_working_pens = total_pens1 * percent_not_working working_pens1 = total_pens1 - not_working_pens total_working_pens = working_pens1 + additional_pens result = total_working_pens retu...
David purchased two new video games for $50 each and three new controllers for $20 each. He had to pay an 11% tax for the total cost of the items. How much money did he pay in total after tax?
def solve() -> int: vgame = 50 ctrl = 20 tax = 0.11 total_cost = (vgame * 2) + (ctrl * 3) final_cost = (1 + tax) * total_cost result = final_cost return result
A car traveled at a speed of 60 km/h for 3 hours. How far did the car travel?
def solve() -> int: speed = 60 time = 3 distance = speed * time result = distance return result
Student: John is making a fruit salad. He uses 3 apples, 2 bananas, and 1 pineapple. If apples cost $0.50 each, bananas cost $0.40 each, and pineapples cost $2.50 each, what is the total cost of the fruits?
def solve() -> int: apples = 3 bananas = 2 pineapples = 1 apple_price = 0.50 banana_price = 0.40 pineapple_price = 2.50 total_cost = apples * apple_price + bananas * banana_price + pineapples * pineapple_price result = total_cost return result
If Mark has 6 times as many pencils as Lou, and they have 70 pencils together, how many pencils does Mark have?
def solve() -> int: total_pencils = 70 Lou_pencils = total_pencils / (6 + 1) Mark_pencils = total_pencils - Lou_pencils result = Mark_pencils return result
A movie theater has a discounted ticket price of $8.00 for children and senior citizens on all weekdays, and for all customers for the first show of the day. If an adult goes for the later shows, the price of one ticket is $12.00. If a family of 4 adults and 2 children go to the later show, how much will they have to p...
def solve() -> int: number_of_adults_tickets = 4 number_of_children_tickets = 2 price_adult_ticket = 12 price_children_ticket = 8 total_price = (number_of_adults_tickets*price_adult_ticket) + (number_of_children_tickets*price_children_ticket) result = total_price return result
Alex works as a bus driver. On Monday, Wednesday, and Friday, he drives a bus with 30 passengers. On Tuesday, he drives a bus with 40 passengers, and on Thursday, he drives a bus with 35 passengers. If he is paid $3 per passenger, how much does Alex earn in a week?
def solve() -> int: passengers_mon_wed_fri = 30 passengers_tue = 40 passengers_thu = 35 passengers_week = (passengers_mon_wed_fri * 3) + (passengers_tue * 3) + (passengers_thu * 3) result = passengers_week * 7 return result
Sarah's swimming goal is to swim 500 meters. On Monday, Sarah was only able to swim 200 meters, so she decided that she would make up for the rest on Tuesday. However, she was only able to swim 250 meters on Tuesday. How many meters would Sarah have to swim on Wednesday to meet her minimum goal and make up for the ones...
def solve() -> int: monday_distance = 200 tuesday_distance = 250 goal_distance = 500 remaining_distance = goal_distance - (monday_distance + tuesday_distance) result = remaining_distance return result
arah manages a small bookstore. She earns $9 for each novel she sells, $2.50 per comic book and $15 for each large art book. She sold 25 novels, 12 comic books and 4 large art books today. How much money did Sarah make today?
def solve() -> int: Novels = 25 ComicBooks = 12 ArtBooks = 4 NovelPrice = 9 ComicBookPrice = 2.50 ArtBookPrice = 15 Totalprice = Novels * NovelPrice + ComicBooks * ComicBookPrice + ArtBooks * ArtBookPrice result = Totalprice return result
Tom has a 100-page book to read and wants to finish it in 5 days. If he already read 30 pages but took 6 ten-minute breaks during that time, how many pages does he have left to read each day in order to finish on time?
def solve() -> int: total_pages = 100 days = 5 pages_read = 30 breaks = 6 time_per_break = 10 pages_left = total_pages - pages_read days_left = days - (breaks * time_per_break) / 60 pages_per_day = pages_left / days_left result = pages_per_day return result
Rachel is practicing her piano recital. Normally, it takes her 1 hour to rehearse all the pieces, but today her sheet music fell and she had to pick it up for 5 minutes. Additionally, she got distracted by the phone ringing and it took her 2 minutes to refocus. If her recital is at 8:00 PM and it's currently 6:30 PM, h...
def solve() -> int: current_time = 6.5 rehearsal_time = 60 pick_up_time = 5 refocus_time = 2 recital_time = 20 total_time = current_time + rehearsal_time + pick_up_time + refocus_time late_time = total_time - recital_time result = late_time return result
If there are three apples in each of the seven baskets and four more apples are added to each basket, calculate the total number of apples?
def solve() -> int: basket_apples = 3 new_apples = 4 baskets = 7 total_apples = (basket_apples + new_apples) * baskets result = total_apples return result
If a rectangular prism has a volume of 1000 cubic meters and a height of 10 meters, what is the area of its base in square meters?
def solve() -> int: base_area = None volume = 1000 height = 10 result = base_area return result
David can create 8 pottery bowls an hour with clay and 10 pottery bowls an hour with porcelain. His art shop gets an order for 12 clay bowls and 16 porcelain bowls. If David gets paid $300 total for the order, how much does he make per hour?
def solve() -> int: clay_bowls_per_hour = 8 porcelain_bowls_per_hour = 10 clay_bowls_ordered = 12 porcelain_bowls_ordered = 16 total_payment = 300 total_bowls_per_hour = clay_bowls_per_hour + porcelain_bowls_per_hour total_bowls_ordered = clay_bowls_ordered + porcelain_bowls_ordered ...
ara has 32 books in her library. She gave 8 books to her friends. If she kept 24 books in the end, how many books did she give away?
def solve() -> int: num_books = 32 num_givenaway = 32 - 24 result = num_givenaway return result
Student: Lisa can make 5 bracelets in 2 hours, she joined a club that taught her some new techniques and it improved her bracelet making speed by 30 percent. How many bracelets can Lisa make in 8 hours?
def solve() -> int: bracelets = 5 hours = 2 speed = bracelets / hours improvement = 0.3 new_speed = speed * (1 + improvement) new_hours = 8 new_bracelets = new_speed * new_hours result = new_bracelets return result
Sophie is 45 years old and her husband James is 56. Their daughter, Lily was born when James was 41. What was Sophie's age when she gave birth to Lily?
def solve() -> int: sophie_age = 45 james_age = 56 james_age_when_lily_born = 41 sophie_age_when_lily_born = sophie_age - (james_age - james_age_when_lily_born) result = sophie_age_when_lily_born return result
Cindy has a coupon that gives her a 20% discount on any item in a store. She wants to buy a pair of shoes that is originally priced at $80 and a hat that is originally priced at $20. How much will she save by using the coupon?
def solve() -> int: total_before_discount = 80 + 20 discount_amount = 0.2 * total_before_discount total_after_discount = total_before_discount - discount_amount savings = total_before_discount - total_after_discount result = savings return result
A store is offering a 10% discount on total cost, with a condition that a minimum of 25 small, 20 medium, and 15 big apples should be bought. If they cost $1.5, $2, and $3, respectively, at full price, what will be the price after discount if 30 small, 25 medium, and 20 big apples are bought?
def solve() -> int: small_apple_cost = 1.5 medium_apple_cost = 2 big_apple_cost = 3 min_num_small_apples = 25 min_num_medium_apples = 20 min_num_big_apples = 15 discount_rate = 0.10 num_small_apples = 30 num_medium_apples = 25 num_big_apples = 20 if num_small_apples >= min_nu...
A 990-cm long rope is cut into 110 equal pieces, and then 10 more pieces of 60 cm each. What is the length of each of the equal-sized pieces in millimeters?
def solve() -> int: rope_length = 990 num_pieces = 110 extra_pieces = 10 total_pieces = num_pieces + extra_pieces total_length = rope_length + (extra_pieces * 60) piece_length = total_length / total_pieces piece_length_mm = piece_length * 10 result = piece_length_mm...
Jada bought a mix of pens and pencils for school. She bought 80 writing tools in total. Forty were pens. There were 3 more pencils than pens. Twice the number of pens were gel pens. There were ten more markers than pencils, and the rest were colored pencils. How many were colored pencils?
def solve() -> int: num_writing_tools = 80 num_pens = 40 num_pencils = num_pens + 3 num_gel_pens = num_pens * 2 num_markers = num_pencils + 10 num_colored_pencils = num_writing_tools - (num_pens + num_pencils + num_gel_pens + num_markers) result = num_colored_pencils return result
A train travels 120 miles in 2 hours and 30 minutes. What is its average speed in miles per hour?
def solve() -> int: distance = 120 time_in_hours = 2.5 average_speed = distance / time_in_hours result = average_speed return result
Bob traveled for 439 miles in total, and his car gets a gas mileage of 28 miles per gallon. How many gallons of gas did he use in total?
def solve() -> int: distance = 439 fuel_efficiency = 28 num_gallons = distance / fuel_efficiency result = num_gallons return result
Bob ran 3 miles in 25 minutes. If he wants to run 6 miles, how long will it take him assuming he maintains the same pace?
def solve() -> int: distance_per_minute = 3/25 distance_needed = 6 minutes_needed = distance_needed / distance_per_minute result = minutes_needed return result
Lily needs 10 pieces of wood to make a bench. Each piece costs $2. How much money did Lilly spend on the wood?
def solve() -> int: cost_wood = 10 * 2 result = cost_wood return result
Student: Adam bought 8 hats for a family reunion. If each hat cost $17 and he paid with a $120 bill, how much change did he get?
def solve() -> int: cost_per_hat = 17 number_of_hats = 8 amount_paid = 120 total_cost = cost_per_hat * number_of_hats change = amount_paid - total_cost result = change return result
Lily has 60 balloons. She gives 25% of her balloons to her little cousins. If she also gets 10 more balloons, how many balloons does she have left?
def solve() -> int: balloons = 60 cousins_share = 0.25 cousins_balloons = balloons * cousins_share remaining_balloons = balloons - cousins_balloons extra_balloons = 10 total_balloons = remaining_balloons + extra_balloons result = total_balloons return result
Student: Olivia has $105. She spends $25 on a watch. She then spends a third of the cost of the watch on a bracelet and a quarter of the cost on a necklace. How much money does she have left?
def solve() -> int: money = 105 watch = 25 bracelet = watch / 3 necklace = watch / 4 result = money - watch - bracelet - necklace return result
Student: A gym has 20 cardio machines and 10 weightlifting machines. If they add 6 more cardio machines and remove 3 weightlifting machines, what is the ratio of cardio machines to weightlifting machines?
def solve() -> int: cardio_machines = 20 weightlifting_machines = 10 cardio_machines += 6 weightlifting_machines -= 3 result = cardio_machines / weightlifting_machines return result
Anna went to the grocery store and bought 5 apples for $1 each and 3 bananas for $0.50 each. She paid with a $10 bill. How much change did she get?
def solve() -> int: num_apples = 5 apple_price = 1 num_bananas = 3 banana_price = 0.5 total_cost = (num_apples * apple_price) + (num_bananas * banana_price) amount_paid = 10 change = amount_paid - total_cost result = change return result
A rectangle has a length of 10 cm and a width of 5 cm. What is the area of the rectangle?
def solve() -> int: length = 10 width = 5 area = length * width result = area return result
``` Bill has 24 toy cars. He gives 6 toy cars each to his three nephews. How many toy cars does he have left?
def solve() -> int: toy_cars = 24 toy_cars -= 6 * 3 result = toy_cars return result
If Emily earns $25 an hour and works 6 hours a day, but 30% goes to taxes, how much will she take home after 25 days?
def solve() -> int: hourly_wage = 25 hours_per_day = 6 tax_rate = 0.3 days_worked = 25 gross_income = hourly_wage * hours_per_day * days_worked taxes = gross_income * tax_rate net_income = gross_income - taxes result = net_income return result
A company has a total of 2400 employees. If 20% of the employees work from home, 40% of the employees are in the office and the remaining employees work on-site, how many employees work on-site?
def solve() -> int: total_employees = 2400 home_employees = 0.2*total_employees office_employees = 0.4*total_employees worksite_employees = total_employees - home_employees - office_employees result = int(worksite_employees) return result
Sarah starts running a race at 8:00 AM and runs 12 miles in 2 hours at a pace of 6 miles per hour. At what time will Adam need to start the same race if he wants to beat Sarah by arriving just as she finishes the 12 miles, running at a pace of 7 miles per hour?
def solve() -> int: sarah_pace = 6 sarah_distance = 12 sarah_time = sarah_distance / sarah_pace adam_pace = 7 adam_time = sarah_time - (sarah_distance / adam_pace) adam_start_time = 8 + adam_time result = adam_start_time return result
In the first round of baking, Jessica baked a total of 20 cookies and Tom baked 5 more cookies than Jessica. In the second round, Jessica baked thrice as many cookies as Tom in the first round and Tom baked 2 less than Jessica. How many more cookies in total did Jessica bake than Tom?
def solve() -> int: jessica_cookies = 20 tom_cookies = jessica_cookies + 5 jessica_cookies_second_round = 3 * tom_cookies tom_cookies_second_round = jessica_cookies_second_round - 2 total_jessica_cookies = jessica_cookies + jessica_cookies_second_round total_tom_cookies = tom_cookies +...
A bag of marbles has 60 marbles, with 4 different colors. If 1/3 of the marbles are blue, how many blue marbles are there?
def solve() -> int: num_blue = (1/3) * 60 result = num_blue return result
Alex wants to go on vacation and wants to save $1000. He saved $35 a week for 12 weeks. After 6 weeks, he took $100 out of his savings for a gift. How much more money does Alex need to save to reach his goal?
def solve() -> int: savings = 35*6 new_savings = 35*6 - 100 total_savings = new_savings + 35*6 money_needed = 1000 - total_savings result = money_needed return result
Tom has a box that holds 4 gallons of liquid. How many quarts of liquid can Tom fit into the box?
def solve() -> int: liquid_in_1_gallon = 4 gallons = 4 liquid_in_quart = liquid_in_1_gallon / 4 total_liquid_in_quarts = liquid_in_quart * gallons result = total_liquid_in_quarts return result
Steven needs to fill sandbags for flood prevention. Each sandbag takes twice as much sand as it does stones. If each sandbag requires 10 stones and Steven has 480 stones and sand total, how many sandbags can he fill?
def solve() -> int: stones = 480 sandbags = stones / 10 result = sandbags return result
Grace has 20 nickels. She spends 15 cents on a postcard. How many cents does she have left?
def solve() -> int: nickels = 20 cents_spent = 15 cents_left = nickels * 5 - cents_spent result = cents_left return result
Lisa has 5 jars of jelly beans. Each jar has 12 jelly beans and each jelly bean weighs 5 grams. How much do all the jelly beans weigh in total?
def solve() -> int: total_jelly_beans = 5 * 12 total_weight = total_jelly_beans * 5 result = total_weight return result
Olivia walks 500 meters in 2 minutes, runs the next 200 meters in 40 seconds, and then walks the remaining 300 meters in 3 minutes. What is her average speed for the entire distance?
def solve() -> int: distance_walked = 500 time_walked = 2 distance_run = 200 time_run = 40 distance_remaining = 300 time_remaining = 3 total_distance = distance_walked + distance_run + distance_remaining total_time = time_walked + time_run + time_remaining average...
Ali and his three friends go to the movies. Tickets for adults are $11 and tickets for children are $8. If he wants to give the theatre an 10% tip, how much would it be?
def solve() -> int: adult_ticket_cost = 11 child_ticket_cost = 8 number_of_adults = 1 number_of_children = 3 tip_percentage = 0.1 total_cost = adult_ticket_cost * number_of_adults + child_ticket_cost * number_of_children tip_amount = total_cost * tip_percentage result = tip_amo...
A company has 135 employees. If they want to lay off 15% of their staff, how many employees will be laid off?
def solve() -> int: total_employees = 135 layoff_percentage = 0.15 employees_to_layoff = total_employees * layoff_percentage result = employees_to_layoff return result
Student: If John can dig 2 feet of ground in 5 minutes, how much ground can he dig in 45 minutes?
def solve() -> int: time = 45 rate = 2 rate_per_minute = rate / 5 result = time * rate_per_minute return result
- QuestionMason bought 8 pizzas to share equally among his 4 friends. If each pizza has 10 slices, how many slices will each friend get, and how many slices will be left over?
def solve() -> int: pizzas = 8 friends = 4 slices_per_pizza = 10 total_slices = pizzas * slices_per_pizza slices_per_friend = total_slices // friends leftover_slices = total_slices % friends result = f'Each friend will get {slices_per_friend} slices, and there will be {leftover_sli...
You have 75$ to spend on supplies. You buy pencils for 12$, a notebook for 5$, and 3/8 of what's left on a calculator. How much money do you have left?
def solve() -> int: remaining = 75 - 12 - 5 calculator = remaining * 3 / 8 result = remaining - calculator return result
Student: 3. There is a half-filled bowl of mashed potatoes sitting on the table. After 8 people get their servings, there are 4 servings worth of mashed potatoes left in the bowl. How many servings were there before 8 people got their portions?
def solve() -> int: servings_before = 0 servings_left = 4 people = 8 servings_before = people + servings_left result = servings_before return result
A company employs 15 people full-time and 25 people part-time. There are a total of 40 employees in the company. What percentage of employees are part-time?
def solve() -> int: full_time_employees = 15 part_time_employees = 25 total_employees = 40 percent_part_time = part_time_employees / total_employees * 100 result = percent_part_time return result
A car travels 60 km/hour from 8am to 12pm. How far does it travel in 4 hours?
def solve() -> int: speed = 60 time = 4 distance_travelled = speed * time result = distance_travelled return result
A basketball team won 60% of their games. If they played 30 games, how many games did they win?
def solve() -> int: total_num_games = 30 win_percentage = 0.6 num_games_won = total_num_games * win_percentage result = num_games_won return result
A recipe calls for 4 cups of sugar to make 30 cookies. How much sugar is needed to make 100 cookies?
def solve() -> int: num_cookies_needed = 100 cups_of_sugar_per_cookie = 4/30 total_cups_of_sugar = num_cookies_needed * cups_of_sugar_per_cookie result = total_cups_of_sugar return result
Rachel is arranging a sports stadium with 50 levels. Every 20th floor has a VIP lounge where exclusive guests can enjoy a bar, taking 5 minutes. To move between floors, the elevator travels 1100 feet/min. How long would it take a VIP to travel from the top floor to the bottom floor?
def solve() -> int: floors = 50 vip_floor_interval = 20 vip_lounge_time = 5 elevator_speed = 1100 vip_floors = floors // vip_floor_interval vip_time = vip_floors * vip_lounge_time non_vip_floors = floors - vip_floors non_vip_time = non_vip_floors * elevator_speed total...
Ethan has 8 more toy cars than John, but only half as many toy cars as Emily. If Emily has 24 toy cars, how many toy cars does John have?
def solve() -> int: emily_toy_cars = 24 ethan_toy_cars = emily_toy_cars / 2 john_toy_cars = ethan_toy_cars - 8 result = john_toy_cars return result
A school purchased 600 pencils, and each student will receive 5 pencils. If there are 25 students in each classroom, how many classrooms are needed?
def solve() -> int: pencils = 600 pencils_per_student = 5 students_per_classroom = 25 classrooms = pencils // (pencils_per_student * students_per_classroom) result = classrooms return result
**1. ** A pizza has 400 calories. The smallest package of chips has 270 calories and a bottle of soda has 200 calories. John ate 5 pieces of the pizza, 2 packages of chips and 1 bottle of soda. If one has to consume 2000 calories per day, how many calories are left?
def solve() -> int: Calories_from_pizza = 400 * 5 Calories_from_chips = 270 * 2 Calories_from_soda = 200 total_consumed = Calories_from_pizza + Calories_from_chips + Calories_from_soda result = 2000 - total_consumed return result
A school has 800 students and 40 teachers. Due to a flu outbreak, 5% of the students and 10% of the teachers were absent on Monday, 10% of the remaining students and 20% of the remaining teachers were absent on Tuesday, and 15% of the rest of the students and 30% of the rest of the teachers were absent on Wednesday. Ho...
def solve() -> int: students_absent_mon = 0.05 * 800 teachers_absent_mon = 0.1 * 40 students_absent_tue = 0.1 * (800 - students_absent_mon) teachers_absent_tue = 0.2 * (40 - teachers_absent_mon) students_absent_wed = 0.15 * (800 - students_absent_mon - students_absent_tue) teachers_absent_wed = ...
A box contains 4 packets of cookies with 10 cookies in each packet. A group of 6 children buys 3 boxes each. How many cookies are the children carrying in total?
def solve() -> int: packets_per_box = 4 cookies_per_packet = 10 children = 6 boxes_per_child = 3 total_boxes = children * boxes_per_child total_packets = total_boxes * packets_per_box total_cookies = total_packets * cookies_per_packet result = total_cookies return result
ophia is ordering a pizza. A large pizza costs $15 and a small pizza costs $10. If she wants to order one large and one small pizza, how much will her total order cost?
def solve() -> int: large_pizza_cost = 15 small_pizza_cost = 10 total_cost = large_pizza_cost + small_pizza_cost result = total_cost return result
Jenny is baking cookies for her friends. She originally had 60 cookies, but while putting them in the oven she accidentally burnt 8 cookies. Later, she gave 10 cookies to her neighbor and was returned 5 more. At the end of the day, how many cookies will Jenny have left?
def solve() -> int: original_cookies = 60 burnt_cookies = 8 remaining_cookies = original_cookies - burnt_cookies given_cookies = 10 returned_cookies = 5 final_cookies = remaining_cookies - given_cookies + returned_cookies result = final_cookies return result
In her clothing store, Kate sells dresses and tops. Each dress costs $50. Each top costs $20. If Kate sells 8 dresses and 12 tops, how much money does she make from her sales?
def solve() -> int: dress_cost = 50 top_cost = 20 num_dresses = 8 num_tops = 12 total_dress_cost = dress_cost * num_dresses total_top_cost = top_cost * num_tops total_sales = total_dress_cost + total_top_cost result = total_sales return result
If there are three times as many marbles as pebbles in a certain jar and the jar has 60 marbles, how many pebbles would Sarah have if she takes 1/3 of each item in the jar?
def solve() -> int: marbles = 60 pebbles = marbles / 3 total_items = marbles + pebbles sarah_items = total_items / 3 sarah_pebbles = sarah_items / 4 result = sarah_pebbles return result
Nina is a teacher who gives quizzes and tests to her students. She gave 6 quizzes and one test in the first week of the month. Each quiz was worth 10 points and the test was worth 50 points. In the second week, she gave 4 quizzes and two tests. In the third week, she gave 8 quizzes and no tests. How many points did Nin...
def solve() -> int: week1_quizzes = 6 week1_tests = 1 week2_quizzes = 4 week2_tests = 2 week3_quizzes = 8 week3_tests = 0 quiz_points = 10 test_points = 50 week1_points = week1_quizzes * quiz_points + week1_tests * test_points week2_points = week2_quizzes * quiz_points ...