question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
David sold 3 types of pens. One type had 10 pens and another had 6 more pens than the first. The two remaining types each had twice the number of pens as the first two types combined. How many pens did David sell?
def solve() -> int: pens_type1 = 10 pens_type2 = pens_type1 + 6 total_pens_type1_2 = pens_type1 + pens_type2 pens_type3 = 2 * total_pens_type1_2 pens_type4 = 2 * total_pens_type1_2 total_pens_sold = pens_type1 + pens_type2 + pens_type3 + pens_type4 result = tota...
Student: Amy scored 570 points in a computing class out of a possible total score of 900 points. What is her percentage score?
def solve() -> int: amy_score = 570 total_score = 900 ratio = amy_score / total_score percentage = ratio * 100 result = percentage return result
Over a 2 week period, Jose saved $4.00 each day for 3 days, $6.00 each day for 5 days, and $8.00 each day for 6 days. How much money did he save in total?
def solve() -> int: savings1 = 4.00 savings2 = 6.00 savings3 = 8.00 days1 = 3 days2 = 5 days3 = 6 total1 = savings1 * days1 total2 = savings2 * days2 total3 = savings3 * days3 total_savings = total1 + total2 + total3 result = total_savings re...
A florist can complete a bouquet in 12 minutes, while his assistant can do it in 18 minutes. If they work together, how many bouquets can they finish in 2 hours?
def solve() -> int: florist_time = 12 assistant_time = 18 total_time = 2 * 60 florist_rate = 1 / florist_time assistant_rate = 1 / assistant_time combined_rate = florist_rate + assistant_rate num_bouquets = combined_rate * total_time result = num_bouquets r...
Tom buys 10 cans of soda, each can costs $1, how much money did he spend in all?
def solve() -> int: no_of_cans = 10 price_per_can = 1 total_cost = no_of_cans * price_per_can result = total_cost return result
ara was running 4 miles an hour for 15 minutes. How far did she run?
def solve() -> int: Time = 15 Speed = 4 Distance = Time * Speed result = Distance return result
Mr.Lee bought 6 green erasers for his students. Each eraser cost 2.4 dollars. How much, in cents, did he pay for all the erasers?
def solve() -> int: cost_eraser = 2.4 n_erasers = 6 total_cost = cost_eraser * n_erasers total_cost_cents = total_cost * 100 result = total_cost_cents return result
A store sells 100 items per day for 5 days. They need to sell a total of 800 items in the week. How many items do they need to sell per day for the remaining 2 days to reach their goal?
def solve() -> int: items_sold = 100*5 remaining_items = 800 - items_sold days_remaining = 2 items_per_day = remaining_items / days_remaining result = items_per_day return result
David has saved $500 for his upcoming vacation by saving $25 every week. His friend, James, has saved 3/10 times less money per week. How much money have they saved for their vacation?
def solve() -> int: david_savings_per_week = 25 james_savings_per_week = david_savings_per_week * (7/10) david_total_savings = david_savings_per_week * 20 james_total_savings = james_savings_per_week * 20 total_savings = david_total_savings + james_total_savings result =...
James wants to visit two different supermarkets located 20 miles north and 15 miles south from his home. If his car gets 35 miles per gallon, how many gallons of gas will he need for both trips and returning back home?
def solve() -> int: north_distance = 20 south_distance = 15 total_distance = north_distance + south_distance + north_distance miles_per_gallon = 35 gallons_needed = total_distance / miles_per_gallon result = gallons_needed return result
Kim has a square garden plot that is 15 meters wide. How many meters does the perimeter of the plot measure?
def solve() -> int: width = 15 perimeter = width * 4 result = 60 return result
Question7: Indra had 6 books. He gave 3 of them to his brother and the remaining 2 to his sister. How many books did Indra give away?
def solve() -> int: total_books = 6 given_to_brother = 3 given_away = given_to_brother result = given_away return result
Kelly is baking a batch of chocolate chip cookies. She needs 2 cups of flour that are $0.25 a cup, 1 cup of sugar that is $0.75 a cup, 2 eggs that are $0.50 each, 1/2 cup of butter that is $1.50 a pound, and 1/2 cup of chocolate chips that are $2.00 a pound. If she makes 24 cookies, how much does each cookie cost?
def solve() -> int: flour_cost = 2 * 0.25 sugar_cost = 1 * 0.75 eggs_cost = 2 * 0.50 butter_cost = 0.5 * 1.50 / 2 chips_cost = 0.5 * 2.00 / 2 cookies_cost = flour_cost + sugar_cost + eggs_cost + butter_cost + chips_cost cookie_cost = cookies_cost / 24 result = cookie_cost return re...
Student: Rachel has 7 times the number of cards Sam has. Sam has 4 more cards than Tina. If Tina has 6 cards, how many cards do the three of them have in total?
def solve() -> int: sam = 0 tina = 6 rachel = 0 sam = tina + 4 rachel = sam * 7 total = sam + tina + rachel result = total return result
Anna has a jar of 100 marbles. 40% of them are red, 30% are blue, and the rest are green. How many green marbles are in the jar?
def solve() -> int: green_percent = 100 - 40 - 30 green_marbles = green_percent * 100 / 100 result = green_marbles return result
Dora wants to buy a book that costs $12. She has $4 in her piggy bank and earns $2 for each chore she does. How many chores does she need to do to buy the book if she also has to pay a 10% sales tax on the book?
def solve() -> int: tax_rate = 0.1 book_cost = 12 tax_amount = book_cost * tax_rate total_cost = book_cost + tax_amount money_in_bank = 4 money_needed = total_cost - money_in_bank money_per_chore = 2 chores_needed = money_needed / money_per_chore chores_needed = rou...
Possible new questions and programs: Binh has 12 stickers and he gives 3 of them to his friend. Then he buys 5 more stickers from the store. How many stickers does he have now?
def solve() -> int: stickers_left = 12 - 3 stickers_total = stickers_left + 5 result = stickers_total return result
Carlos and Dani both have a popcorn stand. Carlos sells his popcorn at 18 cents per ounce while Dani sells hers at 20 cents per ounce. If Carlos sold 120 ounces and Dani sold 100 ounces, how much more money (in cents) did Carlos earn than Dani?
def solve() -> int: c_price = 18 d_price = 20 c_sold = 120 d_sold = 100 c_revenue = c_price * c_sold d_revenue = d_price * d_sold difference = c_revenue - d_revenue result = difference return result
Student: David, Emma and Fred planted some flowers in their garden. David planted 9 flowers, Emma planted 12 flowers and Fred planted 15 flowers. If they had 50 flowers in total and Emma gave away a third of her flowers to her neighbor, how many flowers do they have now?
def solve() -> int: david_flowers = 9 emma_flowers = 12 fred_flowers = 15 total_flowers = 50 emma_giveaway = emma_flowers // 3 result = total_flowers - emma_giveaway return result
Student: David and Emily are selling lemonade at a stand. David can make and sell one cup of lemonade for 50 cents and Emily can make and sell one cup of lemonade for 40 cents. They have a total of 60 lemons and each cup of lemonade requires one lemon. How much money will they make if they sell all the cups of lemonade...
def solve() -> int: david_price = 0.5 emily_price = 0.4 lemons = 60 david_cups = lemons // 1 emily_cups = lemons // 1 david_money = david_price * david_cups emily_money = emily_price * emily_cups total_money = david_money + emily_money result = total_money return result
A hotel room costs $120 per night, but the price drops to $90 per night if you stay for 3 or more nights. How much would it cost to stay for 4 nights?
def solve() -> int: price_per_night = 120 discounted_price = 90 nights_stay = 4 if nights_stay >= 3: total_price = discounted_price * nights_stay else: total_price = price_per_night * nights_stay result = total_price return result
Student: Omari starts running in a steady pace from point A, and reaches point B 60 minutes later. If point B is 12 km away from point A, what is his average speed in km/h?
def solve() -> int: distance = 12 time = 60 time_in_hours = time / 60 average_speed = distance / time_in_hours result = average_speed return result
Emily gives 1/4 of her 300 chips to her friend Jane, then Jane gives 2/7 of her chips back to Emily. How many chips does Emily have at the end?
def solve() -> int: a = 300 b = a/4 c = b*2/7 d = b - c result = a - d return result
Student: Bill is twice as old as Mary. In 10 years, their ages will add up to 74. How old is Mary currently?
def solve() -> int: bill_age = 0 mary_age = 0 bill_age_in_10_years = bill_age + 10 mary_age_in_10_years = mary_age + 10 total_age_in_10_years = bill_age_in_10_years + mary_age_in_10_years mary_age = 74 - bill_age_in_10_years result = mary_age return result
There are 40 red balls and 60 blue balls in a box. What percentage of the balls are red?
def solve() -> int: total_balls = 100 red_balls = 40 percentage_red = (red_balls/total_balls) * 100 result = percentage_red return result
A bookshelf contains 240 books. If 20% are hardcovers and 30% of the remaining books are fiction, how many books are non-fiction paperbacks?
def solve() -> int: total_books = 240 hardcovers = total_books * 0.20 non_hardcovers = total_books - hardcovers fiction_books = non_hardcovers * 0.30 non_fiction_books = non_hardcovers - fiction_books result = non_fiction_books return result
The Tokyo Tower has 5 more levels than the Eiffel Tower. Together they have a total of 29 levels. How many levels does the Tokyo Tower have?
def solve() -> int: eiffel_tower_levels = (29-5)/2 tokyo_tower_levels = eiffel_tower_levels + 5 result = tokyo_tower_levels return result
If Tracy's average speed for a drive is 70 km/h, how many km did she travel in 3.5 hours?
def solve() -> int: speed_tracy = 70 time_tracy = 3.5 distance_tracy = speed_tracy * time_tracy result = distance_tracy return result
In a test, 40% of the students scored an A grade, 30% of the students got a B grade and 10% got a C grade. If there are a total of 180 students, how many students scored a D grade?
def solve() -> int: students = 180 a_grade = students * 0.4 b_grade = students * 0.3 c_grade = students * 0.1 d_grade = students - a_grade - b_grade - c_grade result = d_grade return result
6. Kalina's family went on a road trip and drove for 9 hours at a constant speed of 120 km/hr. How far did Kalina's family travel?
def solve() -> int: distance = 120 * 9 result = distance return result
A company has a profit margin of 30%. If their expenses increase by 20%, by what percentage should they increase their sales to maintain the same profit margin?
def solve() -> int: profit_margin = 0.3 expense_increase = 0.2 new_profit_margin = profit_margin/(1+expense_increase) percentage_increase = (new_profit_margin - profit_margin)/profit_margin * 100 result = percentage_increase return result
Mark's elephant has a tail that's 10% of the length of its body, and a head that's 1/20 the length of its body. If the elephant is 300 centimeters long overall, how long is its tail?
def solve() -> int: body_length = 300 tail_length = body_length * 0.1 head_length = body_length / 20 result = tail_length return result
Corey bought a bike for $200. He then paid 5% in taxes. How much money does he need to pay in total?
def solve() -> int: amount_for_bike = 200 tax_amount = amount_for_bike * 0.05 total_amount = amount_for_bike + tax_amount result = total_amount return result
William and his brother were playing a game on their phone. William had a score of 500, while his brother had a score of 750. William wanted to have a score at least 200 points higher than his brother. If his brother's score increases by 100 points, how much higher does William's score need to be to reach his goal? Bob...
def solve() -> int: william_score = 500 brother_score = 750 goal_difference = 200 brother_score += 100 william_score_needed = brother_score + goal_difference friend_pieces = 16 * (1 - 1/4) / 2 result = william_score_needed, friend_pieces return result
A boat travels 90 nautical miles in 2 hours. How many additional nautical miles can it travel at the same rate in 1 hour?
def solve() -> int: distance = 90 time = 2 rate = distance / time additional_time = 1 additional_distance = rate * additional_time result = additional_distance return result
ome possible questions are: David earns $4000 per month as a software engineer. He spends 1/4 of his income on rent, 1/6 on food, and 1/10 on utilities. He also saves 10% of his income every month. How much money does he have left for other expenses?
def solve() -> int: rent = 4000 / 4 food = 4000 / 6 utilities = 4000 / 10 savings = 4000 * 0.1 total_spent = rent + food + utilities + savings money_left = 4000 - total_spent result = money_left return result
Sarah has 12 apples. She gives 3 apples to her sister and splits the rest evenly between her and her brother. How many apples does each of them get?
def solve() -> int: sarah_apples = 12 sister_apples = 3 remaining_apples = sarah_apples - sister_apples siblings_apples = remaining_apples / 2 result = siblings_apples return result
A circular pizza has a radius of 12 inches. What is the area of the pizza?
def solve() -> int: radius = 12 area = 3.14*radius**2 result = area return result
Alex has a collection of 6 posters. Each poster is worth $30, except for one which is worth $50. He decided to sell his collection. To do it fast he decided to sell each poster for $5 less than their value. How much will Alex earn if he sells all the posters?
def solve() -> int: poster_count = 6 poster_value = 30 special_poster_value = 50 discount = 5 total_value = (poster_count - 1) * poster_value + special_poster_value total_discount = poster_count * discount total_earnings = total_value - total_discount result = total_earnings ...
If a shirt costs $25.50 and the sales tax is 7%, what is the total cost of the shirt?
def solve() -> int: price = 25.50 tax_rate = 0.07 total_price = price + (price * tax_rate) result = total_price return result
Possible new questions and programs are: Alice has 60 eggs. She used 14 eggs to make a cake and 12 eggs to make some omelettes. She then gave away 8 eggs to her friend. How many eggs does Alice have left?
def solve() -> int: used = 14 + 12 given = 8 left = 60 - used - given result = left return result
Student: A school cafeteria sells pizza slices for $2 each. The cafeteria orders 30 pizzas, each with 8 slices, from a local pizzeria. The pizzeria charges $10 for each pizza plus a $20 delivery fee. If the cafeteria sells all the pizza slices, how much money does it earn?
def solve() -> int: price_per_slice = 2 num_pizzas = 30 slices_per_pizza = 8 price_per_pizza = 10 delivery_fee = 20 total_cost = num_pizzas * price_per_pizza + delivery_fee total_slices = num_pizzas * slices_per_pizza total_revenue = total_slices * price_per_slice result = total_reve...
Olivia puts in a quarter of the cost of a vacation rental, which amounts to $2,500 for the first 5 days, and then doubles that much per day for the rest of the vacation. How much did the vacation rental cost in total?
def solve() -> int: cost_first_5_days = 2500 olivia_contribution = cost_first_5_days / 4 cost_per_day = cost_first_5_days * 2 remaining_days = 7 cost_remaining_days = cost_per_day * remaining_days total_cost = cost_first_5_days + cost_remaining_days result = total_cost ...
A baker can make 48 cakes in 4 hours. How many cakes can the baker make in 6 hours?
def solve() -> int: cakes_per_hour = 48 hours = 6 cakes = cakes_per_hour * hours result = cakes return result
Brooke is 23 years old. Her elder brother Ben was 9 years old when she was born. Nick is their elder brother and is 16 years older than Ben. How old will Nick be after 5 years?
def solve() -> int: brooke_age = 23 ben_age = brooke_age - 9 nick_age = ben_age + 16 nick_age_after_5_years = nick_age + 5 result = nick_age_after_5_years return result
An online store offers free shipping for orders of $35 and under. If multiple item is purchased and the total of all 4 items is $84, how much money needs to be paid in shipping?
def solve() -> int: items_total_cost = 84 free_shipping_limit = 35 if items_total_cost > free_shipping_limit: shipping_cost = items_total_cost - free_shipping_limit else: shipping_cost = 0 result = shipping_cost return result
Kelly bought some materials for a project at school. She bought 4 glue sticks for $1 each, 6 pens for $2 each, and 8 markers for $3 each. How much money did Kelly spend in total?
def solve() -> int: glue_sticks = 1 pens = 2 markers = 3 total = glue_sticks * 4 + pens * 6 + markers * 8 result = total return result
Laura went to the sports shop to buy some tennis balls. She knows her bag can hold 9 tennis balls. Her bag already contained 5 tennis balls. If each tennis ball costs $2, how much change will she get from $20?
def solve() -> int: bag_capacity = 9 current_balls = 5 ball_cost = 2 total_cost = (bag_capacity - current_balls) * ball_cost change = 20 - total_cost result = change return result
Jayden can make 24 bracelets in 2 hours. His sister Hailey can make 20% more bracelets than Jayden in the same time frame. Their friend Max can make one-fourth of the bracelets that Hailey can make. How many bracelets can Max make in 2 hours?
def solve() -> int: hailey_bracelets = 24 * 1.2 max_bracelets = hailey_bracelets / 4 result = max_bracelets return result
David has 24 books. He wants to keep 1/3 of them in his study room, donate 1/4 of them to the library, and donate 3 books to his school. How many books are left with David? Emma had a bag of 40 stickers that she was playing with. She received 12 more stickers from a friend, but then accidentally dropped 8 stickers on t...
def solve() -> int: total_books = 24 study_room_books = total_books * (1/3) donate_library_books = total_books * (1/4) donate_school_books = 3 books_left = total_books - study_room_books - donate_library_books - donate_school_books initial_stickers = 40 received_stickers = 12 d...
Kevin runs a lemonade stand in the summer. He made 420 cups of lemonade this week. He sold 60% of his lemonade on Monday, 15% on Tuesday, and 10% on Wednesday. He also gave away 20 cups of lemonade to his friends and family. How many cups of lemonade did he sell on Thursday and Friday combined?
def solve() -> int: total_lemonade = 420 monday_lemonade = total_lemonade * 0.6 tuesday_lemonade = total_lemonade * 0.15 wednesday_lemonade = total_lemonade * 0.1 free_lemonade = 20 remaining_lemonade = total_lemonade - monday_lemonade - tuesday_lemonade - wednesday_lemonade - free_lemonade...
A school has 500 students. 60% of the students are girls. If the male students are 20 more than the female students, how many male students are there?
def solve() -> int: total_students = 500 female_students = total_students * 0.6 male_students = total_students - female_students male_students -= 20 result = male_students return result
At a library, there are 14 more non-fiction books than fiction books. If there are 44 non-fiction books, how many fiction books are there?
def solve() -> int: fiction_books = 44 - 14 result = fiction_books return result
The local ice cream truck is offering a 4-for-3 promotion. Each ice cream is $2, what is the total cost for 10 cones?
def solve() -> int: total_cost = 0 num_cones = 10 cone_price = 2 num_discount_cones = (num_cones // 4) total_cost = (num_cones - num_discount_cones) * cone_price result = total_cost return result
To create curtains that pool at the bottom, Maria wants to add 9 inches of fabric. If her window is 8 feet high, how much fabric should she purchase for each panel? Andrew wants to buy a new laptop for $1,500. He currently has $900 saved and wants to know how much more money he needs to save before he can purchase the ...
def solve() -> int: window_height = 8 * 12 fabric_needed = window_height + 9 result = fabric_needed deposit = 1500 * 0.1 money_needed = 1500 - 900 - deposit result = money_needed return result
For her science project, Emma has to grow one more than 7 plants every day for 5 days. Unfortunately, every other day, her little sister, Mia, tramples one-third of the plants Emma grew that day. How many plants does Emma have left at the end of the fifth day? The Joker movie cost 20 million to make and earned 100 mill...
def solve() -> int: plants_grown_per_day = 7 days = 5 plants_left = 0 total_plants_grown = (plants_grown_per_day + 1) * days plants_trampled = (plants_grown_per_day + 1) * (days // 2) * (1/3) plants_left = total_plants_grown - plants_trampled result = plants_left retu...
A rectangle has a length of 12cm and a width of 7cm. What is its area?
def solve() -> int: length = 12 width = 7 area = length * width result = area return result
A store sells shirts for $15 each. If a customer bought 10 shirts, how much did they spend?
def solve() -> int: price_per_shirt = 15 number_of_shirts = 10 total_cost = price_per_shirt * number_of_shirts result = total_cost return result
A group of friends went to a restaurant and ordered $200 worth of food. If they divide the bill equally, how much does each person need to pay if there are 8 people?
def solve() -> int: bill = 200 people = 8 per_person = bill / people result = per_person return result
There are 9 cards in a box; 2 red cards, 3 blue cards, and 4 green cards. Choose 2 cards from the box without replacement. What is the probability that the selected cards are the same color?
def solve() -> int: number_suc_outcomes = 7 total_possible_outcomes = 9*8/(2*1) result = number_suc_outcomes/total_possible_outcomes return result
Maddy ran 5 kilometers at a pace of 6 minutes per kilometer. How long did it take her to finish the run?
def solve() -> int: distance_in_km = 5 pace_in_minutes = 6 total_time_in_minutes = distance_in_km * pace_in_minutes result = total_time_in_minutes return result
Ryan’s bus picks him up from school every day at 3 PM, and his house is 7 miles away. If his house took him 10 minutes to get to on his bike, how much earlier should Ryan leave school?
def solve() -> int: distance = 7 miles_minute = (distance/10) time_leave = (1/miles_minute)*60 time_bus = 3 * 60 minutes_earlier = time_bus - time_leave result = minutes_earlier return result
James has $500 in his checking account and needs to pay his credit card bill of $150. If he has already paid $50, how much more does James need to pay for his credit card bill?
def solve() -> int: checking_account = 500 credit_card_bill = 150 already_paid = 50 remaining_balance = credit_card_bill - already_paid result = remaining_balance return result
Mark is renovating his house. He has three rooms: bedroom, kitchen, and living room. Each bedroom wall costs $100 to paint, each kitchen wall costs twice as much as each bedroom wall, and each living room wall costs three times as much as each bedroom wall. If Mark has a total budget of $3,000 for painting all three ro...
def solve() -> int: bedroom_wall_cost = 100 kitchen_wall_cost = bedroom_wall_cost * 2 living_room_wall_cost = bedroom_wall_cost * 3 total_budget = 3000 living_room_walls = 0.5 * kitchen_wall_cost kitchen_walls = living_room_walls / 2 bedroom_walls = living_room_walls / 3 t...
Jennifer takes a specific route to the library. First, she walks 1 block to the bus stop. Then she takes the bus for 8 stops to the library entrance. Finally, she walks 3 blocks to get to the books she wants. Jennifer goes to the library twice a week. How many blocks does she cover in a month?
def solve() -> int: walk_to_bus_stop = 1 bus_stops_to_library = 8 walk_to_books = 3 visits_per_week = 2 weeks_in_month = 4 total_blocks = (walk_to_bus_stop + walk_to_books) * visits_per_week * bus_stops_to_library * weeks_in_month result = total_blocks ...
Student: Lisa bought a dress for $100 and sold it back for $80. What was her total loss?
def solve() -> int: price_bought = 100 price_sold = 80 total_loss = price_bought - price_sold result = total_loss return result
Jillian is painting a room and wants to add horizontal stripes that are 1 foot apart. If each stripe is 6 inches wide and she wants to add 5 stripes, how many feet of paint will she need for the stripes?
def solve() -> int: stripes = 5 stripe_width = 6 stripe_distance = 1/2 total_width = stripes * stripe_width total_length = (stripes - 1) * stripe_distance total_area = total_width * total_length / 144 result = total_area return result
Two trains have different speeds, which respectively are 70 and 90 mph. Train A left the station at 9 am and train B left after 1 hour. If train B catch up train A when it's 5.5 hours after train B left the station, how far away were Train A and Train B from the station when train B caught up?
def solve() -> int: speed_trainA = 70 speed_trainB = 90 time_trainA = 9 time_trainB = 10 time_afterB_left = 5.5 time_from_trainB_catchup = time_afterB_left - time_trainB distance_trainA = speed_trainA * time_trainA distance_trainB = speed_trainB * time_trainB ...
At a library, the number of students who prefer reading novels is 3/7 of the total number of students, while 80 students prefer studying for their exams. If there are 280 students in the library, calculate the total number of students who prefer reading other genres besides novels and who aren't studying.
def solve() -> int: total_students = 280 novel_students = (3/7) * total_students exam_students = 80 other_students = total_students - novel_students - exam_students result = other_students return result
A car travels 480 miles in 8 hours. At this rate, how many miles will it travel in 12 hours?
def solve() -> int: distance = 480 time = 8 new_time = 12 new_distance = (distance / time) * new_time result = new_distance return result
Carl needs to repair a 100 square foot kitchen wall in his house. He notices that each piece of wallboard covers 25 square feet. How many pieces of wallboard will Carl need to buy?
def solve() -> int: wall_area = 100 single_wall_area = 25 number_of_wallboards = wall_area / single_wall_area result = number_of_wallboards return result
A coffee shop sells small, medium, and large coffee cups for $1.50, $2.00, and $2.50 each respectively. On a certain day, the shop sold 60 small cups, 40 medium cups, and 20 large cups. How much money did the shop earn on that day just from coffee sales?
def solve() -> int: small_sales = 1.50 * 60 medium_sales = 2.00 * 40 large_sales = 2.50 * 20 total_sales = small_sales + medium_sales + large_sales result = total_sales return result
If John has 5 times as many marbles as Ted, and Ted has 20 marbles, how many marbles does John have?
def solve() -> int: ted_marbles = 20 john_marbles = 5 * ted_marbles result = john_marbles return result
Student: If a rectangle has a perimeter of 40 cm and a length of 10 cm, what is the width of the rectangle?
def solve() -> int: perimeter = 40 length = 10 width = perimeter - 2 * length result = width return result
On the first day, there were 600 Coronavirus cases in California. On the second day, there were 200 new cases and 250 recoveries. On the third day, 400 new cases were reported with 150 recoveries. What's the total number of positive cases after the third day?
def solve() -> int: c1 = 600 c2 = 200 r2 = 250 c3 = 400 r3 = 150 total_3 = c1 + c2 + c3 - (r2 + r3) result = total_3 return result
A t-shirt is sold at $15 each. If there's a 20% discount on each shirt, how much will you pay if you buy 3 of them?
def solve() -> int: price_per_shirt = 15 discount = 0.2 num_shirts = 3 price_after_discount = price_per_shirt * (1 - discount) total_price = price_after_discount * num_shirts result = total_price return result
How many items were with Bob initially?
def solve() -> int: mark_items = 26 bob_items = mark_items + 56 result = bob_items return result
A chemistry lab has three containers with 200 mL, 300 mL, and 400 mL of liquid, respectively. If the contents of the three containers are combined into a single container, what is the total volume of the liquid in milliliters?
def solve() -> int: container1 = 200 container2 = 300 container3 = 400 total_volume = container1 + container2 + container3 result = total_volume return result
Antonio selects a bag of candy with only yellow and green candies. He selects a candy at random and replaces it 25 times. How many times should he expect to select a candy that is yellow and has a number divisible by 5?
def solve() -> int: total_candies = 25 yellow_candies = total_candies / 2 divisible_by_5 = yellow_candies / 5 expected_candies = divisible_by_5 result = expected_candies return result
If a wolf is 36 inches taller than a fox, and the fox is 2 feet 3 inches tall, how tall is the wolf in feet?
def solve() -> int: fox_height = 2 * 12 + 3 wolf_height = fox_height + 36 wolf_height_feet = wolf_height // 12 result = wolf_height_feet return result
In Lisa's soccer team, there are 20 players and 2 coaches. Lisa has 15 soccer balls on hand. If 40% of her players brought their own balls, how many more does Lisa need to get so that every player has one?
def solve() -> int: players = 20 coaches = 2 total_people = players + coaches soccer_balls = 15 percent_brought_balls = 0.4 players_brought_balls = players * percent_brought_balls total_balls = soccer_balls + players_brought_balls balls_needed = total_people - total_balls result = ba...
Lisa swam for 7 days. During the first day, she swam for 20 minutes. On the second day, she swam for 30 minutes. On the third day she swam for 40 minutes. On the seventh day she swam for 25 minutes. Her average swimming time per day was 30 minutes. How long did she swim on the fourth day?
def solve() -> int: day1 = 20 day2 = 30 day3 = 40 day7 = 25 total_time = day1 + day2 + day3 + day7 average_time = total_time / 7 day4 = (7 * 30) - total_time result = day4 return result
san's class fund contains $200. There are four times as many $10 bills to $20 bills. How many $10 bills do they have in their fund?
def solve() -> int: cost_ten = 10 cost_twenty = 20 amount = 200 num_twenty = 1 num_ten = num_twenty * 4 result = cost_ten * num_ten + cost_twenty * num_twenty return result
Mia is shopping for some clothes and accessories. She buys a dress for $25, a pair of shoes for $30, a necklace for $15, and a hat for $10. She has a coupon that gives her 15% off on one item of her choice. She decides to use it on the most expensive item. She can only pay with $10 bills. How many $10 bills does she ne...
def solve() -> int: dress_cost = 25 shoes_cost = 30 necklace_cost = 15 hat_cost = 10 most_expensive = max(dress_cost, shoes_cost, necklace_cost, hat_cost) most_expensive = most_expensive * 0.85 total_cost = dress_cost + shoes_cost + necklace_cost + hat_cost - most_expensive ...
When she was in college, Rachel could type 50 words in 2 minutes. Now as a professional typist, she can type 1 word in 5 seconds. How many more words can she type now in 2 minutes compared to when she was in college?
def solve() -> int: college_words = 50 college_time = 2 professional_time = 2 professional_word = 1 college_words_per_minute = college_words / college_time professional_words_per_minute = (professional_word * 60) / professional_time more_words = professional_words_per_minute -...
Student: Rob needs to make a square patio. The patio should have an area of one-fourth of a rectangular patio with a length of 20 meters and a width of 25 meters. What should be the length of each side of the square patio?
def solve() -> int: length = 20 width = 25 area = 0.25 * length * width result = (area / 4) ** 0.5 return result
A school has 200 students. If each student brings in 2 flowers, how many flowers will there be in total?
def solve() -> int: total_students = 200 flowers_per_student = 2 total_flowers = total_students * flowers_per_student result = total_flowers return result
``` An isosceles triangle has two sides of length 10 cm and a base of 8 cm. Find the height of the triangle.
def solve() -> int: base = 8 side_length = 10 half_base = base / 2 height = (side_length ** 2 - half_base ** 2) ** 0.5 result = height return result
A school has 360 students and 15 teachers. Each teacher gets assigned a class of 24 students. The school decides to organize a field trip for the students and the teachers, and rents 4 buses with 50 seats each. How many seats will be left empty on the buses?
def solve() -> int: students = 360 teachers = 15 class_size = 24 buses = 4 bus_capacity = 50 empty_seats = 0 people = students + teachers empty_seats = buses * bus_capacity - people result = f"There will be {empty_seats} seats left empty on the buses." re...
Jessica is going to the movies and wants to buy popcorn. She can buy a large bucket for $10 at the theater. At the snack stand, a small bag costs $6. How much money does she save by buying the large bucket?
def solve() -> int: large_bucket_price = 10 small_bag_price = 6 money_saved = small_bag_price - large_bucket_price result = money_saved return result
A car covers a distance of 420 miles in 7 hours. If it takes a 30-minute break in the middle of the journey, what is the speed of the car in miles per hour?
def solve() -> int: distance = 420 time = 7 - 0.5 speed = distance / time result = speed return result
Amy has 5 more dolls than Will who has one-ninth the number of dolls as Hanna. Hanna has 18 dolls. How many dolls does Amy have?
def solve() -> int: hanna_dolls = 18 will_dolls = hanna_dolls * 1/9 amy_dolls = will_dolls + 5 result = amy_dolls return result
At a toy store, Ethan bought 4 action figures and 2 board games for $70 total, and Emma bought 1 board game for $30 total. Each action figure cost the same price, and each board game cost the same price. How much does 1 action figure cost?
def solve() -> int: result = 2.5 return result
Brian is building a shelf that has 6 layers. Each layer has 8 compartments. The dimension of each compartment is 10 cm by 15 cm. If it takes him 4 minutes to paint each compartment, how long does it take to finish the shelf?
def solve() -> int: num_layers = 6 num_compartments = 8 compartment_length = 15 compartment_width = 10 time_per_compartment = 4 total_compartments = num_layers * num_compartments total_area = total_compartments * compartment_length * compartment_width total_time = total_compartments...
If Lisa wants to wear the same outfit on Tuesday and Saturday and wear a different outfit every other day of the week, how many outfits will she need to pack for her upcoming vacation?
def solve() -> int: days_in_week = 7 outfits_needed = 2 + (days_in_week - 2) result = outfits_needed return result
A box of chocolates contains 20 pieces. If each piece of chocolate costs $0.50, how much would it cost to buy the entire box of chocolates?
def solve() -> int: choc_pieces = 20 choc_cost = 0.50 total_cost = choc_pieces * choc_cost result = total_cost return result
A student bought a new laptop for $820. However he received a 10% discount coupon, and so he ended up paying only $738. How much did he save with the coupon?
def solve() -> int: original_price = 820 discount_rate = 0.1 discount_amount = original_price * discount_rate sale_price = original_price - discount_amount saved_amount = original_price - sale_price result = saved_amount return result
For every 5 apples sold, the farmer sold 3 oranges. If the farmer sold a total of 25 apples and oranges, how many oranges did he sell?
def solve() -> int: total_fruits = 25 apples = total_fruits/8 oranges = 3*apples result = oranges return result
A factory produces 500 widgets in the first week of production. The factory doubles its production every week. How many widgets will the factory produce in the third week?
def solve() -> int: n = 3 production = 500 for i in range(n-1): production = production * 2 result = production return result
A salon charges extra fees for customers without them knowing. If Susan's total bill was $90, with a sales tax of 5%, she got a haircut for $30 and a manicure for $10, how much was she charged for gratuities?
def solve() -> int: haircut = 30 manicure = 10 subtotal = haircut + manicure tax_rate = 0.05 tax = subtotal * tax_rate total = subtotal + tax + 90 gratuities = total - subtotal - tax - 90 result = gratuities return result