question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
John can mow a lawn in 2 hours and charges $40. How much would he earn if he mowed 4 lawns a day?
def solve() -> int: hours_per_lawn = 2 cost_per_lawn = 40.00 number_of_lawns = 4 hours_per_day = 8 total_earned = (number_of_lawns * cost_per_lawn) * (hours_per_day / hours_per_lawn) result = total_earned return result
What should be the average of two numbers 22 and 33 to make their sum equal to 54?
def solve() -> int: num1 = 22 num2 = 33 required_avg = (2 * 54 - num1 - num2)/2 result = required_avg return result
Rachel needs to buy a new computer that costs $2,500. Her parents offered to pay 20% of the cost, and Rachel can receive a scholarship of $700 and a loan that is 3 times her scholarship amount. If Rachel can only afford to pay up to $1,000, how many hours does she need to work a part-time job that pays $8 per hour to c...
def solve() -> int: cost_of_computer = 2500 parents_payment = cost_of_computer * 0.2 scholarship = 700 loan = scholarship * 3 affordable_payment = 1000 remaining_cost = cost_of_computer - parents_payment - scholarship - loan hours_needed = remaining_cost / 8 result = hours_need...
Michael drove from his house to his workplace which is 7 miles away. After work, he met his friends 3 miles away from his workplace. What is the total distance Michael traveled that day?
def solve() -> int: distance_to_work = 7 distance_to_friends = 3 total_distance = distance_to_work + distance_to_friends + distance_to_work result = total_distance return result
You have a jar with 50 marbles, 20 of which are red and the rest are blue. What is the probability of picking a red marble from the jar at random?
def solve() -> int: num_red_marbles = 20 total_marbles = 50 probability_red = num_red_marbles / total_marbles result = f'<<<{probability_red}>>>' result = probability_red return result
Jack is building a triangular tent out of bamboo sticks with 4 levels where the bottom level has 6 sticks per side and each level has three less sticks per side than the level below it. How many sticks total will he need?
def solve() -> int: levels = 4 bottom_level_sticks = 6 total_sticks = 0 for level in range(levels): level_sticks = bottom_level_sticks - (3 * level) total_sticks += level_sticks result = total_sticks return result
A company charges $6 per unit for the first 500 units and $4 per unit for any extra units. If Ryan buys 700 units, what is the total cost to him?
def solve() -> int: total_units = 700 cost_for_500_units = 6 * 500 extra_units = total_units - 500 cost_for_extra_units = 4 * extra_units total_cost = cost_for_500_units + cost_for_extra_units result = total_cost return result
Two planes, one named Delta and the other named United, take off from the same airport, flying in opposite directions. Delta flies at an average speed of 500 miles per hour, while United flies at an average speed of 400 miles per hour. If United stops to refuel after three hours in the air, for how long can it remain g...
def solve() -> int: delta_speed = 500 united_speed = 400 united_refuel_time = 3 delta_distance = delta_speed * united_refuel_time delta_time = delta_distance / united_speed result = delta_time return result
A store sells apple juice for $2 per bottle. If you buy 10 bottles, you get a 20% discount. How much will you pay for 14 bottles?
def solve() -> int: price_per_bottle = 2 discount_percentage = 20 number_of_bottles = 14 if number_of_bottles < 10: total_price = number_of_bottles * price_per_bottle else: total_price = number_of_bottles * (price_per_bottle * (100 - discount_percentage)/100) result = total_...
If a door is 7 feet tall and 3 feet wide, what is the perimeter of the door?
def solve() -> int: height = 7 width = 3 perimeter = 2 * (height + width) result = perimeter return result
A car travels at a constant speed of 60 km/h for 2 hours, then at 80 km/h for 1.5 hours, and then at 50 km/h for 1 hour. How far does the car travel in total?
def solve() -> int: speed_1 = 60 speed_2 = 80 speed_3 = 50 time_1 = 2 time_2 = 1.5 time_3 = 1 distance_1 = speed_1 * time_1 distance_2 = speed_2 * time_2 distance_3 = speed_3 * time_3 total_distance = distance_1 + distance_2 + distance_3 result = total_distance r...
Student: A company had a profit of $150,000 this year. If the revenue was $800,000, what was the profit margin?
def solve() -> int: revenue = 800000 profit = 150000 profit_margin = profit / revenue result = profit_margin return result
am saved up $900 from working this summer, and decided to buy $3.50 Movie Tickets for as many films as possible. If each ticket costs $3.50, how many movies can Sam watch?
def solve() -> int: total_money = 900 ticket_price = 3.50 tickets_bought = total_money // ticket_price movies_watched = tickets_bought // 1 result = movies_watched return result
Zoe has 15 marbles. She gives away 3/5 of her marbles to her friend. Then, her friend gives her 2/3 of the marbles. How many marbles does Zoe have now?
def solve() -> int: zoe_marbles = 15 friend_marbles = zoe_marbles * 3/5 zoe_marbles += friend_marbles * 2/3 result = zoe_marbles return result
Student: A store offers a discount of 10% on all items. If a customer buys items worth $500, how much money will he save?
def solve() -> int: discount_rate = 0.1 item_price = 500 discount_amount = item_price * discount_rate result = discount_amount return result
A museum can accommodate 80 visitors per hour. If they operate for 8 hours in a day, how many visitors can they accommodate in total?
def solve() -> int: visitors_per_hour = 80 hours_per_day = 8 total_visitors = visitors_per_hour * hours_per_day result = total_visitors return result
Student: In a graph drawing challenge, an ellipse was asked to be drawn with a width of 5cm and a height of 10cm. What is the ratio of the width to the height?
def solve() -> int: width = 5 height = 10 ratio = width / height result = ratio return result
Khalil filled a container with 72 pieces of candy. He then used 18 pieces to make a bracelet. How many pieces are left in the container?
def solve() -> int: candy_total = 72 candy_used = 18 candy_left = candy_total - candy_used result = candy_left return result
In a game, a player scored 23, 45, and 62 points in three rounds. What is the total score of the player?
def solve() -> int: score1 = 23 score2 = 45 score3 = 62 total_score = score1 + score2 + score3 result = total_score return result
A recipe calls for 1/2 cup of sugar, and you want to make 3/4 of the recipe. How much sugar will you need?
def solve() -> int: sugar_per_full_recipe = 0.5 recipe_scale = 0.75 sugar_needed = sugar_per_full_recipe * recipe_scale result = sugar_needed return result
A restaurant has 100 chairs and 25 tables. If they need 1 table for every 4 chairs, how many chairs are left in the restaurant?
def solve() -> int: total_chairs = 100 tables = 25 chairs_per_table = 4 needed_tables = total_chairs // chairs_per_table leftover_chairs = total_chairs - (needed_tables * chairs_per_table) result = leftover_chairs return result
Student: Sally gets paid $10 for the first 20 hours of work, after which she gets paid $15 for every hour she works. How much does Sally get paid for a 30-hour workweek?
def solve() -> int: hourly_rate1 = 10 hourly_rate2 = 15 hours_worked1 = 20 hours_worked2 = 10 total_pay = (hourly_rate1 * hours_worked1) + (hourly_rate2 * hours_worked2) result = total_pay return result
Kaitlyn, Isabella, and Emma ordered 110 hot dogs from a vendor. Isabella and Emma each ate four times as many hot dogs as Kaitlyn. How many hot dogs did Kaitlyn eat?
def solve() -> int: x = 110 / 9 result = f'<<<{x}>>>' return result
A recipe needs 4 cups of flour for 8 servings. Kim wants to make 12 servings of the recipe. How many cups of flour does she need?
def solve() -> int: cups_per_serving = 4/8 total_cups = cups_per_serving * 12 result = total_cups return result
Lily and Max are baking cookies for a fundraiser. Lily can bake 24 cookies in one hour, while Max can bake 18 cookies in one hour. Lily baked for 3 hours and Max baked for 4 hours. How many cookies did they bake in total?
def solve() -> int: cookies_lily = 24 * 3 cookies_max = 18 * 4 total = cookies_lily + cookies_max result = total return result
Student: John has 5 shirts with the following prices: $10, $15, $20, $25, and $30. What is the average price of one shirt?
def solve() -> int: shirt1 = 10 shirt2 = 15 shirt3 = 20 shirt4 = 25 shirt5 = 30 total_price = shirt1 + shirt2 + shirt3 + shirt4 + shirt5 num_shirts = 5 average_price = total_price / num_shirts result = average_price return result
A coat is on sale for 20% off its original price of $240. What is the final sale price of the coat?
def solve() -> int: original_price = 240 discount_percent = 20 discount_amount = original_price * (discount_percent / 100) sale_price = original_price - discount_amount result = sale_price return result
A trader bought 1000 shares of a company at $10 per share. If he sold half of the shares at $15 per share and the remaining half at $8 per share, what was the trader's total profit or loss?
def solve() -> int: number_of_shares = 1000 buy_price_per_share = 10 sell_price_first_half = 15 sell_price_second_half = 8 total_buy_price = number_of_shares * buy_price_per_share total_sell_price = (number_of_shares/2 * sell_price_first_half) + (number_of_shares/2 * sell_price_second_half) ...
In Katie's book club, there are 12 members. They decided to contribute $25 each for a trip to a book fair. All members paid except for 2, who paid only $10 each. How much did the group raise in total?
def solve() -> int: members = 12 contribution_per_member = 25 partial_contribution_per_member = 10 total_contribution = (members - 2) * contribution_per_member + 2 * partial_contribution_per_member result = total_contribution return result
A train travels a distance of 120 km in 2 hours and 45 minutes. What is its average speed in km/h?
def solve() -> int: distance = 120 time = 2.75 average_speed = distance / time result = average_speed return result
Ana bought 18 packets of seeds. Each packet contains 10 seeds and each seed cost $0.09. She then bought 5 gardening tools which cost $8 each. How much did Ana spend in total?
def solve() -> int: seed_packet = 10 number_packets = 18 price_per_seed = 0.09 number_tools = 5 price_per_tool = 8 seed_cost = seed_packet * number_packets * price_per_seed tool_cost = number_tools * price_per_tool result = seed_cost + tool_cost return result
A train travels 200 miles in 4 hours. At the same speed, how far would it travel in 10 hours?
def solve() -> int: distance = 200 time1 = 4 time2 = 10 speed = distance / time1 new_distance = speed * time2 result = new_distance return result
If 3 horses can eat 60kg of hay in 6 days, how many kilograms of hay will 5 horses eat in 12 days?
def solve() -> int: horse_hay_ratio = 60/(3*6) total_hay = 5*horse_hay_ratio*12 result = total_hay return result
Student: A company sells 500 units of a product at $20 per unit. If the company's total costs are $6000, what is the company's profit?
def solve() -> int: units_sold = 500 price_per_unit = 20 total_revenue = units_sold * price_per_unit total_costs = 6000 profit = total_revenue - total_costs result = profit return result
Jeff has 5 dimes and 9 pennies. What is the total value of all of the coins in cents?
def solve() -> int: coins = 14 dimes = 5 pennies = 9 cents_in_pennies = pennies * 1 cents_in_dimes = dimes * 10 result = cents_in_pennies + cents_in_dimes return result
Sarah runs 5 miles every day, but on the weekends she runs 1/2 mile less. If there are 4 weekends in a month, how many miles does she run in a month?
def solve() -> int: miles_weekday = 5 miles_weekend = 5 - 0.5 total_days_in_month = 30 total_weekends_in_month = 4 total_weekdays_in_month = total_days_in_month - (total_weekends_in_month * 2) total_miles_in_month = (miles_weekday * total_weekdays_in_month) + (miles_weekend * total_weekends_in_m...
Student: Jim is a carpenter who charges $45 per hour for his labor and $20 per square foot for the materials he uses. He was hired to build a rectangular deck that is 12 feet long and 8 feet wide. How much did Jim earn from this project?
def solve() -> int: hourly_rate = 45 material_rate = 20 length = 12 width = 8 area = length * width total_material_cost = area * material_rate total_labor_cost = hourly_rate * 8 result = total_material_cost + total_labor_cost return result
Sophia is renting an apartment. The landlord charges $1400/month or $450/week. If Sophia plans to stay for 3 months, each with exactly 4 weeks, how much money does she save by paying monthly?
def solve() -> int: monthly_cost = 1400 weekly_cost = 450 months = 3 weeks_per_month = 4 total_cost_monthly = monthly_cost * months total_cost_weekly = weekly_cost * weeks_per_month * months savings = total_cost_weekly - total_cost_monthly result = savings return resul...
Isabella has 70 seashells. 20% of her seashells are conch shells. She wants to use a fifth of her conch shells in a decoration. If each conch shell measures 8 inches, how much total length of conch shells will she use in her decoration?
def solve() -> int: total_seashells = 70 conch_percentage = 20 conch_shells = (conch_percentage / 100) * total_seashells decor_conch_shells = conch_shells / 5 conch_length = decor_conch_shells * 8 result = conch_length return result
A pool is 10 meters long, 8 meters wide and 2 meters deep. If 3/5 of the pool is filled with water, how many cubic meters of water are in the pool?
def solve() -> int: length = 10 width = 8 depth = 2 pool_volume = length * width * depth water_fill_percent = 0.6 water_volume = pool_volume * water_fill_percent result = water_volume return result
Student: A farmer has 120 cows. If 34 of them are brown cattle, 12 of them are black cattle, and the remaining are white, what percent of cows are white?
def solve() -> int: total_cows = 120 brown_cows = 34 black_cows = 12 white_cows = total_cows - brown_cows - black_cows white_percent = (white_cows / total_cows) * 100 result = white_percent return result
Lucy is baking cupcakes. She can fit 12 cupcakes in each tray. She needs to bake 80 cupcakes. How many trays does she need?
def solve() -> int: total_cupcakes = 80 cupcakes_per_tray = 12 number_trays = total_cupcakes/cupcakes_per_tray result = number_trays return result
Jake scored three more goals today than yesterday. Yesterday, he scored four goals. How many goals did Jake score in a week?
def solve() -> int: today_goals = 4 + 3 two_days_goals = today_goals + 4 week_goals = round(two_days_goals * 3.5) result = week_goals return result
Chris is making decorations for her birthday party. She spent $7 on balloons, $14 on streamers and $4 on confetti. If she sells each decoration for $6, and made 15 decorations for the party, what was her total profit?
def solve() -> int: balloon_cost = 7 streamers_cost = 14 confetti_cost = 4 decoration_price = 6 num_decorations = 15 total_cost = balloon_cost + streamers_cost + confetti_cost total_revenue = decoration_price * num_decorations profit = total_revenue - total_cost result = pr...
A rectangular tank has dimensions 5m x 8m x 10m. If the tank is 60% full of water, how many cubic meters of water are in the tank?
def solve() -> int: length = 5 width = 8 height = 10 volume = length * width * height percent_full = 60/100 water_volume = volume * percent_full result = water_volume return result
Ahmed is 4 years older than Saeed. In 8 years, Ahmed will be 32 years old. How old is Saeed now?
def solve() -> int: ahmed_age = 32 - 8 saeed_age = ahmed_age - 4 result = saeed_age return result
A birthday party is planned for a child. Each child guest can bring one parent. Two-thirds of the total number of guests will be children. Two clowns and half as many magicians will also be present. If there are 24 child guests, how many chairs must be prepared for the party?
def solve() -> int: child_guests = 24 total_guests = child_guests + child_guests // 2 + 2 + (child_guests // 2) // 2 chairs_needed = total_guests result = chairs_needed return result
Lily has three bottles of juice with 500 ml in each bottle. She pours 200 ml of juice from one bottle into a glass and drinks it. Then she fills the empty glass with 100 ml of water and pours it back into the same bottle. She repeats this process with another bottle. How much juice does she have left in total?
def solve() -> int: bottle_1 = 300 bottle_2 = 500 bottle_3 = 500 bottle_1 = bottle_1 + 0.1 * 100 bottle_2 = 300 + 0.1 * 100 bottle_3 = 500 total_juice = bottle_1 + bottle_2 + bottle_3 result = total_juice return result
A recipe calls for 3/4 cup of sugar, but you only have a 1/3 cup measuring cup. How many times do you need to fill the measuring cup to get the needed amount of sugar?
def solve() -> int: needed_amount = 3/4 measuring_cup = 1/3 fill_times = needed_amount/measuring_cup result = fill_times return result
Kevin wants to paint his room with two different colors, blue and yellow. He needs 3 gallons of blue paint and 2 gallons of yellow paint. The blue paint costs $15 per gallon and the yellow paint costs $18 per gallon. He also needs to buy a pack of brushes for $10 and a roll of tape for $3. How much does Kevin need to s...
def solve() -> int: blue_paint = 3 yellow_paint = 2 blue_cost = 15 yellow_cost = 18 brushes = 10 tape = 3 total_cost = blue_paint * blue_cost + yellow_paint * yellow_cost + brushes + tape result = total_cost return result
Grace has four nephews. Her youngest nephew is 4 years older than a quarter of Grace's age. Her second youngest nephew is 3 years older than the youngest nephew. Her second oldest nephew is twice the age of the second youngest nephew. Her oldest nephew is 1 year younger than the sum of the ages of the other three nephe...
def solve() -> int: grace = 32 youngest = 4 + grace // 4 second_youngest = 3 + youngest second_oldest = 2 * second_youngest oldest = (youngest + second_youngest + second_oldest) - 1 combined = grace + youngest + second_youngest + second_oldest + oldest result = combined return resul...
A city block has 30 parking spaces. How many wheels would be needed to fill the block?
def solve() -> int: s = 30 result = s * 4 return result
If a car can travel 240 miles on 12 gallons of gas, how far can it travel on 8 gallons?
def solve() -> int: miles = 240 gallons = 12 new_gallons = 8 result = (miles / gallons) * new_gallons return result
Student: John invested his savings in three different bank accounts. The first bank account had an interest rate of 10%, the second bank account had an interest rate of 12%, and the third bank account had an interest rate of 15%. If John invested $10,000 in the first bank account, $12,000 in the second bank account, an...
def solve() -> int: amount_1 = 10000 amount_2 = 12000 amount_3 = 8000 interest_1 = 0.1 interest_2 = 0.12 interest_3 = 0.15 interest_earned_1 = amount_1 * interest_1 interest_earned_2 = amount_2 * interest_2 interest_earned_3 = amount_3 * interest_3 total_interest_earned = interes...
Susan walks 2 miles to her local grocery store. On her workout days, she walks an additional 10 miles on a hiking trail. How many miles does she walk every week?
def solve() -> int: grocery_distance = 2 workout_distance = 10 workout_days = 3 total_distance = grocery_distance + (workout_distance * workout_days) result = total_distance return result
A train travels 120 miles at an average speed of 60 miles per hour. How long did the journey take?
def solve() -> int: distance = 120 speed = 60 time = distance / speed result = time return result
Possible questions: Lisa baked 12 cupcakes and 8 muffins. She sold each cupcake for $1.50 and each muffin for $2.00. How much money did she make in total?
def solve() -> int: cupcake_sales = 12 * 1.50 muffin_sales = 8 * 2.00 total_money = cupcake_sales + muffin_sales result = total_money return result
A student has 5 math assignments due in 15 days. What is the number of days the student has per assignment if he wants to complete all the assignments on time?
def solve() -> int: total_number_of_days = 15 number_of_assignments = 5 days_per_assignment = total_number_of_days / number_of_assignments result = days_per_assignment return result
A car travels at an average speed of 50 km/h. If the car travels for 4 hours, how many kilometers will it have covered during that time interval?
def solve() -> int: average_speed = 50 time = 4 distance = average_speed * time result = distance return result
A group of friends decided to save money for a school trip. John contributes $25 every week while Sarah contributes $30 every week. After 5 months of saving, they decided to divide half of their savings equally among their 10 classmates. How much will each classmate receive?
def solve() -> int: weeks = 5 * 4 john_contribution = 25 sarah_contribution = 30 total_savings = (john_contribution + sarah_contribution) * weeks half_savings = total_savings / 2 each_classmate = half_savings / 10 result = each_classmate return result
Steven is buying bottles of water for a marathon. The first pack has half as many bottles as the second pack. The third pack has five times as many bottles as the first pack. If he bought 60 bottles for the third pack, how many bottles did he buy for the second pack?
def solve() -> int: first_pack = 60/5 second_pack = 2*first_pack result = second_pack return result
Rachel is baking cookies for her coworkers. She knows that Gary eats 1/3 of a cookie, Ana eats 1/4 of a cookie, and Dan eats 1/6 of a cookie. How many cookies should Rachel bake?
def solve() -> int: total_cookies = 0 total_cookies += 1 / (1/3) total_cookies += 1 / (1/4) total_cookies += 1 / (1/6) total_cookies = round(total_cookies) result = total_cookies return result
Lisa earns $15 per hour as a cashier. She works 6 hours per day for 5 days per week. How much money does she earn in a month if there are 4 weeks in a month?
def solve() -> int: hourly_rate = 15 hours_per_day = 6 days_per_week = 5 weeks_per_month = 4 weekly_earnings = hourly_rate * hours_per_day * days_per_week monthly_earnings = weekly_earnings * weeks_per_month result = monthly_earnings return result
Student: There are 20 more students in Grade 8 than in Grade 7. If there are 85 students in Grade 7, how many students are in Grade 8?
def solve() -> int: grade7 = 85 grade8 = grade7 + 20 result = grade8 return result
There were 4 oranges and 6 apples in the box. If Larry takes 3 apples, what percentage of the remaining fruit is oranges?
def solve() -> int: total_fruit = 4 + 6 oranges = 4 apples = 6 taken_apples = 3 remaining_apples = apples - taken_apples remaining_fruit = remaining_apples + oranges percentage_oranges = oranges / remaining_fruit result = percentage_oranges return result
A runner runs 5 kilometers in 25 minutes. What is the runner's average speed in kilometers per hour?
def solve() -> int: distance = 5 time = 25/60 speed = distance/time speed_in_kmh = speed * 60 result = speed_in_kmh return result
Victor runs at 9 miles/hour and wants to reach a point that is 18 miles away. His bike can go 16 miles/hour. He goes one-third by bike and the rest by running. How much time does it take him to reach the point?
def solve() -> int: distance = 18 speed_of_victor_running = 9 speed_of_victor_bike = 16 distance_covered_by_bike = distance / 3 distance_covered_by_running = distance * 2 / 3 time_of_biking = distance_covered_by_bike / speed_of_victor_bike time_of_running = distance_covered_by_running / spee...
Student: Sam bought a $6 pizza and a drink which cost $1 less than a fifth of the pizza price. If he bought 3 pizzas and 2 drinks, how much did Sam pay in all?
def solve() -> int: pizza_price = 6 drink_price = (1/5)*pizza_price - 1 total_cost = (3*pizza_price) + (2*drink_price) result = total_cost return result
Jackson's parents gave him a new car for his graduation. The car was worth $15,000, and Jacksons paid 20% of the car's price. How much money did Jackson's parents have to pay for the car?
def solve() -> int: car_price = 15000 payed_by_Jackson = car_price * 0.2 payed_by_Jacksons_parents = car_price - payed_by_Jackson result = payed_by_Jacksons_parents return result
Student: Brian has 20 boxes of crayons, each with 24 crayons. 5/6 of the crayons in 6 boxes were used and 1/3 of the crayons in the other 14 boxes were used. How many unused crayons does Brian have?
def solve() -> int: num_boxes = 20 num_crayons_per_box = 24 num_used_crayons_in_6_boxes = 5/6 * 6 * num_crayons_per_box num_used_crayons_in_14_boxes = 1/3 * 14 * num_crayons_per_box total_used_crayons = num_used_crayons_in_6_boxes + num_used_crayons_in_14_boxes total_crayons = num_boxes * num_cr...
During a basketball match, 18 out of 24 players scored two or more points. 4/9 of the remaining players scored a single point. How many players scored no points?
def solve() -> int: total_players = 24 over2_points = 18 remainder = total_players - over2_points earned1_point = int(remainder * 4 / 9) no_points = remainder - earned1_point result = no_points return result
Bob is buying pencils for his class. He needs 20 pencils for each student and there are 15 students in his class. The store sells pencils in packs of 12 for $2 each. Bob has a coupon that gives him a 10% discount on his purchase. How much does Bob pay for the pencils?
def solve() -> int: pencils_per_student = 20 students = 15 pack_size = 12 pack_price = 2 discount = 0.1 packs_needed = (pencils_per_student * students + pack_size - 1) // pack_size original_price = packs_needed * pack_price discounted_price = original_price * (1 - discount) r...
Student: A teacher records 900 student tests and 15% of the tests are faulty. Half of the faulty tests are marked as wrong. How many student tests are marked as wrong?
def solve() -> int: total_tests = 900 faulty_tests = total_tests * 0.15 wrong_faulty_tests = faulty_tests * 0.5 marked_wrong_tests = wrong_faulty_tests + (total_tests * 0.85 * 0.5) result = marked_wrong_tests return result
Sam has 3 bags of candy that contain 12, 15, and 10 pieces respectively. He wants to share them equally with his 4 friends. How many pieces of candy does each friend get?
def solve() -> int: bags = 3 candy1 = 12 candy2 = 15 candy3 = 10 friends = 4 total_candy = candy1 + candy2 + candy3 candy_per_friend = total_candy / friends result = candy_per_friend return result
A jar has 120 jelly beans. Sarah ate 1/6 of them and then gave 2/3 of the remaining jelly beans to her brother. How many jelly beans are left in the jar?
def solve() -> int: num_jelly_beans = 120 eaten_beans = num_jelly_beans * 1/6 remaining_beans = num_jelly_beans - eaten_beans given_beans = remaining_beans * 2/3 remaining_beans -= given_beans result = remaining_beans return result
Student: Karen has 24 stickers and one sixth of them are star-shaped. How many star-shaped stickers does Karen have?
def solve() -> int: stickers = 24 fraction = 1/6 star_stickers = stickers * fraction result = star_stickers return result
John has $800 in savings. Every week, he saves $50. After 6 weeks, John spends $250. How much money does he have left in savings?
def solve() -> int: start_savings = 800 weekly_savings = 50 num_weeks = 6 spending = 250 savings = start_savings + weekly_savings*num_weeks - spending result = savings return result
Dad cooked 100 dumplings. He gave 20 dumplings to Amy, 15 dumplings to Ben, and put some in the freezer. If he gave four times as many dumplings to Chris as he did to Amy, how many dumplings did Dad put in the freezer?
def solve() -> int: dumplings_cooked = 100 dumplings_given_amy = 20 dumplings_given_ben = 15 dumplings_given_chris = 4 * dumplings_given_amy dumplings_in_freezer = dumplings_cooked - dumplings_given_amy - dumplings_given_ben - dumplings_given_chris result = dumplings_in_freezer ...
- Max has 12 candies. Every hour, he eats one candy, but he finds two more in his pockets. How many candies will he have in four hours?
def solve() -> int: candies = 12 for i in range(4): candies -= 1 candies += 2 result = candies return result
Jennifer swims 2 km every day from Monday to Friday. She swims an additional 1 km to return home. Last Friday, her swimming coach asked her to swim another 0.7 km to improve her endurance. How many kilometers did Jennifer swim that week? Lena loves to go on cycling adventures. She cycles 30 km from her home to the outs...
def solve() -> int: daily_swim = 2 extra_swim = 0.7 total_swim = (daily_swim * 5) + extra_swim + 1 to_outskirts = 30 to_waterfall = 150 to_foothills = (to_outskirts + to_waterfall) * 2 to_highest_point = to_foothills / 2 total_distance = to_outskirts + to_waterfall + to_foothills + to_hi...
Olivia is painting a picture. For every 10 brushstrokes she makes, she messes up 3 of them. If she wants to finish her painting with 200 perfect brushstrokes, how many brushstrokes will she have to make in total?
def solve() -> int: perfect_brushstrokes = 200 brushstrokes_before_mistake = 10 mistakes_per_10_brushstrokes = 3 total_brushstrokes = (perfect_brushstrokes / (10 - mistakes_per_10_brushstrokes)) * brushstrokes_before_mistake result = total_brushstrokes return result
If the value of x is 3, what is the value of 4x + 7?
def solve() -> int: x = 3 result = 4 * x + 7 return result
Max begins lifting weights and can bench press 150 pounds. He trains for 6 weeks and is able to bench press 20% more. What is the average increase in weight (in pounds) that he gained each week during his training?
def solve() -> int: initial_weight = 150 increase_percentage = 20 training_weeks = 6 increase_amount = initial_weight * (increase_percentage / 100) average_increase_per_week = increase_amount / training_weeks result = average_increase_per_week return result
Kim and her friends wants to split the bill. The total bill is $75. There are four people to split the bill with. How much does each person need to pay?
def solve() -> int: total_bill = 75 number_of_people = 4 bill_per_person = total_bill / number_of_people result = bill_per_person return result
A store is having a 25% off sale. If a shirt was originally $40, how much is it on sale for?
def solve() -> int: original_price = 40 percent_off = 0.25 sale_price = original_price * (1 - percent_off) result = sale_price return result
ome possible new questions and programs are: There were 240 oranges in each basket. 15 such baskets of oranges were brought to a juice shop. 12% of the oranges were spoiled and had to be discarded. The remaining oranges were squeezed to make juice. Each bottle of juice contained 10 oranges. How many bottles of juice we...
def solve() -> int: oranges_per_basket = 240 baskets = 15 spoiled_rate = 0.12 oranges_per_bottle = 10 total_oranges = oranges_per_basket * baskets spoiled_oranges = total_oranges * spoiled_rate good_oranges = total_oranges - spoiled_oranges bottles = good_oranges // o...
Kate’s soccer practice is a 18-mile round trip from her house. The bookstore is 15 miles farther away than her soccer practice. If Kate drives to soccer practice three times a week and goes to the bookstore once a week, how many miles does Kate drive in a week?
def solve() -> int: soccer_distance = 18 bookstore_distance = soccer_distance + 15 weekly_soccer_distance = soccer_distance * 3 weekly_bookstore_distance = bookstore_distance * 1 total_weekly_distance = weekly_soccer_distance + weekly_bookstore_distance result = total_weekly_distance return ...
Ben has 60 pencils. He uses 1/5 of his pencils to write an essay and breaks 6 pencils while sharpening. How many pencils are left?
def solve() -> int: original_pencils = 60 essay_pencils = original_pencils / 5 broken_pencils = 6 final_pencils = original_pencils - essay_pencils - broken_pencils result = final_pencils return result
There are 240 students in a school. 150 pass in Math, 180 pass in Science and 100 pass in both subjects. What percentage of students passed at least one of the two subjects?
def solve() -> int: total_students = 240 math_pass = 150 science_pass = 180 both_pass = 100 neither_pass = total_students - math_pass - science_pass + both_pass pass_at_least_one = total_students - neither_pass percent_pass_at_least_one = (pass_at_least_one / total_students) * 100 result...
A grocery store charges $2 for a loaf of bread. If you want to buy 4 loaves of bread and 2 cartons of milk for $10 in total, how much does one carton of milk cost?
def solve() -> int: loaf_cost = 2 total_cost = 10 loaves = 4 milk_cost = (total_cost - (loaf_cost * loaves))/2 result = milk_cost return result
Amanda has 47 stickers and she wants to divide them up evenly between 6 of her friends. How many stickers will each of her friends get?
def solve() -> int: number_of_stickers = 47 number_of_friends = 6 stickers_each = number_of_stickers // number_of_friends result = stickers_each return result
-Do not repeat the same type of question or the same units or numbers. Some possible new questions are: A bakery sells 8 types of pastries, each costing $2.50. The bakery also sells 6 types of bread, each costing $3.00. If a customer buys 3 pastries and 2 breads, how much change will they receive from a $20 bill?
def solve() -> int: pastries_cost = 3 * 2.50 breads_cost = 2 * 3.00 total_cost = pastries_cost + breads_cost change = 20 - total_cost result = change return result
The concert venue usually sells 2,345 tickets per show. In March, the concert venue sold 568 more tickets than usual. If the concert venue sold the regular number of tickets in April, how many tickets did the concert venue sell in March and April combined?
def solve() -> int: usual_tickets = 2345 march_tickets = usual_tickets + 568 april_tickets = usual_tickets total_tickets = march_tickets + april_tickets result = total_tickets return result
Student: A pizza costs $12. If 3 friends share the pizza equally, how much does each person pay?
def solve() -> int: cost_per_person = 12 / 3 result = cost_per_person return result
A rectangular garden measures 20 meters by 30 meters. If a fence is built around the garden, how much fencing material is needed?
def solve() -> int: perimeter = 2*(20+30) result = perimeter return result
Student: Celine has a yard that is 3 meters wide. She wants to make a square that is 70 centimetres wide. How many square such squares can she make in the yard?
def solve() -> int: yard_width = 3 square_width = 0.7 num_squares = yard_width // square_width result = num_squares return result
Lucas works at a restaurant and earns $6.50 plus 15% of his customers’ bills. If he worked 8 hours and made $125 in tips, how much did he earn?
def solve() -> int: hourly_wage = 6.50 hours = 8 tip = 125 total_wage = hourly_wage * hours + 0.15*tip result = total_wage return result
Seven coworkers go to lunch and spend $105 in total, including an 18% tip. If six of them order $12 meals and the seventh orders a $20 meal, what is the total cost of the 18% tip?
def solve() -> int: total_cost = 105 tip_percentage = 0.18 num_coworkers = 7 num_six_meals = 6 cost_six_meals = 12 cost_seventh_meal = 20 total_meal_cost = (num_six_meals * cost_six_meals) + cost_seventh_meal tip_amount = total_meal_cost * tip_percentage result = tip_amount ...
Cara works at a supermarket and runs the cash register for 4 hours and 30 minutes on Monday, 3 hours and 15 minutes on Wednesday, and 5 hours on Friday. If she takes a 30-minute break each day, how many total minutes does she work in a week?
def solve() -> int: total_minutes = (4*60 + 30) + (3*60 + 15) + 300 - (3 * 30) result = total_minutes return result
Student: At the end of the year, 415 students have gone through a math class. 68 of them earned an A grade and 54 earned a B grade. What is the percent of students that earned an A or B grade in the math class?
def solve() -> int: total_students = 415 a_students = 68 b_students = 54 a_or_b_students = a_students + b_students a_or_b_percent = (a_or_b_students / total_students) * 100 a_or_b_percent = round(a_or_b_percent, 2) result = a_or_b_percent return result