question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
The postal service needs to package 524 envelopes. If they need to package it in boxes with 3 envelopes per box, how many boxes are needed?
def solve() -> int: n=524 divide_by = 3 boxes = n//divide_by result = boxes return result
Student: Christina is 12 years old now. If she was twice as old as her brother 5 years ago, how old is her brother now?
def solve() -> int: christina_age = 12 brother_age_5_years_ago = christina_age / 2 brother_age_now = brother_age_5_years_ago + 5 result = brother_age_now return result
A bread recipe calls for 5 cups of flour to yield 30 rolls. How many cups of flour are needed to produce 70 rolls?
def solve() -> int: num_rolls_1 = 30 flour_cups_1 = 5 num_rolls_2 = 70 flour_cups_2 = flour_cups_1*(num_rolls_2/num_rolls_1) result = flour_cups_2 return result
A plane can fly 700 miles in 2 hours. After flying for 5 hours, the plane lands and stays on the ground for 1 hour. How far can the plane travel in 12 hours?
def solve() -> int: speed = 700 / 2 distance = speed * 12 result = distance return result
There are 30 students in a class, each student brings 4 pencils, how many pencils are there in total?
def solve() -> int: pencils = 30 * 4 result = pencils return result
A pizza is cut into 8 slices. If 3 people each want to eat 2 slices, how many slices are left?
def solve() -> int: total_slices = 8 num_people = 3 slices_per_person = 2 slices_eaten = num_people * slices_per_person slices_left = total_slices - slices_eaten result = slices_left return result
The rent for a particular apartment is $1,200 more than the rent for each of the other apartments in the area, but it is rented out for 1.4 times as much as those apartments, which rent for $800 per month. How much more profit is earned by choosing the expensive apartment instead of the others?
def solve() -> int: rent_expensive = 1.4 * 800 rent_cheap = 800 difference = rent_expensive - rent_cheap result = difference * 12 return result
In a certain race, Mike ran twice as far as Paul. If Paul ran 4km, how far did Mike run?
def solve() -> int: paul_distance = 4 mike_distance = paul_distance * 2 result = mike_distance return result
The sum of the angles in a triangle is 180 degrees. If one angle is 60 degrees, and another angle is twice the first angle, what is the measure of the third angle?
def solve() -> int: angle1 = 60 angle2 = 2 * angle1 angle3 = 180 - angle1 - angle2 result = angle3 return result
Roger has a total of 30 marbles that are either red or blue. The ratio of blue marbles to red marbles is 2:3. How many blue marbles does Roger have?
def solve() -> int: num_blue_marbles = 0 num_red_marbles = 0 total_marbles = 30 ratio_blue_to_red = 2/3 num_red_marbles = total_marbles - (ratio_blue_to_red*num_blue_marbles) while (num_red_marbles > 0): num_blue_marbles +=1 num_red_marbles = total_marbles - (ratio_blue_to_red*nu...
Mary wants to paint her house. She can paint 2 walls per day and each wall needs 5 gallons of paint. If she has 100 gallons of paint, how many days will it take to paint all 10 walls?
def solve() -> int: walls_per_day = 2 paint_per_wall = 5 total_paint = 100 total_walls = 10 paint_needed = total_walls * paint_per_wall days_needed = paint_needed / (walls_per_day * paint_per_wall) result = days_needed return result
For every hour that it is raining, there is 1.5 inches of rain that will fill a rain gauge, if the rain gauge starts out empty but then it rains for 4 hours, how many total inches of rain will be in the rain gauge by the end?
def solve() -> int: hours_raining = 4 rain_per_hour = 1.5 total_rain = hours_raining*rain_per_hour result = total_rain return result
Student: Lisa had 4 boxes of cookies, each with 12 cookies. She gave her brother 2 boxes. How many cookies does she have left?
def solve() -> int: box_num = 4 cookie_num = 12 brother_box_num = 2 result = box_num * cookie_num - brother_box_num * cookie_num return result
Daniel is saving money for a trip. He needs 1000 dollars in total, and has already saved 400 dollars. Today, he earns 15% of the total amount from a part-time job. Tomorrow, he spends 10% of his current amount on a gift. How many more dollars does Daniel need to save for his trip?
def solve() -> int: total = 1000 saved = 400 saved = saved + 0.15 * total saved = saved - 0.1 * saved more = total - saved result = more return result
A box contains 20 books. If there are 4 boxes in total, how many books are there in total?
def solve() -> int: books_per_box = 20 num_boxes = 4 total_books = books_per_box * num_boxes result = total_books return result
A train travels from city A to city B at a speed of 60 km/h. On the way back, the train travels at a speed of 90 km/h. If the distance between the two cities is 180 km, how long did the round-trip take?
def solve() -> int: distance = 180 time_to_b = distance / 60 time_to_a = distance / 90 total_time = time_to_a + time_to_b result = round(total_time, 2) return result
Student: Debby ate dinner at a restaurant and the total dinners cost her $29.75 before tip. She wanted to leave a 15% tip. How much tip did she leave?
def solve() -> int: cost_before_tip = 29.75 tip_percentage = 0.15 tip = cost_before_tip * tip_percentage total_cost = cost_before_tip + tip result = tip return result
John has a jar of sweets. There are 50 chocolates, 20 gummies, and 30 candies. He wants to divide them into 5 bags equally, how many pieces of candy should be in each bag?
def solve() -> int: total_sweets = 100 bags = 5 candies = 30 candies_per_bag = candies / bags result = candies_per_bag return result
Student: I run 8 miles in 50 minutes. What is my average speed in miles per hour?
def solve() -> int: distance = 8 time = 50 time_in_hours = time / 60 average_speed = distance / time_in_hours result = average_speed return result
Robert has an apple and banana farm, where he sells an apple for $1.5 and a banana for $2. He sold 20 pieces of fruits today, with a total of $45. How many apples did he sell?
def solve() -> int: applePrice = 1.5 bananaPrice = 2 totalPrice = 45 appleAmount = totalPrice / applePrice bananaAmount = 20 - appleAmount result = appleAmount return result
am can run 10 kilometers in 45 minutes. How many minutes does it take Sam to run 5 kilometers?
def solve() -> int: distance = 10 time = 45 half_distance = 5 half_time = (distance/time) * half_distance result = half_time return result
-The problems and their solutions should be written in English Some possible questions and programs are: Patrick can bake 4 loaves of bread using 5 cups of flour. He has 40 cups of flour in his pantry and 12 eggs. Each loaf of bread requires 2 eggs. How many loaves of bread can he bake with his current ingredients?
def solve() -> int: loaves_flour = 40 / 5 loaves_eggs = 12 / 2 result = loaves_eggs return result
Mrs. Lee received $2000. She spent 3/5 of the money on a vacation and 2/9 of the remaining money on a new computer. Half the rest of the money was used to treat her family to a fancy restaurant meal. How much money did she have left after all these expenses?
def solve() -> int: money_received = 2000 vacation_spent = (3/5) * money_received money_remaining_1 = money_received- vacation_spent computer_spent = (2/9) * money_remaining_1 money_remaining_2 = money_remaining_1 - computer_spent meal_spent = (1/2) * money_remaining_2 money_remaining_3 = mo...
A grocery store is having a sale on cereal. If the regular price of a box of cereal is $3.49 and it is on sale for 25% off, what is the sale price?
def solve() -> int: reg_price = 3.49 percent_off = 25 sale_price = reg_price - (percent_off/100)*reg_price result = sale_price return result
Olivia reads for 15 minutes after breakfast, lunch and dinner. After 100 days, how many hours does she spend reading?
def solve() -> int: minutes_per_day = 15 * 3 minutes_in_100_days = minutes_per_day * 100 hours_in_100_days = minutes_in_100_days / 60 result = hours_in_100_days return result
Ashley wants to buy a dress that costs $150. She has $75. How much more money does she need to buy the dress?
def solve() -> int: cost = 150 money = 75 needed = cost - money result = needed return result
My family of 4 parents and 4 kids went out for dessert. How many people are there in total?
def solve() -> int: people = 0 for i in range (4): people += 1 for i in range (4): people += 1 result = people return result
Q7: Jack and Jill went to the market and purchased 5 oranges. Jack used 2/3 of the oranges. How many oranges were left?
def solve() -> int: oranges_purchased = 5 oranges_left = oranges_purchased - oranges_purchased*2/3 result = oranges_left return result
A box contains 6 black balls and 4 white balls. If 30% of the black balls are replaced with white balls, what percentage of the balls in the box are now white?
def solve() -> int: total_balls = 10 black_balls = 6 white_balls = 4 replaced_balls = black_balls * 0.3 new_black_balls = black_balls - replaced_balls new_white_balls = white_balls + replaced_balls new_total_balls = new_black_balls + new_white_balls percentage_of_white_balls = (new_white...
In the first team, David scored 7 while Tina scored 13. In the second team, Kyle scored 11 while Zoe scored 10. How many fewer points did the first team get than the second team?
def solve() -> int: david = 7 tina = 13 kyle = 11 zoe = 10 first_team = david + tina second_team = kyle + zoe difference = second_team - first_team result = difference return result
Sarah is remodeling her kitchen. The tiles she wants for the floor cost $5 per square foot and her kitchen is 10 feet by 12 feet. She also wants to replace the cabinets and countertops, which will cost $4,000. How much will she spend on the floor tiles and remodeling altogether?
def solve() -> int: length = 10 width = 12 area = length * width tile_cost = 5 floor_cost = area * tile_cost cabinet_countertop_cost = 4000 total_cost = floor_cost + cabinet_countertop_cost result = total_cost return result
Carla has 4 backpacks. The first backpack needs 6 books and the second backpack needs 2 fewer books than the first one. The third backpack needs the same number of books as the second backpack. The fourth backpack needs 2 more books than the third one. If Carla exchanges the books every two days, how many books will sh...
def solve() -> int: backpacks = 4 backpack1 = 6 backpack2 = backpack1 - 2 backpack3 = backpack2 backpack4 = backpack3 + 2 total_books = backpack1 + backpack2 + backpack3 + backpack4 books_per_2_days = total_books / 7 / 2 books_in_8_days = books_per_2_days * 8 ...
A family bought 120 blue flowers, 20 yellow flowers, and twice as many pink flowers. How many flowers did they buy in total?
def solve() -> int: blue_flowers = 120 yellow_flowers = 20 pink_flowers = 2 * yellow_flowers flowers = blue_flowers + yellow_flowers + pink_flowers result = flowers return result
There are 60 students in a school, if each student is given 2 chocolates and each chocolate has 100 calories, what is the total number of calories consumed by all the students in the school?
def solve() -> int: students = 60 chocolates = 2 calories_per_chocolate = 100 total_calories = students * chocolates * calories_per_chocolate result = total_calories return result
In a survey, 60% of the people prefer tea over coffee. If 300 people were surveyed, how many prefer tea?
def solve() -> int: num_people = 300 percent_prefer_tea = 60 num_prefer_tea = (percent_prefer_tea/100) * num_people result = num_prefer_tea return result
A tank has a capacity of 500 liters of water. The tank was filled from a pipe that can fill the tank in 4 hours. Due to a leakage, the tank took an additional hour to fill up. How much water leaked out of the tank in an hour?
def solve() -> int: tank_capacity = 500 filling_time = 4 overflow_time = 5 water_filled = tank_capacity / filling_time water_leaked = tank_capacity / overflow_time - water_filled result = water_leaked return result
A circle has a circumference of 18cm. What is its diameter, radius and area?
def solve() -> int: circumference = 18 pi = 3.14 diameter = circumference/pi radius = diameter/2 area = pi * (radius**2) result = (diameter, radius, area) return result
Jennifer goes to the Mexican Restaurant with her friends and orders various dishes. Jennifer orders a burrito, her friend orders fajitas, her sister orders nachos, and her cousin orders enchiladas. The burrito has 3 times as much meat as the nachos and the enchiladas have 2 more tortillas than the fajitas. How many tor...
def solve() -> int: burrito_meat = 1 nachos_meat = burrito_meat / 3 fajitas_tortillas = 1 enchiladas_tortillas = fajitas_tortillas + 2 total_tortillas = fajitas_tortillas + enchiladas_tortillas result = total_tortillas return result
arah had $500. She spent 20% of it on a dress, 40% on shoes, and the remaining on a handbag. If the handbag was $100, how much money did she spend on shoes?
def solve() -> int: initial_money = 500 dress = initial_money * 0.2 shoes = initial_money * 0.4 handbag = initial_money - dress - shoes - 100 result = shoes return result
James is currently 7 years old and his grandfather is 84. In how many years will James be half as old as his grandfather?
def solve() -> int: james_age = 7 grandfather_age = 84 x = 0 while james_age!= (1/2) * grandfather_age: james_age += 1 grandfather_age += 1 x += 1 result = x return result
am had 30 baseball cards in his collection. He just sold 15 baseball cards. How many cards does he have left?
def solve() -> int: cards_total = 30 cards_sold = 15 cards_left = cards_total - cards_sold result = cards_left return result
Mike spent 4 hours playing video games which is 4 times as much as he spent on shopping. If he spent twice as much on cooking as he did on shopping, and 3 hours on walking his dog, how long did he spend on all of these activities combined?
def solve() -> int: hours_shopping = 4/4 hours_cooking = hours_shopping*2 total_hours = 4 + hours_shopping + hours_cooking + 3 result = total_hours return result
Blake needs to order a set of custom-made mugs. He can order a pack of 4 fancy mugs for $28.00 and add rush delivery for an additional 30%. What is the cost of each mug with rush delivery added?
def solve() -> int: pack_price = 28.00 num_mugs = 4 rush_delivery = 0.30 total_cost = pack_price + (pack_price * rush_delivery) cost_per_mug = total_cost / num_mugs result = cost_per_mug return result
A recipe calls for 1/3 cup of flour, but you only have a 1/4 measuring cup. How many times do you have to fill the 1/4 measuring cup to get 1/3 cup of flour?
def solve() -> int: flour_required = 1/3 measuring_cup = 1/4 number_of_cups = flour_required / measuring_cup result = number_of_cups return result
Student: Estelle went to the mall and bought 4 shirts. The price of the first two shirts was double the price of the other two shirts. What was the price of a single shirt if she paid $48 in total?
def solve() -> int: price_of_first_two_shirts = 0 price_of_other_two_shirts = 0 total_price = 48 price_of_first_two_shirts = total_price / 2 price_of_other_two_shirts = price_of_first_two_shirts / 2 price_of_single_shirt = price_of_other_two_shirts result = price_of_single_shirt return ...
Tom had enough quarters and dimes, completely filling one jar. The jar had 5 quarters and 3 dimes. How many coins does Tom have in total?
def solve() -> int: quarters = 5 dimes = 3 total_coins = quarters + dimes result = total_coins return result
In a zoo, there are 10 monkeys and five more than triple as many gorillas as monkeys. Then, a group of 2 monkeys arrived at the zoo and joined the animals already there. If one less than 4 gorillas leave the zoo, how many more gorillas than monkeys remain in the zoo?
def solve() -> int: monkeys = 10 gorillas = (3 * monkeys) + 5 new_monkeys = monkeys + 2 gorillas_left = gorillas - (4 - 1) result = gorillas_left - new_monkeys result return result
A year has 365 days. How many days more than a year is 5 years?
def solve() -> int: days = 365 years = 5 result = days * years - days return result
Student: There are 60 students in a class. 45 are girls and the rest are boys. What percentage of the class are boys?
def solve() -> int: total_students = 60 girls = 45 boys = total_students - girls percentage_boys = (boys / total_students) * 100 result = percentage_boys return result
Robert is selling T-shirts. Each T-shirt costs him $4 in materials. If Robert sells each shirt for $15, how much money will he gain in all 32 shirts?
def solve() -> int: cost_of_t_shirt = 4 price_of_t_shirt = 15 number_of_t_shirts = 32 cost_to_make = cost_of_t_shirt * number_of_t_shirts revenue = number_of_t_shirts * price_of_t_shirt profit = revenue - cost_to_make result = profit return result
The perimeter of a square is 32 cm. What is the area of the square?
def solve() -> int: perimeter = 32 side_length = perimeter / 4 area = side_length ** 2 result = None return result
Here are some possible questions and programs: Amy runs a bakery that sells 200 loaves of bread a day. She buys the flour for $0.5 per kilogram and uses 0.4 kilograms per loaf. She sells each loaf for $3. She could sell 300 loaves a day if she had more oven space. How much profit does she miss out on a week by not bein...
def solve() -> int: flour_cost = 0.5 flour_usage = 0.4 bread_price = 3 current_sales = 200 potential_sales = 300 days = 7 profit_per_loaf = bread_price - flour_cost * flour_usage current_profit = current_sales * profit_per_loaf * days potential_profit = potential...
Student: Emily is saving up for a new bike. She currently has $150 and plans to save $25 per week until she reaches her goal. How much money will she have in 10 weeks?
def solve() -> int: current_money = 150 saving_rate = 25 goal = 300 weeks = 10 money_in_10_weeks = current_money + saving_rate * weeks result = money_in_10_weeks return result
Richard has saved up $587, if he manages to save up an additional $228, how much money would he have in total?
def solve() -> int: initial_amount = 587; additional_amount = 228; total_amount = initial_amount + additional_amount result = total_amount return result
Lily has a large jar of jelly beans. She estimates that there are about 500 jelly beans in the jar. She wants to share them with her four friends, so she gives each of them 10% of the jar. How many jelly beans does she have left for herself?
def solve() -> int: x = 500 result = x - 4 * 0.1 * x return result
Olivia shares a pizza with her friend Max. She cuts the pizza in thirds, then gives one piece to Max. If the pizza originally had 24 evenly spread slices of pepperoni, but 5 fell off the piece she gave Max, how many slices of pepperoni did Max get?
def solve() -> int: total_slices = 24 pieces_given_to_max = 1 fallen_slices = 5 slices_olivia_kept = total_slices - pieces_given_to_max slices_max_got = slices_olivia_kept - fallen_slices result = slices_max_got return result
Student: Ian runs a roadside fruit stand. On Saturday, he sold 25 oranges and 15 apples. On Sunday, he sold two-thirds the number of oranges and half the number of apples he sold on Saturday. How many fruits did Ian sell in total over the weekend?
def solve() -> int: oranges_sat = 25 apples_sat = 15 oranges_sun = oranges_sat * 2/3 apples_sun = apples_sat * 1/2 total_fruits = oranges_sat + apples_sat + oranges_sun + apples_sun result = total_fruits return result
If John runs 3 miles to the east and then 5 miles to the north in a field and his speed is 6 miles per hour, how long did it take him to complete the run?
def solve() -> int: distance = 3 + 5 speed = 6 time = distance/speed result = time return result
A recipe for 10 cupcakes calls for 1 and 1/4 cups of flour. If you want to make 36 cupcakes, how many cups of flour will you need?
def solve() -> int: flour_per_cupcake = 1.25 num_cupcakes = 36 flour_needed = flour_per_cupcake * num_cupcakes / 10 result = round(flour_needed, 2) return result
Jake graduated from high school 2 years earlier than his peers. It took him 5 times that duration to complete his bachelor's and Ph.D. How long did Jake spend in school?
def solve() -> int: years_in_high_school = 2 duration_bachelors_phd = 5 * years_in_high_school total_duration = years_in_high_school + duration_bachelors_phd result = total_duration return result
Lily has a jar of 120 jelly beans. She gives away 24 jelly beans to her brother, and then eats 20% of the remaining jelly beans. She counts that she has 42 red jelly beans left in the jar. What percentage of the original jelly beans were red?
def solve() -> int: jelly_beans_left = 120 - 24 jelly_beans_left = jelly_beans_left - 0.2 * jelly_beans_left red_percentage = 42 / jelly_beans_left original_red_percentage = red_percentage * 100 result = original_red_percentage return result
Lena wants to buy 3 packs of pencils and 4 packs of erasers for her school supplies. Each pack of pencils contains 12 pencils, and each pack of erasers contains 6 erasers. If each pencil costs $0.50 and each eraser costs $0.25, what is the total cost of Lena's school supplies?
def solve() -> int: pencils = 3*12*0.5 erasers = 4*6*0.25 total_cost = pencils + erasers result = total_cost return result
On the planet Relio, there are a total of 115 inhabitants. Out of them, 75 own a car. How many people do not own a car?
def solve() -> int: total_inhabitants = 115 inhabitants_owning_cars = 75 inhabitants_not_owning_cars = total_inhabitants - inhabitants_owning_cars result = inhabitants_not_owning_cars return result
Jason bought 156 movie tickets, if each costs 10$ and sales taxes was 8%, how much money did he spend in total?
def solve() -> int: total_cost = 156 * 10 taxes = total_cost * 0.08 total_cost = total_cost + taxes result = total_cost return result
Jackson deposited a $75 refund from a store in his bank account. The refund was worth one-third of his new balance after the refund money is added. What was the original amount of his balance before the refund?
def solve() -> int: refund = 75 new_balance = refund * 3 original_balance = new_balance - refund result = original_balance return result
A farmer has 1000 potatoes to distribute equally over his 20 fields. How many potatoes will each field get, and how many potatoes will be left over?
def solve() -> int: total_potatoes = 1000 total_fields = 20 potatoes_per_field = total_potatoes // total_fields leftover_potatoes = total_potatoes % total_fields result = potatoes_per_field return result
A museum had 1000 visitors on a particular day. On the second day, 500 visitors came to the museum, which was half as many as on the first day. On the third day, 300 more visitors came to the museum compared to the second day. What is the total number of visitors who came to the museum in the three days?
def solve() -> int: first_day = 1000 second_day = first_day / 2 third_day = second_day + 300 total_visitors = first_day + second_day + third_day result = total_visitors return result
Carlos worked for 7 years and 3 months as a teacher and 2 years and 9 months as a principal. How many months of work experience does he have total?
def solve() -> int: teacher_months = 7 * 12 + 3 principal_months = 2 * 12 + 9 total_months = teacher_months + principal_months result = total_months return result
Kelly has a car loan of $15,000 with a monthly interest rate of 6%. If she misses a payment, how much will her interest increase in the second month?
def solve() -> int: loan_amount = 15000 interest_rate = 0.06 missed_payment_penalty = 0.02 first_month_interest = loan_amount * interest_rate second_month_interest = first_month_interest + (first_month_interest * missed_payment_penalty) result = second_month_interest return re...
A recipe calls for 3/4 cups of sugar. If you want to make half of the recipe, how many cups of sugar do you need?
def solve() -> int: sugar = 0.75 portion = 0.5 new_sugar = sugar * portion result = new_sugar return result
Mike has a 24-week summer break. Every weekday, he runs up the stairs of his school building 6 times. He runs up the stairs 7 times on Saturdays and 8 times on Sundays. How many times does Mike run up the stairs in total over the summer?
def solve() -> int: no_of_weeks = 24 days_in_week = 7 daily_stairs = 6 Saturdays_stairs = 7 Sundays_stairs = 8 total_stairs = (daily_stairs * (no_of_weeks * (days_in_week - 2))) + (Saturdays_stairs * (no_of_weeks)) + (Sundays_stairs * (no_of_weeks)) result = total_st...
Jenny has collected 24 stickers for completing her homework. Out of these 24 stickers, 8 were taken away by her younger brother. How many stickers does Jenny have now?
def solve() -> int: stickers_collected = 24 stickers_taken = 8 result = stickers_collected - stickers_taken return result
A bag contains 120 marbles, of which 25% are red. How many marbles are not red?
def solve() -> int: total_marbles = 120 red_marbles = total_marbles * 0.25 not_red_marbles = total_marbles - red_marbles result = not_red_marbles return result
If Jason's car travels an average speed of 30 miles per hour for 6 hours, how many miles did it travel?
def solve() -> int: speed = 30 hr_journey = 6 distance = speed * hr_journey result = distance return result
Student: A farmer is trying to decide how many pigs to buy for his farm. If each pig consumes 3 lbs of feed every day, and the farmer has 500 lbs of feed, how many pigs can the farmer buy for a 3 month period?
def solve() -> int: feed_per_pig = 3 total_feed = 500 num_months = 3 daily_feed_consumption = feed_per_pig * total_feed total_feed_consumption = daily_feed_consumption * num_months num_pigs = total_feed / feed_per_pig result = num_pigs return result
Student: The ratio of men to women in a club is 2:3. If there are 60 more women than men, how many members are in the club?
def solve() -> int: men = 0 women = 0 women = 60 + men men = women / 5 * 2 total_members = men + women result = total_members return result
Student: Josh has 9 boxes of apples and each box has 15 apples. How many apples does Josh have in total?
def solve() -> int: boxes = 9 apples_per_box = 15 total_apples = boxes * apples_per_box result = total_apples return result
Maya is working at the reception desk at a hotel. There were 25 people in the lobby when she started working. Then 6 more people came in and 5 people left. Now there are 26 people in the lobby. How many people left the hotel lobby?
def solve() -> int: start_people = 25 new_people = 6 left_people = 5 current_people = 26 total_people = start_people + new_people - left_people left_hotel = total_people - current_people result = left_hotel return result
1. Eliza drove 640 miles for work last week. For each day she worked, she was paid $64. How much did Eliza earn last week?
def solve() -> int: mileage = 640 daily_pay = 64 daily_pay_total = mileage * daily_pay result = daily_pay_total return result
2. Maria has 8 boxes of apples, each box has 7 apples. How many apples does she have in total?
def solve() -> int: num_boxes = 8 num_apples = 7 total_apples = num_boxes * num_apples result = total_apples return result
Sofia is taking a plant census in a park. On the first day, she recorded 32 trees and 45 bushes. On the second day, she counted 12 flower plants and their respective buds. On the third day, she recorded half the number of trees from the first day and twice as many bushes. How many plants did Sofia count in total?
def solve() -> int: trees_first_day = 32 bushes_first_day = 45 trees_second_day = trees_first_day / 2 bushes_second_day = bushes_first_day * 2 flower_plants_second_day = 12 buds_second_day = flower_plants_second_day total_plants = trees_first_day + bushes_first_day + trees_sec...
Student: In a factory, it takes 6 hours to make 9 boxes. How much time will be required to make 21 boxes?
def solve() -> int: time_required = 0 boxes_made = 9 time_taken = 6 boxes_needed = 21 time_required = (boxes_needed / boxes_made) * time_taken result = time_required return result
Tom has six packs of pencils. Each pack has 12 pencils. If he gives two packs to his friend, how many pencils does he have left?
def solve() -> int: packs_of_pencils = 6 pencils_per_pack = 12 total_pencils = packs_of_pencils * pencils_per_pack packs_given_to_friend = 2 pencils_left = total_pencils - (packs_given_to_friend * pencils_per_pack) result = pencils_left return result
``` Max bought 1200 bananas for $600. He sold them in groups of 50 for $1.75 each. How many bananas would he have to sell to make a profit of $200?
def solve() -> int: buy_price = 600 num_bananas = 1200 sell_price = 1.75*50 cost_per_banana = buy_price/num_bananas sell_per_banana = sell_price/50 num_sell_bananas = (buy_price+200)/(sell_per_banana - cost_per_banana) result = int(num_sell_bananas) return result
Possible answer: In a bakery, there is a discount on pastries. Every muffin costs $2, every croissant $3, and every pie $8. How much do you need to pay for four muffins, six croissants, and two pies?
def solve() -> int: muffin_price = 2 croissant_price = 3 pie_price = 8 muffin_quantity = 4 croissant_quantity = 6 pie_quantity = 2 total_cost = (muffin_price * muffin_quantity) + (croissant_price * croissant_quantity) + (pie_price * pie_quantity) result = total_cost ...
Felix has 8 red balls, 6 green balls and 4 blue balls. If he gives away 3 balls, how many different choices of colours are there?
def solve() -> int: red_balls = 8 green_balls = 6 blue_balls = 4 balls_given_away = 3 choices_of_colours = (red_balls + green_balls + blue_balls) - balls_given_away result = choices_of_colours return result
If it takes 4 people 3 hours to construct a house, how long will it take 6 people to construct the same house?
def solve() -> int: people1 = 4 time1 = 3 people2 = 6 time2 = (people1 * time1) / people2 result = time2 return result
Emily had 3 times as many books as Ella. But Ella had a third as many books as Liam. And Liam had 10 times as many books as Mia. If Emily had 270 books, how many books did Mia have?
def solve() -> int: emily = 270 ella = emily/3 liam = ella*3 mia = liam/10 result = mia return result
Student: There are 10 tables at a restaurant, and each table can seat 4 people. How many people can be served at the restaurant?
def solve() -> int: num_tables = 10 num_people_per_table = 4 total_num_people = num_tables * num_people_per_table result = total_num_people return result
On a basketball team, there are 10 players. Each player scored 5 points in the game. What was the total score of the team?
def solve() -> int: players = 10 points_per_player = 5 team_score = players * points_per_player result = team_score return result
A car can travel 24 miles per gallon of gasoline. If the car has a full tank of 12 gallons, how far can the car travel?
def solve() -> int: miles_per_gallon = 24 num_gallons = 12 total_distance = miles_per_gallon * num_gallons result = total_distance return result
A pencil weighs 10 grams and a pen weighs 20 grams more than a pencil. If a box contains 50 pencils and 30 pens, and a carton contains 10 boxes, what is the total weight of the carton in kilograms?
def solve() -> int: pencil = 10 pen = pencil + 20 box = 50 * pencil + 30 * pen carton = 10 * box carton = carton / 1000 result = carton return result
Grace has 5 jars of honey. The jars contain the following volumes of honey: 500 milliliters, 250 milliliters, 1 liter, 750 milliliters, 125 milliliters. How many liters of honey does Grace have in total?
def solve() -> int: volume1 = 500/1000 volume2 = 250/1000 volume3 = 1 volume4 = 750/1000 volume5 = 125/1000 total = volume1 + volume2 + volume3 + volume4 + volume5 result = total return result
Student: Suzie has a backpack that can carry up to 32kg. She has packed her things and currently her backpack weighs 17.5kg. How much load can she still add into the backpack?
def solve() -> int: max_weight = 32 current_weight = 17.5 remaining_weight = max_weight - current_weight result = remaining_weight return result
A construction company spent $1,000,000 per building for the first project and four times as much for every other project. The first building had 2 floors, and every building after that had 50% more floors except the last building, which had 6 floors. The company built 4 buildings. How much did the company spend on all...
def solve() -> int: first_building_cost = 1000000 other_building_cost = 4 * first_building_cost first_building_floors = 2 other_building_floors = first_building_floors * 1.5 last_building_floors = 6 total_cost = (first_building_cost * first_building_floors) + (other_building_cost ...
A car uses 7 liters of gasoline for every 100 kilometers it travels. If the car is driven for 500 kilometers, how many liters of gasoline will it use?
def solve() -> int: fuel_consumption = 7 distance_traveled = 500 fuel_used = fuel_consumption / 100 * distance_traveled result = fuel_used return result
A recipe calls for 2 cups of sugar and 3 cups of flour to make a cake. If Mary wants to make 4 cakes, how much sugar and flour will she need? Sugar costs $3 per cup and flour costs $2 per cup, how much will Mary spend on sugar and flour?
def solve() -> int: sugar = 2 * 4 flour = 3 * 4 price_sugar = sugar * 3 price_flour = flour * 2 total_price = price_sugar + price_flour result = total_price return result
A car travels 200 km in 4 hours. Then it stops for an hour to refuel. After that, it travels 300 km in 5 hours. What is the average speed of the car in km/h?
def solve() -> int: distance1 = 200 time1 = 4 distance2 = 300 time2 = 5 total_distance = distance1 + distance2 total_time = time1 + time2 + 1 average_speed = total_distance / total_time result = average_speed return result
Dylan has 144 crayons. He wants to give 18 crayons to each of his 8 friends. How many crayons are left after Dylan gives them away?
def solve() -> int: total_crayons = 144 crayons_per_friend = 18 friends = 8 given_crayons = friends * crayons_per_friend leftover_crayons = total_crayons - given_crayons result = leftover_crayons return result
Student: Question10: A box contains 2 red marbles, 5 blue marbles, and 3 green marbles. We randomly draw 3 marbles without replacement. What is the probability of getting 1 red marble and 2 blue marbles?
def solve() -> int: total = 2 + 5 + 3 red_blue = 2 * 5 * 4 any_three = total * (total - 1) * (total - 2) probability = red_blue / any_three result = probability return result