question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Possible new questions: A farmer has 12 chickens and 18 ducks. He sells eggs at the market for 50 cents each. Each chicken lays 6 eggs a week and each duck lays 8 eggs a week. How much money does the farmer make from selling eggs in a month?
def solve() -> int: chickens = 12 ducks = 18 egg_price = 0.50 chicken_eggs = 6 duck_eggs = 8 weeks = 4 total_eggs = chickens * chicken_eggs + ducks * duck_eggs income = total_eggs * egg_price result = income * weeks return result
Johnny has 25 toy cars. He gives away 5 of them to his sister. What is the percentage of cars he gave away?
def solve() -> int: percentage_given_away = 5 / 25 * 100 result = percentage_given_away return result
Student: A rectangular box has a length of 5 meters, a width of 3 meters, and a height of 2 meters. What is its volume?
def solve() -> int: length = 5 width = 3 height = 2 volume = length * width * height result = volume return result
Bella wants to buy fabrics to make a dress. She wants to buy 3 yards of silk fabric, 2 yards of cotton, and 1 yard of lace. The silk fabric costs $10 per yard, the cotton is $5 per yard, and the lace is $7 per yard. After making the dress, she finds out that it is too small for her. How much did the cost of the dress f...
def solve() -> int: silk_yards = 3 cotton_yards = 2 lace_yards = 1 silk_cost = 10 cotton_cost = 5 lace_cost = 7 total_cost = (silk_yards * silk_cost) + (cotton_yards * cotton_cost) + (lace_yards * lace_cost) waste_cost = total_cost / 2 result = waste_cost ...
There are 42 teams participating in a basketball competition. 12% of them complete the competition in less than 45 minutes. Four times that number finish within an hour. 2/5th of the remaining teams take more than 2 hours to complete the competition. How many teams take more than 2 hours?
def solve() -> int: teams = 42 less_than_45_minutes = 0.12 * teams within_an_hour = 4 * less_than_45_minutes remaining_teams = teams - less_than_45_minutes - within_an_hour more_than_2_hours = (2/5) * remaining_teams result = more_than_2_hours return result
A book has 150 pages. You read 25 pages a day for the first three days and 30 pages a day for the next 5 days. How many pages more did you read in the last five days than in the first three days?
def solve() -> int: pages_day_1_to_3 = 25 * 3 pages_day_4_to_8 = 30 * 5 difference = pages_day_4_to_8 - pages_day_1_to_3 result = difference - pages_day_1_to_3 return result
In the village, there are 28 fewer farmers than merchants. If there are 91 merchants, how many farmers and merchants are in total?
def solve() -> int: merchants = 91 farmers = 0 farmers = merchants - 28 result = farmers + merchants return result
Here are some possible questions and Python programs to solve them: A jar contains 20 more marbles than beads. There are 3 times as many beads as buttons. If there are 100 buttons in the jar, how many marbles are there?
def solve() -> int: beads = 100 * 3 marbles = beads + 20 result = marbles return result
An ice cream parlor offers 3 different sizes of ice cream scoops -- small, medium, and large. If the parlor sells 54 scoops total, and there is twice as many medium scoops as small scoops, how many large scoops did the parlor sell?
def solve() -> int: total_scoops = 54 large_ratio = 1 medium_ratio = 2 large_scoops = total_scoops * large_ratio // (large_ratio + medium_ratio) result = large_scoops return result
Mark's workplace is 180 miles away from his house. He drives at the speed of 45 miles per hour but stops for 10 minutes every 30 minutes of driving. How long will it take him to reach his workplace?
def solve() -> int: distance = 180 speed = 45 stop_time = 10/60 drive_time = distance/speed num_stops = drive_time // 0.5 total_stop_time = num_stops * stop_time total_time = drive_time + total_stop_time result = total_time return result
Jenny wants to calculate the volume of a cylinder. The radius of the cylinder is 4 cm and the height of the cylinder is 8 cm.
def solve() -> int: pi = 3.14 radius = 4 height = 8 volume = pi * radius ** 2 * height result = volume return result
If Sarah earns $18 an hour, and works for 8 hours a day, how much money does she earn in 8 days?
def solve() -> int: hours = 8 days = 8 payrate = 18 result = payrate * hours * days return result
Ryan drove 16 miles with 1 gallon of gasoline and 17 miles with 2 gallons of gas. How many gallons of gas did he start with?
def solve() -> int: miles_1gallon = 16 miles_2gallons = 17 gas_1gallon = 1 total_miles = miles_1gallon + miles_2gallons total_gas = gas_1gallon + miles_2gallons result = total_gas return result
In a classroom, there are 25 desks and 35 students. If they divide into 5 equal groups, how many students are in each group?
def solve() -> int: desks = 25 students = 35 groups = 5 students_per_group = students // groups result = students_per_group return result
mmer loves to collect stickers and albums. She buys one album for $12 and two packs of stickers for $5 each every month. Her cousin Mia also likes stickers, but she buys one album for $8 and three packs of stickers for $4 each every month. Her friend Leo only buys one pack of stickers for $3 every month. How much money...
def solve() -> int: summer_cost = 12 + 2 * 5 mia_cost = 8 + 3 * 4 leo_cost = 3 summer_annual_cost = summer_cost * 12 mia_annual_cost = mia_cost * 12 leo_annual_cost = leo_cost * 12 total_annual_cost = summer_annual_cost + mia_annual_cost + leo_annual_cost result = tot...
Ranen wants to buy 18 boxes of candy, each box costs $12. She gives the cashier $219 dollars. How much change should she get back?
def solve() -> int: pricePerBox = 12 totalPrice = 18 * 12 change = 219 - totalPrice result = change return result
A book has 240 pages. If you read 20 pages a day, how many days will it take to finish the book?
def solve() -> int: pages = 240 days = 0 while pages >= 20: pages -= 20 days += 1 result = days return result
A classroom has 36 students. Two-fifths of the students have a calculator, and the remaining students do not have one. If 12 students bought a calculator, how many students in the classroom do not have a calculator?
def solve() -> int: students_in_classroom = 36 students_with_calculator = (2/5) * students_in_classroom students_without_calculator = students_in_classroom - students_with_calculator students_bought_calculator = 12 students_without_calculator -= students_bought_calculator result = students_witho...
Student: The temperature outside is currently 22 degrees Celsius. If the temperature changes by 8 degrees Celsius, what will be the new temperature outside?
def solve() -> int: temp_now = 22 change = 8 temp_new = temp_now + change result = temp_new return result
Student: Ken sells 50 compact discs every month. Each compact disc costs $5.75 and he has to pay a 2% transaction fee on each sale. How much does he earn each month?
def solve() -> int: cds = 50 price = 5.75 fee = 0.02 revenue = cds * price total_fee = revenue * fee income = revenue - total_fee result = income return result
Student: John has 30 packs of candy and eats one pack each day for 3 days. How many packs of candy will he have left?
def solve() -> int: packs_of_candy = 30 days = 3 packs_eaten = days packs_left = packs_of_candy - packs_eaten result = packs_left return result
Two chefs at a restaurant need to make a broth using chicken stock and vegetable stock. If they have 20 liters of broth and chicken stock is 4 times the amount of vegetable stock, how much chicken stock do they need?
def solve() -> int: amount_chicken_stock = 0 amount_vegetable_stock = 0 total_broth = 20 rate_chicken_vegetable = 4 amount_chicken_stock = rate_chicken_vegetable * amount_vegetable_stock total_broth = amount_chicken_stock + amount_vegetable_stock amount_chicken_stock = total_broth / (1 +...
Benji has ordered 600 paint rolls for his art project. He has already purchased 400 paint rolls for his project. He needs to use 200 paint rolls for painting the canvas and 300 paint rolls for the frames. How many paint rolls will he need to purchase to complete his project?
def solve() -> int: total_paint_rolls_needed = 600 paint_rolls_brought = 400 paint_rolls_for_canvas = 200 paint_rolls_for_frames = 300 paint_rolls_brought_used = paint_rolls_for_canvas + paint_rolls_for_frames paint_rolls_needed_to_be_bought = total_paint_rolls_needed - paint_rolls_...
Dylan works 3 days a week and he works for 5 hours on Mondays, Wednesdays, and Fridays. If he earns $18 per hour, what is his total earnings in a week?
def solve() -> int: days_per_week = 3 hours_per_day = 5 hourly_rate = 18 total_earnings = days_per_week * hours_per_day * hourly_rate result = total_earnings return result
Sarah and Jack were running a marathon in a desert. Together they ran for 42 kilometers. Jack ran two-fifth the distance that Sarah ran. How many kilometers did Sarah run?
def solve() -> int: sarah_distance = 42 * (5/7) result = sarah_distance return result
If a square has a perimeter of 28 centimeters, what is the length of each side of the square?
def solve() -> int: perimeter = 28 side_length = perimeter / 4 result = side_length return result
Student: A fruit seller buys 150 bananas for $75. She sells each banana at $0.75. How much profit did she make?
def solve() -> int: cost_per_banana = 0.75 number_of_bananas = 150 cost_of_bananas = 75 total_revenue = cost_per_banana * number_of_bananas profit = total_revenue - cost_of_bananas result = profit return result
In a zoo, the lion exhibit attracts the most visitors on Sunday with 200 people. On Tuesday, 20% less people visit than Sunday, and on Friday, 20 more people visit than on Tuesday. There are 60 visitors on both Monday and Wednesday, and on the weekend, foot traffic drops to 40 people per day. How many people visit the ...
def solve() -> int: sunday = 200 tuesday = sunday * 0.8 friday = tuesday + 20 monday = 60 wednesday = 60 weekend = 40 * 2 total_visitors = sunday + tuesday + friday + monday + wednesday + weekend result = total_visitors return result
Julia is going on a road trip with her family. She needs to fill her car with gasoline. If her car has a fuel tank capacity of 60 liters, and Julia needs to fill it up completely, how many liters of fuel does she need to buy?
def solve() -> int: capacity = 60 result = capacity result = 60 return result
A desktop computer costs $895 before taxes. If the tax rate is 8%, how much will the computer cost in total?
def solve() -> int: computer_cost = 895 tax_rate = 0.08 total_cost = computer_cost + (computer_cost * tax_rate) result = total_cost return result
A recipe calls for 2 cups of flour, 1 cup of sugar, and 1/2 cup of oil to make a cake. If you want to make 3 cakes, what will be the total amount of flour, sugar, and oil required?
def solve() -> int: flour_per_cake = 2 sugar_per_cake = 1 oil_per_cake = 0.5 num_cakes = 3 total_flour = flour_per_cake * num_cakes total_sugar = sugar_per_cake * num_cakes total_oil = oil_per_cake * num_cakes result = (total_flour, total_sugar, total_oil) return result
In a music festival, 80% of the 15 rock bands were selected to perform, half of the 20 folk groups made it to the stage, 1/6 of the 36 jazz ensembles were chosen, and 1/5 of the 10 reggae bands made it. How many bands performed in the festival?
def solve() -> int: rock_bands = 15 folk_groups = 20 jazz_ensembles = 36 reggae_bands = 10 selected_rock_bands = rock_bands * 0.8 selected_folk_groups = folk_groups * 0.5 selected_jazz_ensembles = jazz_ensembles * (1/6) selected_reggae_bands = reggae_bands * (1/5) total_ban...
A year ago, Rachel's salary was 12 times more than Noah's. If Noah's salary has now increased by 15% and he currently earns $3600, what is Rachel's salary now?
def solve() -> int: noah_salary = 3600 rachel_salary = (noah_salary * 12) + (noah_salary * 12 * 0.15) result = rachel_salary return result
A recipe for a cake requires 3 cups of flour, 2 cups of sugar, 4 eggs and 1/2 cup of oil. How much of each ingredient is needed to make 1/4 of the cake?
def solve() -> int: flour = 3 sugar = 2 eggs = 4 oil = 1/2 flour_needed = flour * 1/4 sugar_needed = sugar * 1/4 eggs_needed = eggs * 1/4 oil_needed = oil * 1/4 result = (flour_needed, sugar_needed, eggs_needed, oil_needed) return result
Student: Ann wants to buy 3 packs of gum with 15 pieces of gum in each pack. How many pieces of gum will she have in total?
def solve() -> int: packs = 3 pieces_per_pack = 15 total_pieces = packs * pieces_per_pack result = total_pieces return result
Kevin buys a laptop for $800 and a printer for $200. He gets a 10% discount on the laptop and a 5% discount on the printer. How much does he pay?
def solve() -> int: laptop = 800 printer = 200 laptop_discount = 0.1 printer_discount = 0.05 laptop_price = laptop * (1 - laptop_discount) printer_price = printer * (1 - printer_discount) total_price = laptop_price + printer_price result = total_price return resu...
Paige is swimming laps. She swam 13 lengths of the pool in 4 minutes and 10 seconds. What is her average speed in m/min?
def solve() -> int: seconds = 4 * 60 + 10 mpm = seconds/13 result = mpm return result
The number of birds in a sanctuary starts at 5,000 and increases by 40% over 15 years due to new breeding. During that same time, 100 birds migrate out each year and 200 new birds are added each year. How many birds are in the sanctuary after 15 years?
def solve() -> int: birds = 5000 years = 15 breeding_increase = birds * 0.4 total_increase = breeding_increase + (200 - 100) * years final_birds = birds + total_increase result = final_birds return result
A group of 5 students organized a fundraiser to go to Ireland for the summer. For them to go on the trip, each of them needs at least $350. On top of that, they need $2500 for their miscellaneous collective expenses. On the first day of their fundraiser, they receive $450. On the second day, they receive $400, and on t...
def solve() -> int: total_goal = 5 * 350 + 2500 initial_funds = 450 + 400 + 600 extra_funds = initial_funds * (1/3) * 5 total_raised = initial_funds + extra_funds result = total_goal - total_raised return result
Kayla ran five times as far as she walked minus 10 miles. If she traveled a total of 35 miles, how far did she walk?
def solve() -> int: walked = (35 + 10) / 6 result = walked return result
Jerry has $50. He needs to buy a book that costs $20 and a pen that costs $5. How much money will he have left?
def solve() -> int: total_money = 50 book_price = 20 pen_price = 5 remaining_money = total_money - book_price - pen_price result = remaining_money return result
A bookstore sells 50 books on weekdays and 100 books on weekends. How much money will it make at the end of the month?
def solve() -> int: weekday_books = 50 weekend_books = 100 days_in_week = 7 days_in_month = 30 weekday_sales = weekday_books * days_in_week weekend_sales = weekend_books * (days_in_month - days_in_week) total_sales = weekday_sales + weekend_sales result = total_sales ...
A clothing store produces 200 dresses every week. They sell each dress for $100. If they sold 2 weeks' worth of production, how much money will the store earn?
def solve() -> int: dresses_per_week = 200 price_per_dress = 100 weeks_sold = 2 total_dresses_sold = dresses_per_week * weeks_sold total_earnings = total_dresses_sold * price_per_dress result = total_earnings return result
A meet-up has 4 types of attendees viz. , developers, designers, marketers, and entrepreneurs. They have twice as many marketers as entrepreneurs, 1/4 as many designers as developers and three times as many developers as marketers. If they have 60 designers, how many attendees do they have in total?
def solve() -> int: num_developers = 3 * 1 / 2 * 60 num_designers = 60 num_marketers = 2 * num_developers num_entrepreneurs = 1 / 2 * num_marketers total_attendees = num_developers + num_designers + num_marketers + num_entrepreneurs result = total_attendees return result
Amy bakes cakes for a fundraiser. She bakes 50 chocolate cakes for $10 each. She also bakes one-fourth as many lemon cakes for $15 each. How much did everything cost?
def solve() -> int: chocolate_cakes = 50 price_of_chocolate_cake = 10 lemon_cakes = chocolate_cakes / 4 price_of_lemon_cake = 15 cost_of_chocolate_cakes = chocolate_cakes * price_of_chocolate_cake cost_of_lemon_cakes = lemon_cakes * price_of_lemon_cake total_cost = cost_of_chocolat...
Michael has a collection of hats. He has 50 hats in total, and 10 hats are blue. The remaining hats are divided equally into red and green hats. If he has twice as many red hats as green hats, and he has 5 brown hats and 8 black hats, how many yellow hats does he have?
def solve() -> int: total_hats = 50 blue_hats = 10 red_green_hats = total_hats - blue_hats red_hats = red_green_hats / 3 green_hats = red_hats / 2 brown_hats = 5 black_hats = 8 yellow_hats = total_hats - (blue_hats + red_hats + green_hats + brown_hats + black_hats) result = yell...
Student: The cost of a train ticket is $18 for a one-way trip. A round-trip ticket costs $28. How much would it cost for 4 people to travel round-trip?
def solve() -> int: one_way_cost = 18 round_trip_cost = 28 num_people = 4 total_cost = round_trip_cost * num_people result = total_cost return result
If Mrs. O’Rourke bought a dozen eggs for $2.25, how much money did she spend per egg?
def solve() -> int: eggs= 12 cost= 2.25 costpereg = cost/eggs result = costpereg return result
A right triangle has a base of 5 meters and a height of 12 meters. What is its area?
def solve() -> int: base_m = 5 height_m = 12 area = 0.5 * base_m * height_m result = area return result
Sophie's mother ordered 30 boxes of oranges for her fruit stand, each box containing 20 oranges. But upon delivery, she realized that 5 boxes were missing, and 3 crates of oranges were damaged, with 6 oranges in each crate being spoiled. How many good oranges did Sophie's mother have left to sell in her stand?
def solve() -> int: boxes_ordered = 30 oranges_per_box = 20 missing_boxes = 5 damaged_crates = 3 spoiled_oranges_per_crate = 6 total_oranges = (boxes_ordered - missing_boxes) * oranges_per_box spoiled_oranges = damaged_crates * spoiled_oranges_per_crate ...
Karen buys 1 loaf of bread and 5 cartons of eggs. Each loaf of bread costs $2.50 and each carton of eggs costs $2.15. How much did Karen pay in total?
def solve() -> int: num_bread = 1 num_eggs = 5 cost_bread = 2.5 cost_eggs = 2.15 result = num_bread * cost_bread + num_eggs * cost_eggs return result
A bag contains 12 red balls, 8 blue balls, and 4 yellow balls. Three balls are drawn at random from the bag, without replacement. What is the probability that all three balls are the same color?
def solve() -> int: total = 24 ways = 24*23*22 / (3*2*1) red = 12*11*10 / (3*2*1) blue = 8*7*6 / (3*2*1) yellow = 4*3*2 / (3*2*1) same = red + blue + yellow probability = same / ways result = probability return result
Pat pays $36/hour for 8 hours a week of swimming lessons and $39/hour for 6 hours a week of rock climbing lessons. How much extra does Pat spend on rock climbing lessons per year compared to swimming lessons?
def solve() -> int: Swimming_yearly_cost = 36 * 8 * 52 Rock_Climbing_yearly_cost = 39 * 6 * 52 Difference = Rock_Climbing_yearly_cost - Swimming_yearly_cost result = Difference return result
bought a laptop for $700 and a computer screen for $200. She sold the laptop for $600 and the screen for $250. What is the total amount of money she made from the two sales?
def solve() -> int: laptop_cost = 700 laptop_sold_price = 600 gained_from_laptop = laptop_sold_price - laptop_cost screen_cost = 200 screen_sold_price = 250 gained_from_screen = screen_sold_price - screen_cost total_amount = gained_from_laptop + gained_from_screen result = total_amount ...
A student drove to the beach and back. The round trip was 264 miles and they drove at an average speed of 54 miles per hour. How long did the trip take?
def solve() -> int: total_miles = 264 avg_speed = 54 time = total_miles / avg_speed result = time return result
Javier received a prize of $50000 in a competition. He used 30% of the amount to pay off credit card debt. Then he distributed the remaining money between investment in stocks and buying a new car. If he spent 1/4th of what is left on the car, how much money does he have left after investing 20% in stocks?
def solve() -> int: prize = 50000 credit_card_debt = prize * 0.3 remaining_money = prize - credit_card_debt car_expense = remaining_money / 4 remaining_money -= car_expense stocks_investment = remaining_money * 0.2 remaining_money -= stocks_investment result = remaining_money re...
A book costs $15.50. If Jack has $25, how much money will he have left after buying the book?
def solve() -> int: book_cost = 15.5 jack_money = 25 change = jack_money - book_cost result = change return result
Emily works in a toy factory and every 15 minutes, a machine she oversees produces 10 stuffed animals. How many stuffed animals can the machine produce in 3 hours?
def solve() -> int: minutes_per_hour = 60 hours = 3 minutes = hours * minutes_per_hour animals_per_minute = 10 animals = minutes // 15 * animals_per_minute result = animals return result
Student: If a grocery store sells apples for $0.75 each, how much will it cost to buy a dozen apples (12 apples)?
def solve() -> int: cost_per_apple = 0.75 cost_of_dozen_apples = cost_per_apple * 12 result = cost_of_dozen_apples return result
Student: George regularly bought 7 cups of coffee per week. If each cup costs $4, how much money would he need to pay every week?
def solve() -> int: num_cups = 7 cost_per_cup = 4 total_cost = num_cups * cost_per_cup result = total_cost return result
John's candy shop has 600 lollipops in stock. Five children came in and bought 50 lollipops. How many lollipops are left in the store?
def solve() -> int: initial_stock = 600 lollipops_bought = 50 remaining_stock = initial_stock - lollipops_bought result = remaining_stock return result
If Grace works as a nurse, she earns $35 per hour, and if she works more than 10 hours, she is eligible for overtime at 1.5 times her hourly rate. She worked for 11 hours a day for 5 days. How much did she make?
def solve() -> int: hourly_rate = 35 overtime_rate = 1.5 * hourly_rate regular_hours = 10 overtime_hours = 11 - regular_hours days_worked = 5 regular_pay = regular_hours * hourly_rate overtime_pay = overtime_hours * overtime_rate total_pay = (regular_pay + overtime_pay) * days_worke...
A store has a sale where all items are discounted by 25%. If an item originally costs $80, what is the sale price?
def solve() -> int: original_price = 80 discount = 25 sale_price = original_price - (original_price * discount / 100) result = sale_price return result
Kevin has 40 pencils. He loses 2 pencils every day. He also finds 1 pencil every day. How many pencils will Kevin have in 12 days?
def solve() -> int: pencils = 40 for day in range(12): pencils = pencils - 2 pencils = pencils + 1 result = pencils return result
If a rectangle has a length of 10 cm and a width of 5 cm, what is its area?
def solve() -> int: length = 10 width = 5 area = length * width result = area return result
In every seventh cookie package, there is a bonus cookie. One in twelve packages has two bonus cookies instead. If a store orders 150 packages, how many bonus cookies will they receive?
def solve() -> int: num_packages = 150 one_bonus = num_packages // 7 two_bonus = num_packages // 12 both_bonus = num_packages // (7*12) total_bonus = one_bonus + 2*two_bonus - both_bonus*2 result = total_bonus return result
Array of candies has 4 peppermint, 7 licorice and some jellybeans candies. If the probability of randomly selecting a jellybeans candy is 3/7, how many jellybeans candies are there?
def solve() -> int: total_candies_ratio = 1 / (3/7) non_jellybean_candies = 4 + 7 total_candies = non_jellybean_candies * total_candies_ratio jellybean_candies = total_candies - non_jellybean_candies result = jellybean_candies return result
Leo has 21 pencils and Ryan has 15 pencils. If Leo gives Ryan 6 pencils and Ryan gives Leo 3 pencils, how many more pencils does Leo have than Ryan?
def solve() -> int: leo_pencils = 21 ryan_pencils = 15 leo_pencils = leo_pencils - 6 + 3 ryan_pencils = ryan_pencils + 6 - 3 difference = leo_pencils - ryan_pencils result = difference return result
A basketball player makes 70% of their free throws. If they shoot 20 free throws and then make an additional 7 in a row, what percentage of their total free throw attempts have they made?
def solve() -> int: throws_attempted = 20 throws_made1 = throws_attempted * 0.7 throws_made2 = throws_made1 + 7 throws_percent = (throws_made2 / (throws_attempted + 7)) * 100 result = throws_percent return result
At a home improvement store, there are 480 items for sale. There are three times as many tools than hardware, and twice as many building supplies than tools. How many hardware items are for sale?
def solve() -> int: tools = 480 // 3 hardware = tools // 3 building_supplies = tools * 2 result = hardware return result
Musa is now half the age his father was 15 years ago. If in 6 years, his father will be 70 years old, how old is Musa currently?
def solve() -> int: father_age_6_years_ago = 70 - 6 father_age = father_age_6_years_ago + 6 musa_age = (father_age_6_years_ago + 15) / 2 result = musa_age return result
Possible questions and programs: A school library had 120 books in the morning. During the day, 15 books were checked out by students and 8 books were returned. The librarian also bought 6 more books to add to the collection. How many books are in the library at the end of the day?
def solve() -> int: books = 120 books = books - 15 books = books + 8 books = books + 6 result = books return result
A cell phone plan costs $25 per month plus $0.10 per text message. If Maria sent 75 text messages this month, how much does her bill cost?
def solve() -> int: plan_cost = 25 texts_sent = 75 text_cost = texts_sent*0.1 total_cost = plan_cost+text_cost result = total_cost return result
Charlotte wants to buy a new bicycle priced at $600. A biking store offers payment plans of $40 per month, with a 20% down payment required. If Charlotte decides to add $50 towards the down payment, what will she still owe after making payments for 4 months?
def solve() -> int: price_of_bicycle = 600 monthly_payment = 40 down_payment = 0.2 * price_of_bicycle + 50 remaining_balance = price_of_bicycle - down_payment months = 4 total_payment = monthly_payment * months remaining_balance -= total_payment result = remaining_balance return...
Student: In a department store, 40% of items are clothes, 30% are electronics and the rest are accessories. If there are 500 accessories, how many items are in the store?
def solve() -> int: clothes = 0.4 electronics = 0.3 accessories = 500 accessories_percent = 1 - clothes - electronics total_items = accessories / accessories_percent result = total_items return result
A factory produces 500 toys every hour. If the factory runs for 8 hours in a day, how many toys are produced in a day?
def solve() -> int: toys_hour = 500 hours_day = 8 total_toys = toys_hour * hours_day result = total_toys return result
A car can travel 236 miles on 12 gallons of gas. How many miles can it travel on 20 gallons of gas?
def solve() -> int: mileage = 236 / 12 miles_on_20_gallons = mileage * 20 result = miles_on_20_gallons return result
There are three groups of people in a park, consisting of 10, 15, and 20 individuals respectively. If each group has an equal number of children, and there are a total of 40 children in the park, how many adults are in the park?
def solve() -> int: group1 = 10 group2 = 15 group3 = 20 total_children = 40 children_per_group = total_children / 3 adults = (group1 + group2 + group3) - children_per_group result = adults return result
A rectangular pool has a length of 12 meters, a width of 6 meters, and a uniform depth of 2 meters. What is the total volume of water needed to fill it up?
def solve() -> int: pool_volume = 12 * 6 * 2 result = pool_volume return result
A music band sells 500 tickets for a concert. If they want to fill the venue to 75% capacity, how many more tickets do they need to sell?
def solve() -> int: total_tickets = 500 capacity_percentage = 75 tickets_needed = total_tickets * (capacity_percentage / 100) more_tickets_needed = tickets_needed - total_tickets result = more_tickets_needed return result
Jane studied for her final exam for 3 hours per day for 5 days. She knows the probability of passing the exam is 80% if she studied at least 15 hours. What is the probability of Jane passing the exam?
def solve() -> int: hours_studied_per_day = 3 days_studied = 5 hours_needed_to_pass = 15 probability_of_passing_given_studying_enough = 0.8 total_hours = hours_studied_per_day * days_studied if total_hours >= hours_needed_to_pass: probability_of_passing = 1 else: probability_...
If four workers need to build a fence using 600 posts in 3 days and they can build 100 posts every day, how many posts should each worker build per day?
def solve() -> int: total_posts = 600 days = 3 posts_per_day = total_posts / days posts_per_worker = posts_per_day / 4 result = posts_per_worker return result
The price of a t-shirt before tax is $20. If the tax is 8%, what is the total cost of the t-shirt?
def solve() -> int: tax_amount = 20*0.08 total_cost = 20+tax_amount result = total_cost return result
Student: 7. For the school play, 70 tickets were sold but only 45 were used. How many tickets were not used?
def solve() -> int: tickets_sold = 70 tickets_used = 45 tickets_not_used = tickets_sold - tickets_used result = tickets_not_used return result
In a gym, there are 20 lockers for members to store their personal belongings. One locker can hold two gym bags. If there are already 18 gym bags stored, how many more can still fit in the remaining lockers?
def solve() -> int: total_lockers = 20 bags_per_locker = 2 total_bags = total_lockers * bags_per_locker bags_stored = 18 bags_remaining = total_bags - bags_stored result = bags_remaining return result
The price of a dozen eggs is $3.50. What is the unit price of each egg?
def solve() -> int: eggs_per_dozen = 12 price_of_dozen = 3.5 price_per_egg = price_of_dozen / eggs_per_dozen result = price_per_egg return result
John made a total of $240 from selling T-shirts. If he sold 20 small T-shirts at $8 each and 15 large T-shirts at $14 each, how many small T-shirts must he sell at $6 each in order to make a total of $350?
def solve() -> int: current_sales = 20*8 + 15*14 additional_sales = 350 - 240 additional_small_sales = additional_sales - 15*14 num_small_tshirts = additional_small_sales / (6 - 8) result = num_small_tshirts return result
John has a rectangular garden plot that is 10 meters long and 8 meters wide. He wants to plant rows of flowers across the garden plot, with each row having 0.5-meter spacing between them. If each flower is in 0.2 meters, how many flowers can he plant?
def solve() -> int: length = 10 width = 8 space_between_rows = 0.5 flower_width = 0.2 num_flowers_per_row = (length - (2*space_between_rows))/flower_width num_rows = (width - (2*space_between_rows))/flower_width total_flowers = num_flowers_per_row * num_rows result = total_flowers re...
Jenna bought a pair of shoes for $50 with a tax of 13%. What was the total amount she paid for them after tax?
def solve() -> int: price = 50 tax_rate = 0.13 tax_amount = price * tax_rate total_price = price + tax_amount result = total_price return result
Amanda has a one-hour exam consisting of 70 questions. She has spent 10 minutes on it and has answered 14 questions. Assuming she maintains the same pace, how much time will she have left when she completes it?
def solve() -> int: total_questions = 70 answered_questions = 14 total_time = 60 time_spent = 10 questions_left = total_questions - answered_questions time_per_question = (total_time - time_spent) / (total_questions - answered_questions) time_left = questions_left * time_per_question ...
6. If Samuel has 12 pieces of gum that costs $2.50 each, how much money does he need to pay?
def solve() -> int: pieces = 12 price = 2.50 total_cost = pieces * price result = total_cost return result
A factory produces 500 units of a product in 8 hours. How many units will they produce in 24 hours assuming they maintain a constant rate of production?
def solve() -> int: units_per_hour = 500 / 8 total_hours = 24 total_units = units_per_hour * total_hours result = total_units return result
Jacob is organizing books in a library. If he has 7 shelves and each shelf can hold 25 books, how many books can he store?
def solve() -> int: shelves = 7 books_per_shelf = 25 total_books = shelves * books_per_shelf result = total_books return result
Student: At a bakery, Paul bought 3.5 dozens of muffins, 5.5 dozens of donuts and 2.5 dozens of croissants. What is the total number of pastries that Paul bought?
def solve() -> int: muffins = 3.5 donuts = 5.5 croissants = 2.5 total_pastries = muffins * 12 + donuts * 12 + croissants * 12 result = total_pastries return result
A truck driver makes $3,000 per month. He spends 20% on gas, 10% on food, and saves the rest. If he wants to save $10,000 by the end of the year after taxes take away 30%, how much does he need to save every month?
def solve() -> int: income = 3000 gas = income * 0.2 food = income * 0.1 savings_before_tax = income - gas - food annual_savings_before_tax = savings_before_tax * 12 taxes = annual_savings_before_tax * 0.3 annual_savings_after_tax = annual_savings_before_tax - taxes monthly_savings_after...
Anna has a total of 120 coins. Of these coins, 20% are nickels and the rest are pennies. How many pennies does Anna have?
def solve() -> int: total_coins = 120 nickels_perc = 20 nickels = total_coins * (nickels_perc / 100) result = total_coins - nickels return result
In a week, how much does it cost Ed to hire two cooks if they charge $60 per day, and he hires them for 10 hours per day for 4 days?
def solve() -> int: cook_charge_per_day = 60 hours_per_day = 10 days = 4 total_cost = cook_charge_per_day * hours_per_day * days result = total_cost return result
Student: If a train traveling at a constant 60mph takes 2 hours to travel from City A to City B, how many miles are between the two cities?
def solve() -> int: speed = 60 time = 2 distance = speed * time result = distance return result
Emily swiped her loyalty card at the coffee shop. She spent half of the stamps on a cappuccino. She spent 4 stamps on a croissant. She spent another 6 stamps on a muffin. How many stamps did Emily redeem today?
def solve() -> int: stamps_total = 20 stamps_cappuccino = stamps_total / 2 stamps_croissant = 4 stamps_muffin = 6 stamps_redeemed = stamps_cappuccino + stamps_croissant + stamps_muffin result = stamps_redeemed return result
Judy gives her brother Dave $50 for his birthday. He spends $30 on a toy and $20 on candy. How much money does Dave have left?
def solve() -> int: initial_amount = 50 spent_on_toy = 30 spent_on_candy = 20 result = initial_amount - spent_on_toy - spent_on_candy return result