question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
The length of a rectangle is 10 cm more than twice its width. If the width is 5 cm, what is the perimeter of the rectangle?
def solve() -> int: width = 5 length = 2*width + 10 perimeter = 2*(length + width) result = perimeter return result
A class has 25 students of which 40% are female. How many male students are in the class?
def solve() -> int: total_students = 25 female_percentage = 40 female_students = (female_percentage / 100) * total_students male_students = total_students - female_students result = male_students return result
A retailer is offering a 15% discount on a $200 sweater. If a customer uses a $25 off coupon, what is the final price they will pay?
def solve() -> int: price = 200 discount = price * 0.15 sale_price = price - discount final_price = sale_price - 25 result = final_price return result
Student: John is going on a trip around the world but has a limited budget. He can buy a certain number of souvenirs at each location but has to save some money for the next place. If he buys 3 souvenirs at the first stop and saves 25%, how many souvenirs can he buy at the second stop if he has $100 left in his budget?
def solve() -> int: souvenirs_first_stop = 3 percent_saved = 0.25 budget_left = 100 money_saved = souvenirs_first_stop * percent_saved money_available = budget_left + money_saved souvenirs_second_stop = money_available // 1 result = souvenirs_second_stop return result
1. During a sale, Ali buys 6 ribbons, each costing $4. At the end of the sale, Ali receives a $1 discount on each ribbon. How much money, in dollars, did Ali spend in total?
def solve() -> int: number_of_ribbons = 6 price_per_ribbon = 4 discount_per_ribbon = 1 total_before_discount = number_of_ribbons * price_per_ribbon total_after_discount = total_before_discount - (number_of_ribbons * discount_per_ribbon) result = total_after_discount return result
Student: At a bake sale, 8 cakes were sold in total, and 3/5 of the cakes were chocolate cookies. How many chocolate cakes were sold at the bake sale?
def solve() -> int: total_cakes = 8 fraction_chocolate_cakes = 3/5 chocolate_cakes = total_cakes * fraction_chocolate_cakes result = chocolate_cakes return result
``` An airline charges $150 for a one-way ticket and $250 for a round-trip ticket. If George wants to travel from New York to Los Angeles and back, how much money does he need for the tickets?
def solve() -> int: one_way_ticket_price = 150 round_trip_ticket_price = 250 total_ticket_price = round_trip_ticket_price * 2 result = total_ticket_price return result
The price of a t-shirt is $20. If the price is increased by 10%, what is the new price of the t-shirt?
def solve() -> int: new_price = 20 + 0.1*20 result = new_price return result
Alex had 120 apples. He gave 50 apples to his sister and then received 80 apples from his neighbor. How many apples does Alex have now?
def solve() -> int: apples = 120 apples -= 50 apples += 80 result = apples return result
Mark drives 1,200 miles on two tanks of gas. If each tank gives him 34 miles per gallon, how many gallons of gas did he use?
def solve() -> int: distance = 1200 milesPerGallon = 34 totalGallons = distance/milesPerGallon result = totalGallons return result
The total cost of food for Thomas's birthday party is $150. The venue costs $200 for the day and there are 25 guests. How much does Thomas need to pay in total?
def solve() -> int: guests = 25 food_cost = 150 venue_cost = 200 totalCost = food_cost + venue_cost total_cost_per_person = totalCost/guests total_amount_paid = total_cost_per_person * guests result = total_amount_paid return result
Max was buying pieces of candy in a store. He noticed that the ratio of gumballs and lollipops was 4:3. If he bought a total of 20 pieces, how many lollipops did he buy?
def solve() -> int: total_num = 20 ratio_gumballs_lollipops = 4/3 num_gumballs = total_num / 7 num_lollipops = num_gumballs * 3 result = num_lollipops return result
Sara has a budget of $100 for clothes shopping. She buys 2 pairs of jeans for $25 each, a shirt for $15, and a pair of shoes. If she has $10 left in her budget, how much did Sara spend on the shoes?
def solve() -> int: budget = 100 jeans_price = 25 shirt_price = 15 shoes_price = budget - (2 * jeans_price) - shirt_price - 10 result = shoes_price return result
You buy 5 packets of pumpkin seeds, 4 packets of tomato seeds, and 5 packets of chili pepper seeds. How much will you save with a 10% discount?
def solve() -> int: packet_of_pumpkin_seeds = 2.50 packet_of_tomato_seeds = 1.50 packet_of_chili_pepper_seeds = 0.90 discount= 0.1 number_of_pumpkin_seeds = 5 number_of_tomato_seeds = 4 number_of_chili_pepper_seeds = 5 cost_of_pumpkin_seeds = number_of_pumpkin_seeds * pa...
A school has 720 students. If each classroom has 24 students, how many classrooms are needed?
def solve() -> int: total_students = 720 students_per_classroom = 24 classrooms_needed = total_students/students_per_classroom result = classrooms_needed return result
A bakery makes 500 cupcakes every day. On Monday, they sold 80% of their cupcakes and gave away 10% of the remaining cupcakes to a charity. On Tuesday, they sold 75% of their cupcakes and gave away 20% of the remaining cupcakes to another charity. How many cupcakes did they have left at the end of Tuesday?
def solve() -> int: cupcakes = 500 monday_sold = 0.8 monday_giveaway = 0.1 tuesday_sold = 0.75 tuesday_giveaway = 0.2 cupcakes_after_monday = cupcakes * (1 - monday_sold) cupcakes_after_monday -= cupcakes_after_monday * monday_giveaway cupcakes_after_tuesday = cupcakes_after_mo...
Student: Mario has 64 baseball trading cards. Today he sold 18 cards to his friend. How many trading cards does Mario have left?
def solve() -> int: cards_Mario_has = 64 cards_sold = 18 cards_Mario_has_left = cards_Mario_has - cards_sold result = cards_Mario_has_left return result
A train is traveling at an average speed of 68 miles per hour. How far can it travel in 5 hours?
def solve() -> int: speed = 68 time = 5 distance = speed * time result = distance return result
Carl has 8 stickers in his album. He collects 6 more stickers every week. How many stickers will he have in his album after 7 weeks?
def solve() -> int: stickers_start = 8 stickers_weekly = 6 week = 7 stickers_end = stickers_start + stickers_weekly * week result = stickers_end return result
Maya bought 10 packets of candy for her birthday party. Each packet contained 12 candies. She gave 3 candies to each of her 8 friends and kept the rest for herself. How many candies did Maya have left?
def solve() -> int: candies_bought = 0 candies_given = 0 candies_bought = 10 * 12 candies_given = 8 * 3 candies_left = candies_bought - candies_given result = candies_left return result
Student: For every 5 gallons of water in a pool, there should be 1 pound of chlorine. If a pool holds 50 gallons of water, how much chlorine is needed?
def solve() -> int: gallons_of_water = 50 amount_of_chlorine = 0 amount_of_chlorine = gallons_of_water / 5 result = amount_of_chlorine return result
In a machine shop, there are 24 wheels, not including the ones on the machines. Assuming every machine in the shop has 4 wheels, how many machines are in the shop?
def solve() -> int: total_wheels = 24 machine_wheels = 4 num_machines = total_wheels // machine_wheels result = num_machines return result
There are 25 beads in a necklace. There are five more red beads than blue beads. There are three times as many green beads as blue beads, and there are two more yellow beads than green beads. How many yellow beads are in the necklace?
def solve() -> int: beads = 25 blue = beads // 9 red = blue + 5 green = 3 * blue yellow = green + 2 result = yellow return result
Amy wants to buy some ice cream cones for her friends. She can buy 6 cones for $12 or 9 cones for $15. She has $30 to spend. How many cones can she buy at most? How much money will she have left?
def solve() -> int: result = (17, round(1.61, 2)) return result
A container is filled with 4 liters of soda and 12 cups contain 1 liter of soda each. How many liters of soda will be left in the container after pouring the twelve cups into it?
def solve() -> int: container_soda = 4 cup_soda = 1 total_soda = container_soda + 12 * cup_soda result = container_soda-total_soda return result
A painter can paint a house in 5 days. If there are 3 painters, how many days will it take to paint the house?
def solve() -> int: days_per_house = 5 num_painters = 3 days_to_paint = days_per_house / num_painters result = days_to_paint return result
Anna decides to replace her old television. She sold her $1,500 TV for 90% of its value and then was able to haggle to buy a $2,500 sticker price TV for 75% of its value. How much was she out of pocket?
def solve() -> int: old_tv_value = 1500 sold_price = old_tv_value * 0.9 new_tv_value = 2500 buy_price = new_tv_value * 0.75 out_of_pocket = buy_price - sold_price result = out_of_pocket return result
If 20% of a population are female and 40% are below 18 years old, what percentage of the population are both female and below 18?
def solve() -> int: female_pct = 0.2 below_18_pct = 0.4 result = female_pct * below_18_pct * 100 return result
If Emily swims 500 meters in 10 minutes, how long will it take her to swim 2 km at the same speed? At a wedding reception, each couple can bring their 2 children. Fifteen catering staff and a quarter as many wedding planners will also attend the reception. If there are 30 couples, how many chairs must be prepared for t...
def solve() -> int: speed = 500 / 10 time = 2000 / speed result = time people_per_couple = 3 total_people = 30 * people_per_couple return result
Maya has 16 purple pens. She has 4 more than three times as many yellow pens as purple pens and 6 less than four times as many pink pens than purple pens. How many pens does Maya have in all?
def solve() -> int: purple_pens = 16 yellow_pens = (purple_pens*3) + 4 pink_pens = purple_pens*4 - 6 result = purple_pens + yellow_pens + pink_pens return result
3. Yazeed goes to the supermarket to buy some apples. He buys 3kg each of Golden Delicious apples and Granny Smith apples. If Golden Delicious apples cost 4.5$/kg and Granny Smith apples cost 2.9$/kg, how much does he spend?
def solve() -> int: apples_GD = 3 price_GD = 4.5 apples_GS = 3 price_GS = 2.9 total_GD = apples_GD * price_GD total_GS = apples_GS * price_GS total_cost = total_GD + total_GS result = total_cost return result
Student: At a grocery store, a large pack of wafers is priced at $2.50, and a small pack of wafers is priced at $1.50. If Neil bought 6 packs of wafers, how much money did he spend?
def solve() -> int: large_pack_price = 2.50 small_pack_price = 1.50 num_large_packs = 3 num_small_packs = 3 total_price = (large_pack_price * num_large_packs) + (small_pack_price * num_small_packs) result = total_price return result
Tina made sandwiches. She ate 3 sandwiches and gave 4 sandwiches to her sister. Her grandma came over and ate 2 sandwiches. Then her two cousins arrived and ate 2 sandwiches each. There were 3 sandwiches left. How many sandwiches did Tina make?
def solve() -> int: tina_sandwiches = 3 + 4 + 2 + (2 * 2) + 3 result = tina_sandwiches return result
Jamie wants to save $20,000 to go on a trip. She has saved $10,000, and plans to save $1000 every month. How many months will it take for Jamie to save enough money to go on the trip, if the interest rate is 8% per year, compounded monthly?
def solve() -> int: trip_cost = 20000 savings = 10000 monthly_savings = 1000 interest_rate = 0.08 compounding_periods = 12 months = 0 while savings < trip_cost: savings = savings + monthly_savings savings = savings*(1+interest_rate/compounding_periods) months += 1 ...
Maria wants to make lemonade for her friends. She has 12 lemons, each lemon can produce 2 ounces of juice. She needs 6 ounces of juice for each quart of lemonade. She also needs 1 cup of sugar for each quart of lemonade. A cup of sugar costs $0.5. How much does it cost to make lemonade for her friends? Assume that she ...
def solve() -> int: lemons = 12 juice_per_lemon = 2 juice_per_quart = 6 sugar_per_quart = 1 sugar_cost = 0.5 cups_per_quart = 4 juice_total = lemons * juice_per_lemon quarts = juice_total / juice_per_quart sugar = quarts * sugar_per_quart sugar_cost_total = sugar * sugar_cost ...
A trapezoidal banner has a perimeter that is 12 cm less than the height of a flagpole. If the banner has a height of 8 cm and a base of 5 cm, what is the height of the flagpole?
def solve() -> int: banner_height = 8 banner_base = 5 banner_perimeter = 2 * (banner_height + banner_base) flagpole_height = banner_perimeter + 12 result = flagpole_height return result
If a bag of fruit contains 4 apples, 3 oranges, and 2 bananas, what percentage of the fruits are apples?
def solve() -> int: num_apples = 4 num_oranges = 3 num_bananas = 2 total_fruits = num_apples + num_oranges + num_bananas percent_apples = num_apples / total_fruits result = percent_apples return result
Last year, Jack was 1/3 as old as his father. This year, Jack is 1/4 as old as his father. How old is Jack this year if his father is 48 years old?
def solve() -> int: fathers_age = 48 last_years_ratio = 1/3 jacks_last_years_age = last_years_ratio * fathers_age aging_ratio = (1/4) / last_years_ratio jacks_age = jacks_last_years_age + (fathers_age * aging_ratio) result = jacks_age return result
A cyclist covers a distance of 100 km in 6 hours. If they ride the same distance at a speed of 20 km/h, how long will it take them?
def solve() -> int: distance = 100 time = 6 speed = distance / time time = distance / 20 result = time return result
Chloe has an exam with 50 questions that needs to be finished in one hour. She has answered 10 of the questions in 15 minutes. How many minutes will be left when she completes the exam at the same pace?
def solve() -> int: total_questions = 50 total_time = 60 answered_questions = 10 answered_time = 15 remaining_questions = total_questions - answered_questions remaining_time = total_time - answered_time time_per_question = answered_time / answered_questions total_time_needed ...
A garden is 40 feet by 60 feet. If you want to put a fence around the garden, how many feet of fence do you need?
def solve() -> int: length = 60 width = 40 fence_needed = 2 * (length + width) result = fence_needed return result
Student: Deborah, Ali, and Sam play basketball. Deborah scored 3 points for each shot she made. Ali made 5 shots and scored 15 points. Sam made 1 shot fewer than twice the amount of shots Ali made. How many points did Sam score?
def solve() -> int: deborah_points = 0 ali_shots = 5 ali_points = 15 sam_shots = ali_shots * 2 - 1 sam_points = 0 deborah_points = ali_shots * 3 sam_points = sam_shots * 3 result = sam_points return result
A boy has 40 toy cars. He gives one-eighth of this number to his friend, one-fourth of the remainder to his brother and keeps the rest for himself. How many toy cars does his brother get?
def solve() -> int: total_toy_cars = 40 toy_cars_for_friend = total_toy_cars / 8 remaining_toy_cars = total_toy_cars - toy_cars_for_friend toy_cars_for_brother = remaining_toy_cars / 4 result = toy_cars_for_brother return result
A school has 864 students. The ratio of boys to girls is 5:3. How many boys and girls are in the school?
def solve() -> int: total = 864 ratio_total = 5 + 3 boys = (5 / ratio_total) * total girls = (3 / ratio_total) * total result = (boys, girls) return result
Alyssa is entering a dance-a-thon and wants to earn as much money as last year's top fundraiser. Last year, dancers collected $2 for every minute danced. This year, dancers will collect $1.25 for every minute danced. If last year's top fundraiser earned $50, how many more minutes will Alyssa need to dance than the top ...
def solve() -> int: last_year_rate = 2 this_year_rate = 1.25 last_year_earnings = 50 last_year_minutes = last_year_earnings / last_year_rate alyssa_earnings = last_year_earnings alyssa_minutes = (alyssa_earnings / this_year_rate) difference = alyssa_minutes - last_year_mi...
A bookstore sells notebooks for $5 each, pens for $2 each, and pencils for $1 each. In one week, they sold 10 notebooks, 20 pens, and 50 pencils. How much money did the bookstore make in one week?
def solve() -> int: notebooks_cost = 5*10 pens_cost = 2*20 pencils_cost = 1*50 total_sales = notebooks_cost + pens_cost + pencils_cost result = total_sales return result
Taylor got 10 marks less in Chemistry than she scored in Physics. She also got 7 marks more in English than she got in History. If she scored 90 in History and scored 1/10 less in Chemistry, what's the total number of marks she scored in all the subjects?
def solve() -> int: physics = 0 chemistry = 0 english = 0 history = 90 physics = history + 10 chemistry = physics - (physics/10) english = history + 7 total_marks = physics + chemistry + english + history result = total_marks return result
Alex is selling his watch for $2000 and has two offers. One buyer offered to pay the full price if Alex would pay for the watch box, which costs an eighth of his asking price. The other buyer agreed to pay the price if Alex replaced the strap for $150 and the battery for three times as much. What is the difference betw...
def solve() -> int: asking_price = 2000 box_cost = asking_price / 8 replacement_cost = 150 + 3 * 150 offer1_price = asking_price - box_cost offer2_price = asking_price - replacement_cost difference = offer1_price - offer2_price result = difference retur...
Jamal has a toy train set. Each car of the train set has 4 pieces. If he has 12 cars, how many pieces will he have in total?
def solve() -> int: number_cars = 12 pieces_per_car = 4 total_pieces = number_cars*pieces_per_car result = total_pieces return result
Harry climbed a total of 225 stairs in 19 minutes. Bill maintained the same speed and climbed half as many stairs in the same time. How many stairs did Bill climb?
def solve() -> int: num_stairs_Harry = 225 num_stairs_Bill = num_stairs_Harry/2 result = num_stairs_Bill return result
While ordering pizza, Sarah noticed that the number of slices in her pizza was 4 more than the number of slices in her friend's pizza. Her friend's pizza had 6 slices, and the number of toppings Sarah had was twice the number of toppings her friend had. If Sarah had 10 toppings, how many slices and toppings did both pi...
def solve() -> int: friend_slices = 6 sarah_slices = friend_slices + 4 friend_toppings = 5 sarah_toppings = friend_toppings * 2 total_slices = friend_slices + sarah_slices total_toppings = friend_toppings + sarah_toppings + 10 result = f'{total_slices} slices and {total_toppings} toppings' ...
70% of classes at a university have a maximum enrollment of 25 students. If there are 256 classes at the university, how many classes have a maximum enrollment of 25 students?
def solve() -> int: total_classes = 256 percent_classes = 0.7 classes_25 = total_classes * percent_classes result = classes_25 return result
A recipe makes 15 cupcakes and uses 2 eggs. If you want to make 45 cupcakes, how many eggs do you need?
def solve() -> int: eggs_per_recipe = 2 cupcakes_per_recipe = 15 total_cupcakes = 45 eggs_needed = (eggs_per_recipe / cupcakes_per_recipe) * total_cupcakes result = eggs_needed return result
Three friends went bowling. If the total cost was $60 and the ratio of money that Kelly, Jamie, and Bobby spent was 3:4:5, how much did Jamie spend?
def solve() -> int: total = 60 ratio_total = 3+4+5 jamie = (4/12)*total result = jamie return result
Mrs. Lee has a garden with an area of 24 square meters. If she wants to fence it with wire, how many meters of wire does she need? Assume the garden is rectangular with a length to width ratio of 3:2.
def solve() -> int: width = (24 * 2) / 5 length = width * 3 perimeter = length + width + length + width result = perimeter return result
Kevin and Nora are shopping for clothes. Kevin buys a pair of jeans for $35, a shirt for $25, and a jacket for $50. Nora buys a dress for $40, a scarf for $15, and a pair of shoes for $30. They get a 10% off coupon that they can use on one item each. Kevin uses it on the jacket and Nora uses it on the dress. The tax is...
def solve() -> int: kevin = 35 + 25 + 50 nora = 40 + 15 + 30 kevin = kevin - 0.1 * 50 nora = nora - 0.1 * 40 kevin = kevin + 0.08 * kevin nora = nora + 0.08 * nora total = kevin + nora result = total return result
Jocelyn has a square piece of cloth with an area of 144 square meters. What is the perimeter of the square?
def solve() -> int: area = 144 side = area**(1/2) perimeter = 4 * side result = perimeter return result
There are 480 zombies in the shopping mall today. If the number of zombies increased by 8 times every day, how many days ago were there less than 40 zombies in the mall?
def solve() -> int: def zombieCalc(Z): days = 0 while Z >= 40: Z = Z / 8 days += 1 return days result = zombieCalc(480) return result
Lily has a jar of 60 jelly beans. She eats 5 of them and then gives half of the remaining ones to her brother. How many jelly beans does she have left in the jar?
def solve() -> int: after_eating = 60 - 5 given_to_brother = after_eating * 0.5 left_in_jar = after_eating - given_to_brother result = left_in_jar return result
amuel drove from New York to California, which is a distance of 3,000 miles. If his car gets 30 miles per gallon and gas costs $3.50 per gallon, how much did Samuel spend on gas for his trip?
def solve() -> int: distance_of_trip = 3000 miles_per_gallon = 30 cost_per_gallon_of_gas = 3.5 gallons_of_gas_needed = distance_of_trip / miles_per_gallon total_cost_of_gas = gallons_of_gas_needed * cost_per_gallon_of_gas result = total_cost_of_gas return result
The Davis family goes to the water park. An adult ticket costs $25. A child ticket costs $15. Mr. and Mrs. Davis each get an adult ticket. Their three children each get a child ticket. The family also buys a family meal for $30. How much money does Mr. Davis pay for the tickets and the meal?
def solve() -> int: adult_ticket = 25 child_ticket = 15 family_meal = 30 adults = 2 children = 3 cost_adults = adults * adult_ticket cost_children = children * child_ticket result = cost_adults + cost_children + family_meal result return result
At a school, there are 246 students. If there are 14 students per classroom, how many classrooms are there in total?
def solve() -> int: students = 246 classrooms = 0 while students > 0: classrooms += 1 students -= 14 result = classrooms return result
Student: A movie theater charges $10 for a ticket. This week it had 50 people per day, except on Tuesday where 75 people came. How much money did the theater make overall in the week?
def solve() -> int: ticket_price = 10 people_per_day = 50 people_on_tuesday = 75 total_people = people_per_day * 6 + people_on_tuesday total_money = ticket_price * total_people result = total_money return result
- A school cafeteria served 8 pies for dessert. Each pie was cut into 10 slices. If only two-fifths of the slices were eaten, how many slices of pie were left?
def solve() -> int: total_slices = 8 * 10 eaten_slices = 2/5 * total_slices left_slices = total_slices - eaten_slices result = left_slices return result
Lisa has collected 30 pictures. She puts them in groups of 5 and has two pictures that she cannot fit into a group. How many groups of 5 did she make?
def solve() -> int: total_pictures = 30 group_size = 5 leftover = 2 groups = (total_pictures - leftover) // group_size result = groups return result
A bird flies at an average speed of 15 miles per hour. If the bird flies for 3 hours, how many miles will it have flown in total?
def solve() -> int: speed = 15 time = 3 distance = speed * time result = distance return result
Result: 1.33333 A building is 50 feet tall and casts a shadow that is 80 feet long. At the same time, a person standing beside the building is 5 feet tall and casts a shadow that is 8 feet long. How tall is the building the person is standing beside?
def solve() -> int: height1 = 50 shadow1 = 80 height2 = 5 shadow2 = 8 building_height = (shadow1 / shadow2) * height2 + height2 result = building_height return result
5. Jim has 4 kg of apples and 3 kg of bananas. How many kilograms of fruit does Jim have in total?
def solve() -> int: apples_kg = 4 bananas_kg = 3 total_kg = apples_kg + bananas_kg result = total_kg return result
A book has 300 pages. If Martin reads 20 pages per day, how many days will it take him to finish reading the book?
def solve() -> int: total_pages = 300 pages_per_day = 20 days_taken = total_pages // pages_per_day if total_pages % pages_per_day: days_taken += 1 result = days_taken return result
When Tom cleaned his desk, he found 5 quarters, 6 dimes, 1 nickel, and 4 pennies. How much money did Tom find?
def solve() -> int: quarters = 5 dimes = 6 nickels = 1 pennies = 4 quarter_value = 0.25 dime_value = 0.10 nickel_value = 0.05 penny_value = 0.01 total_value = (quarters * quarter_value) + (dimes * dime_value) + (nickels * nickel_value) + (pennies * penny_value) res...
Peter went on a shopping spree and got himself 10 pairs of jeans, 4 shirts, and 2 jackets. If a pair of jeans costs $25, a shirt costs $12, and a jacket costs $60, how much did Peter spend in total?
def solve() -> int: pairs_of_jeans = 10 shirts = 4 jackets = 2 cost_of_jeans = 25 cost_of_shirt = 12 cost_of_jacket = 60 total_cost = (pairs_of_jeans * cost_of_jeans) + (shirts * cost_of_shirt) + (jackets * cost_of_jacket) result = total_cost return result
Student: Sam is building a shelf. He has cut pieces of wood to form an 8-sided figure. He cut each side of the same length, and the total length of the sides is 192 inches. What is the length of each side?
def solve() -> int: total_length = 192 number_of_sides = 8 length_of_each_side = total_length / number_of_sides result = length_of_each_side return result
Adam has $54, and Noe has $4 more than Adam. How much money, in dollars, do they have in total?
def solve() -> int: a = 54 b = a + 4 result = b + a return result
Emma makes a trail mix that is 7 parts peanuts, 5 parts raisins and 3 parts chocolate chips. She uses 140 grams of peanuts. How many grams of chocolate chips does she use?
def solve() -> int: ratio = 3 / 7 grams = 0.429 * 140 result = grams return result
Student: A store has 90 items in stock. 4/9 of them are books. How many are not books?
def solve() -> int: items_in_stock = 90 fraction_of_books = 4/9 number_of_books = items_in_stock * fraction_of_books number_of_non_books = items_in_stock - number_of_books result = number_of_non_books return result
Mark has 40 baseball cards. He gives away 3/5 of them to his friend. Then, he trades 1/4 of the remaining cards for hockey cards. Finally, he loses 5 cards. How many baseball cards does he have left?
def solve() -> int: cards = 40 friend = cards*3/5 remaining = cards - friend hockey = remaining/4 remaining = remaining - hockey remaining -= 5 result = remaining return result
Nancy has a small garden that she grows vegetables in. She has 8 carrot plants, 10 tomato plants, and 4 squash plants. If each carrot yields 6 carrots, each tomato yields 4 tomatoes, and each squash yields 7 squash, how many vegetables did Nancy harvest in total?
def solve() -> int: carrot_plants = 8 tomato_plants = 10 squash_plants = 4 total_carrots = 6 * carrot_plants total_tomatoes = 4 * tomato_plants total_squash = 7 * squash_plants total_vegetables = total_carrots + total_tomatoes + total_squash result = total_vegetables ...
A jar contains 30 white, 25 blue and 20 red balls. Juan took two balls at random. What is the probability of both balls are not red?
def solve() -> int: total_balls = 30 + 25 + 20 not_red_balls = total_balls - 20 probability_of_first_not_red_ball = not_red_balls / total_balls probability_of_second_not_red_ball = (not_red_balls-1) / (total_balls-1) result = probability_of_first_not_red_ball * probability_of_second_not_red_ball ...
If a book has a height of 24 centimeters and an area of 576, how many books of the same size would have a width of 48 centimeters?
def solve() -> int: height = 24 area = 576 width = 48 ratio = width / height num_books = area / ratio result = num_books return result
Possible answers: Kayla and Leo bought three movie tickets for $12 each and two large popcorns for $8 each. They also paid a $3 convenience fee for booking online. If they want to split the total cost equally, how much should each of them pay?
def solve() -> int: total_cost = 3 * 12 + 2 * 8 + 3 average_cost = total_cost / 2 result = average_cost return result
A rectangle's perimeter is 60 cm and its width is half of its length. What are the dimensions of the rectangle?
def solve() -> int: perimeter = 60 width = perimeter / 10 length = width * 2 result = width, length return result
Max scored 5 marks more than twice of Andy on a test. If Andy scored 24 marks, how many marks did Max score?
def solve() -> int: Andy_marks = 24 Max_marks = Andy_marks + (2 * 5) result = Max_marks return result
arah has 3 dolls. She has twice as many stuffed animals than dolls. She has 4 fewer cars than stuffed animals. How many toys does Sarah have in total?
def solve() -> int: dolls = 3 stuffed_animals = dolls * 2 cars = stuffed_animals - 4 result = dolls + stuffed_animals + cars return result
A hotel is running a 35% discount on room rates. If the room rate in the hotel is $140 before the discount, what is its new sale price after the discount?
def solve() -> int: room_rate = 140 discount = 0.35 discount_amount = room_rate * discount sale_price = room_rate - discount_amount result = sale_price return result
The sum of three consecutive odd numbers is 57. What are the three numbers?
def solve() -> int: first_num = (57 - 3) / 3 second_num = first_num + 2 third_num = second_num + 2 result = (first_num, second_num, third_num) return result
Student: A rectangular prism-shaped storage container has a length of 8 meters, a width of 4 meters, and a height of 6 meters. The container is half-filled with water. What is the volume of water in cubic meters?
def solve() -> int: length = 8 width = 4 height = 6 volume_container = length * width * height volume_water = volume_container / 2 result = volume_water return result
Olivia skips for fitness. She loses four times as many calories per hour as she did when she was walking. Olivia skips for. 5 hours a day, three days a week. She burned 200 calories an hour walking. How many calories does she lose a week from skipping?
def solve() -> int: calories_walking = 200 calories_skipping = calories_walking * 4 hours_skipping_per_day = 0.5 days_skipping_per_week = 3 total_hours_skipping = hours_skipping_per_day * days_skipping_per_week total_calories_skipping_per_week = total_hours_skipping * calories_skipping resul...
cott went to the store and bought 4 t-shirts for $10 each, 5 notebook for $4 each, and 2 erasers for $1 each. How much did he spend in all?
def solve() -> int: price_of_t_shirt = 10 quantity_of_t_shirt = 4 price_of_notebook = 4 quantity_of_notebook = 5 price_of_eraser = 1 quantity_of_eraser = 2 total_price_t_shirt = price_of_t_shirt * quantity_of_t_shirt total_price_notebook = price_of_notebook * quantity_of_notebook ...
A bag of candy contains 20 pieces of candy. If there are 5 people who want to share the candy evenly, how many pieces of candy does each person get?
def solve() -> int: num_candy = 20 num_people = 5 candy_per_person = num_candy / num_people result = candy_per_person return result
Anna can run 5 kilometers in 30 minutes. She wants to run 10 kilometers in one hour. How fast should she run in kilometers per minute?
def solve() -> int: distance = 10 time_in_minutes = 60 speed_in_km_per_min = distance / (time_in_minutes/60) result = speed_in_km_per_min return result
Jack saved 25% of his income every month. If his savings were $450 after 6 months, what was his average monthly income?
def solve() -> int: savings = 450 num_months = 6 savings_percentage = 0.25 income = savings / (num_months * savings_percentage) result = income return result
Mark baked a cake and divided it into 16 pieces. He gave 5/8 to his coworkers, and he shared 1/4 with his roommate. How many slices were left?
def solve() -> int: cake_slices = 16 coworkers_share = 5/8 * cake_slices roommate_share = 1/4 * cake_slices total_shared = coworkers_share + roommate_share slices_left = cake_slices - total_shared result = slices_left return result
-Make sure the questions are numbered from 1 to 10. A shirt costs $3 more than a pair of socks. The socks are 20% off the original price of $10. How much does the shirt cost?
def solve() -> int: socks_price = 10 * (1 - 0.2) shirt_price = socks_price + 3 result = shirt_price return result
A bus can hold 30 people. If there are 150 people who need to be transported, how many busses are needed?
def solve() -> int: people_per_bus = 30 total_people = 150 total_buses = total_people // people_per_bus + 1 result = total_buses return result
If Cameron caught 7 frogs, and then caught 10 more, how many frogs does she have in total?
def solve() -> int: frogs_caught_initially = 7 frogs_caught_later = 10 total_frogs = frogs_caught_initially + frogs_caught_later result = total_frogs return result
If a company's revenue is $500,000 and its expenses are $350,000, what is its profit?
def solve() -> int: revenue = 500000 expenses = 350000 profit = revenue - expenses result = profit return result
A box contains 15 red balls and 25 green balls. What fraction of the balls are red?
def solve() -> int: total_balls = 15 + 25 red_fraction = 15 / total_balls result = red_fraction return result
John spends $20 on 5 burgers. How much money will he need to buy 12 burgers?
def solve() -> int: burgers_bought = 5 money_spent = 20 cost_per_burger = money_spent / burgers_bought money_needed = cost_per_burger * 12 result = money_needed return result
ara has a collection of coins in a jar. She has 12 quarters, 18 dimes, 24 nickels, and 36 pennies. How much money does she have in total?
def solve() -> int: quarter = 25 dime = 10 nickel = 5 penny = 1 quarters_value = quarter * 12 dimes_value = dime * 18 nickels_value = nickel * 24 pennies_value = penny * 36 total_value = quarters_value + dimes_value + nickels_value + pennies_value dollars = total_v...
``` Sophie worked for 3 hours, completing 150 tasks at $0.60 per task. Later she worked for 2 hours, completing 5 tasks at $7 per task. What is the difference in money earned between the two?
def solve() -> int: task1 = 150 hour1 = 3 rate1 = 0.60 pay1 = task1 * rate1 * hour1 task2 = 5 hour2 = 2 rate2 = 7 pay2 = task2 * rate2 * hour2 result = pay1 - pay2 return result