question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Mark is shopping for a television. The regular price of the TV he wants is $1,500. The store offers discounts based on the customer's occupation: 25% off for teachers, 15% off for police officers, and 10% off for fire department employees. Mark is a teacher. How much will he spend on the television?
def solve() -> int: regular_price = 1500 discount_percentage = 25 discount_amount = regular_price * discount_percentage / 100 final_price = regular_price - discount_amount result = final_price return result
Ethan received an email from a hacker who claims they have control of his computer and will only release it if Ethan sends them the password codes to 4 $1000 Amazon gift cards and 5 $500 Target gift cards. After sending the codes for 2 Target gift cards, Ethan becomes savvy to the scam and takes action. How much money'...
def solve() -> int: amazon_gift_card_value = 1000 target_gift_card_value = 500 num_amazon_gift_cards = 4 num_target_gift_cards = 5 num_sent_target_gift_cards = 2 total_value = (amazon_gift_card_value * num_amazon_gift_cards) + (target_gift_card_value * num_target_gift_cards) sent_v...
Student: 50 cookies are baked for a party. 10% of them are chocolate chip. Six times that number are oatmeal raisin. 1/4 of the remaining cookies are peanut butter. How many cookies are peanut butter?
def solve() -> int: total_cookies = 50 chocolate_chip = 0.1 * total_cookies oatmeal_raisin = 6 * chocolate_chip remaining_cookies = total_cookies - chocolate_chip - oatmeal_raisin peanut_butter = 0.25 * remaining_cookies result = peanut_butter return result
Olivia sold 80 books in the first week of April. In the second week, she sold 25% more books than in the first week. In the third week, however, she sold 40% less books than in the second week. How many books has Olivia sold so far in April?
def solve() -> int: books1 = 80 books2 = books1 * 1.25 books3 = books2 * 0.6 total = books1 + books2 + books3 result = total return result
Tim has 5 more pencils than Jane. If Jane has 8 pencils, how many pencils do they have together?
def solve() -> int: pencils_jane = 8 pencils_tim = pencils_jane + 5 pencils_together = pencils_jane + pencils_tim result = pencils_together return result
The average of 5 numbers is 21. If one of the numbers is 18, find the average of the remaining numbers.
def solve() -> int: total_sum = 21*5 given_num = 18 remaining_sum = total_sum - given_num remaining_average = remaining_sum/4 result = remaining_average return result
Mark ran a total of 8 miles last week. If he ran 60% of that distance on Monday and Tuesday combined, how many miles did he run on Monday and Tuesday?
def solve() -> int: total_distance = 8 mon_tue_distance = total_distance * 0.6 result = mon_tue_distance / 2 return result
Jeffrey is making keychains for five of his friends. Each keychain requires 17 inches of thread. How much thread does Jeffrey need in total?
def solve() -> int: num_of_friends=5 thread_for_each_keychain=17 total_length = num_of_friends * thread_for_each_keychain result = total_length return result
9. There are 16 apples divided among 4 people. How many apples does each person get?
def solve() -> int: apples = 16 people = 4 each = apples/people result = each return result
A bag contains 30 red balls and 20 blue balls. What is the probability of picking a blue ball?
def solve() -> int: total_balls = 30 + 20 blue_balls = 20 probability = blue_balls/total_balls result = probability return result
Jim drove for 5 hours. His average speed was 60 miles per hour. What distance did he cover?
def solve() -> int: hours = 5 speed = 60 distance = hours * speed result = distance return result
Student: 9. Katy and her friend Lara went to the local bookstore. Katy purchased four dictionaries for $7 each and Lara purchased three novels for $10 each. How much money did they spend together?
def solve() -> int: dictionaries = 4 price_dictionaries = 7 novels = 3 price_novels = 10 total_katy = dictionaries * price_dictionaries total_lara = novels * price_novels total_both = total_katy + total_lara result = total_both return result
Possible questions and programs: Lisa has 12 stickers in her album. She collects 3 stickers every week from her friends. How many stickers will she have in her album after 7 weeks?
def solve() -> int: stickers = 12 for week in range(7): stickers = stickers + 3 result = stickers return result
Every weekend, Aidan plays video games. He usually plays for 2 hours on Saturdays and 3 hours on Sundays. However, this weekend he has a lot of homework, so he decided to play for half as long as usual. How many hours did he play video games this weekend?
def solve() -> int: saturday_hour = 2 sunday_hour = 3 homework_factor = 0.5 total_hour = (saturday_hour + sunday_hour) * homework_factor result = total_hour return result
Student: A car travels at a speed of 60 km/h for the first 45 minutes and then increases its speed to 80 km/h for the next 2 hours and 15 minutes. What is the average speed of the car during this time?
def solve() -> int: speed1 = 60 time1 = 45 speed2 = 80 time2 = 135 distance1 = speed1 * (time1 / 60) distance2 = speed2 * (time2 / 60) total_distance = distance1 + distance2 total_time = time1 + time2 average_speed = total_distance / (total_time / 60) result = average_sp...
3. Jack collected 27 seashells during his vacation and later gave away 4 seashells at the end of the trip. How many seashells did he keep?
def solve() -> int: total_shells = 0 total_shells = total_shells + 27 total_shells = total_shells - 4 result = total_shells return result
Olivia is going food shopping. If she buys 3 pineapples for $7 each and 7 grapes for $3 each, how much does she spend?
def solve() -> int: pineappleCost = 7 pineappleNum = 3 grapeCost = 3 grapeNum = 7 totalCost = pineappleCost * pineappleNum + grapeCost * grapeNum result = totalCost return result
Musician David has to perform 8 songs in the concert. Each song is 3 minutes long. If he already performed 3 songs for 10 minutes and took a 5-minute break, how many more minutes does he need to perform for the next hour?
def solve() -> int: songs_performed = 3 song_length = 3 break_length = 5 total_songs = 8 minutes_per_hour = 60 total_time = (total_songs - songs_performed) * song_length + break_length remaining_time = minutes_per_hour - total_time result = remaining_time return result...
Alex sold cupcakes at a bake sale. Over four hours, he sold cupcakes worth $48. If one cupcake costs $2, how many cupcakes on average did he sell during one of these four hours?
def solve() -> int: total_cupcakes_sold = 48 cost_per_cupcake = 2 hours = 4 average_cupcakes_sold = total_cupcakes_sold / hours result = average_cupcakes_sold return result
A library has 104 books. If they put 8 books on each shelf, how many shelves will they need?
def solve() -> int: total_books = 104 books_per_shelf = 8 shelves_needed = total_books // books_per_shelf + 1 result = shelves_needed return result
Questions 4: Darren has a long rectangular table which is 1.5m long and 0.5m wide. How many square meters does the table cover?
def solve() -> int: length_table = 1.5 width_table = 0.5 area_table = length_table * width_table result = area_table return result
Student: A car travels a distance of 280 km with a speed of 70 km/hr. How long does it take to cover the distance?
def solve() -> int: distance = 280 speed = 70 time = distance / speed result = time return result
Eva works 5-hour shifts in a flower shop. She can arrange 6 bouquets in an hour, but she has to discard 1 bouquet every hour due to wilting. How many bouquets can she arrange in 8 shifts?
def solve() -> int: bouquets_per_hour = 6 bouquets_discarded = 1 shifts = 8 bouquets_net = bouquets_per_hour - bouquets_discarded bouquets = shifts * bouquets_net result = bouquets return result
Olivia owes $200 on her credit card. She buys a bike for $350 and then receives a refund for $100. What is the new balance on her credit card?
def solve() -> int: credit_card_balance = 200 bike_cost = 350 refund = 100 new_balance = credit_card_balance + bike_cost - refund result = new_balance return result
Ava is participating in a run-a-thon and wants to match the amount raised by the previous year's winner. Last year, runners raised $10 for every kilometer they ran. This year, the event pays $6 per kilometer. If last year's winner raised $200, how many more kilometers does Ava need to run to reach the same amount?
def solve() -> int: last_year_pay_per_km = 10 last_year_winner_raised = 200 this_year_pay_per_km = 6 amount_to_match = last_year_winner_raised amount_per_km_to_match = amount_to_match / last_year_pay_per_km kms_to_match = amount_per_km_to_match / this_year_pay_per_km result = ...
Mia is planning a road trip that is 500 miles long. She drives 60 miles per hour on highways and 30 miles per hour on local roads. If Mia spends 2/5 of the time on highways and the rest on local roads, how long will the trip take?
def solve() -> int: time_on_highways = 3.33 time_on_local_roads = 5 total_time = 8.33 result = "The road trip will take " + str(total_time) + " hours." return result
John has 3 cats. Each cat has 3 kittens. John gives away 2 kittens to his neighbors. How many kittens does John have left?
def solve() -> int: cats = 3 kittens = cats * 3 kittens -= 2 result = kittens return result
Student: Tanya buys and sells bread. She buys bread for 1 dollar each and sells them for 1.5 dollars each. If she buys 50 loaves of bread and sells 45 of them, how much profit does she make in cents?
def solve() -> int: buy_price = 1 sell_price = 1.5 num_loaves_bought = 50 num_loaves_sold = 45 total_cost = buy_price * num_loaves_bought total_revenue = sell_price * num_loaves_sold profit = total_revenue - total_cost profit_in_cents = profit * 100 result = profit_in_cents ...
A store has a total of 600 products. If 30% of these products are on sale, how many products are not on sale?
def solve() -> int: on_sale_products = 0.3 * 600 not_on_sale_products = 600 - on_sale_products result = not_on_sale_products return result
Ava and Sophia split a sum of money in the ratio 2:5. If Ava got $30 (which is the smaller share), how much did they share?
def solve() -> int: ava_share = 30 ratio_ava = 2 ratio_sophia = 5 total_share = ava_share * (ratio_ava + ratio_sophia) / ratio_ava result = total_share return result
Mark has a bag of chips of 50 grams. He ate 75% of the bag. How many grams of chips is still in the bag?
def solve() -> int: weight_of_chips = 50 percent_eaten = 0.75 remaining_chips = weight_of_chips * (1 - percent_eaten) result = remaining_chips return result
George has to pay a $55 fee every month. If George has paid the fee for the past 4 years, how much money has he spent on fees?
def solve() -> int: fee_per_month = 55 num_months = 4 total_fees = fee_per_month * num_months result = total_fees return result
Student: John has a collection of books and each book is 1.2 inches thick. There are 45 books in the collection, how many inches of thickness will the collection take up?
def solve() -> int: num_books = 45 book_thickness = 1.2 total_thickness = num_books * book_thickness result = total_thickness return result
Cindy is making a necklace with beads. She has 24 blue beads and 16 red beads. She wants to make a pattern of blue and red beads that repeats every 4 beads, like BRBR or BBRB. How many different patterns can she make?
def solve() -> int: blue = 24 red = 16 length = 4 patterns = 0 for b in range(0, length + 1): r = length - b if b <= blue and r <= red: patterns = patterns + 1 patterns = patterns * 2 result = patterns return result
Ben has 15 red balloons at his birthday party. His friend, Alex, brought 8 fewer red balloons. How many red balloons do they have in total?
def solve() -> int: red_balloons_ben = 15 red_balloons_alex = red_balloons_ben - 8 total_red_balloons = red_balloons_ben + red_balloons_alex result = total_red_balloons return result
Ella's rabbit, Floppy, was born on the same day that Kai turned 3 years old. Kai is exactly 1 year older than is Liam. On Liam's 6th birthday, how many years old was Ella's rabbit, Floppy?
def solve() -> int: kai_age = 3 liam_age = kai_age - 1 floppy_age = liam_age + 6 result = floppy_age return result
A charity organization receives a donation of $5000. If they divide it evenly among 25 members, how much will each member receive?
def solve() -> int: donation_amount = 5000 num_members = 25 amount_per_member = donation_amount/num_members result = amount_per_member return result
A chef bought 12 pounds of flour for $20. If he needs 1.5 pounds of flour for a recipe, how many dollars does he spend for each recipe?
def solve() -> int: flour = 12 price = 20 flour_recipe = 1.5 price_per_recipe = (price / flour) * flour_recipe result = price_per_recipe return result
Mark purchases a rectangular piece of land that is 32 by 20 feet. He wants to build 7 identical cabins on the land, with one cabin being twice as big as the others. What is the size of the larger cabin?
def solve() -> int: length = 32 width = 20 total_area = length * width small_cabin_area = total_area / 7 large_cabin_area = 2 * small_cabin_area result = large_cabin_area return result
Student: In an experiment with E.coli, the population doubles every 25 minutes. If 20,000 cells are released into the environment after 4.5 hours, what is the final population after 9.5 hours?
def solve() -> int: initial_population = 20000 time_interval = 25 time_elapsed = 4.5 final_time = 9.5 doubling_times = (final_time - time_elapsed) * (60 / time_interval) final_population = initial_population * (2 ** doubling_times) result = final_population return result
Brandon is 4 years younger than Savannah. In 10 years, Savannah will be three times Brandon's age. How old is Brandon now?
def solve() -> int: a = 4 b = 10 c = 3 d = b - a e = d * c result = e + 10 return result
A pizza costs $15. If a group of 8 friends decide to share 4 pizzas, how much money does each person have to contribute?
def solve() -> int: pizza_cost = 15 number_of_friends = 8 number_of_pizzas = 4 total_cost = pizza_cost * number_of_pizzas cost_per_person = total_cost/number_of_friends result = cost_per_person return result
``` An investment account has an initial balance of $5000 and earns 7% interest per year. If the account owner does not deposit or withdraw any money, how much will the account be worth in 10 years?
def solve() -> int: start_balance = 5000 interest_rate = 0.07 years = 10 for year in range(years): start_balance += start_balance * interest_rate result = start_balance return result
A car travels at a speed of 45 mph for 2 hours and then at a speed of 60 mph for 1 hour. What is the average speed of the car for the entire journey?
def solve() -> int: distance = 45 * 2 + 60 * 1 time = 2 + 1 average_speed = distance / time result = average_speed return result
Student: John invests $10000 in a savings account that pays 5% interest per annum. What is the balance of the account after 5 years if the interest is compounded annually?
def solve() -> int: principal = 10000 rate = 0.05 time = 5 result = principal * (1 + rate) ** time return result
Student: Peter earned $30 for 4 hours of work. What is his hourly wage?
def solve() -> int: hours = 4 earnings = 30 hourly_wage = earnings / hours result = hourly_wage return result
Rachel and Mark agreed to buy a laptop, a printer, and a scanner. The laptop costs $900, the printer costs $150, and the scanner costs $100. Rachel has agreed to pay for the laptop, and Mark will pay for the printer with the remaining cost split in half. How much more money will Rachel spend than Mark?
def solve() -> int: laptop_cost = 900 printer_cost = 150 scanner_cost = 100 total_cost = laptop_cost + printer_cost + scanner_cost mark_cost = (total_cost - laptop_cost - printer_cost) / 2 rachel_cost = laptop_cost difference = rachel_cost - mark_cost result = difference ...
Daniel is training for a marathon that is in 6 months. He wants to run 300 miles before the marathon. How many miles per week does he need to run to achieve his goal?
def solve() -> int: months = 6 total_miles = 300 weeks = months * 4 miles_per_week = total_miles / weeks result = miles_per_week return result
Your phone plan includes 500 minutes of talk time and unlimited texting. If you use 350 minutes in a month, how many more minutes do you have left before you reach the limit?
def solve() -> int: plan_limit = 500 minutes_used = 350 minutes_left = plan_limit - minutes_used result = minutes_left return result
Lisa spent $38.25 on 5 DVD's, what was the average price of a DVD?
def solve() -> int: total_cost = 38.25 number_of_DVDs = 5 average_price = total_cost / number_of_DVDs result = average_price return result
A car can travel 450 km in 5.5 hours. How far can it go in 7 hours?
def solve() -> int: distance_per_hour = 450 / 5.5 distance = distance_per_hour * 7 result = distance return result
Kate completed 2 jigsaw puzzles last month, but this month, she was only able to complete half the amount due to an exam. If Kate wants to complete double the amount as last month and each puzzle costs $15, how much would she have to spend?
def solve() -> int: puzzles_last_month = 2 puzzles_this_month = puzzles_last_month / 2 double_puzzles_this_month = puzzles_this_month * 2 cost_per_puzzle = 15 total_cost = double_puzzles_this_month * cost_per_puzzle result = total_cost return result
A baker made 100 cupcakes. She sold 30 on Wednesday, and then made 50 more on Thursday. On Friday, 20 more were sold, and then 40 were made on Saturday. If half of the remaining cupcakes were given to charity, how many cupcakes are left?
def solve() -> int: cupcakes = 100 cupcakes -= 30 cupcakes += 50 cupcakes -= 20 cupcakes += 40 cupcakes //= 2 result = cupcakes return result
Elizabeth used to cook dinner for her family every night but due to her busy schedule, she stopped. She used to make 3 dishes, a lasagna that serves 12 people, a roasted chicken that serves 8 people, and a salad that serves 6 people. If she lost 25% of the ingredients for lasagna, no ingredients for roasted chicken and...
def solve() -> int: lasagna_serves = 12 roasted_chicken_serves = 8 salad_serves = 6 lasagna_ingredients = lasagna_serves * 1.25 roasted_chicken_ingredients = 0 salad_ingredients = salad_serves * 0.5 total_serves = int(lasagna_ingredients / lasagna_serves) + int(roasted_chicken_ingr...
- Possible new questions and python programs: Laura likes to collect stamps and store them in albums. Each album has 12 pages and each page can fit 16 stamps. Laura has 6 albums, but one of them is missing a page. If Laura fills up all the albums except for the last one, which has only 10 pages filled, how many stamps ...
def solve() -> int: stamps_per_album = 12 * 16 stamps_in_last_album = 10 * 16 total_stamps = (6 - 1) * stamps_per_album + stamps_in_last_album result = total_stamps return result
Douglas is five times as old as his brother Victor. If Douglas is 36 years old, how old is Victor?
def solve() -> int: ageDouglas = 36 ageVictor = ageDouglas/5 result = ageVictor return result
Student: A train travels 50 miles per hour for 2 hours, and then 60 miles per hour for the next 3 hours. How far did the train travel in total?
def solve() -> int: speed1 = 50 time1 = 2 speed2 = 60 time2 = 3 distance1 = speed1 * time1 distance2 = speed2 * time2 total_distance = distance1 + distance2 result = total_distance return result
Sally has 3 shirts, 4 pants, and 2 pairs of shoes. If she wants to wear a different outfit every day for a month (30 days), how many different outfits can she wear?
def solve() -> int: shirts = 3 pants = 4 shoes = 2 outfits_per_day = shirts * pants * shoes outfits_per_month = outfits_per_day ** 30 result = outfits_per_month return result
After jogging for 2 hours, two friends buy smoothies. Bob spends one-third of what Nathan does on a smoothie. Nathan and Emily order smoothies of the same price. If Emily pays $6 for her smoothie, how much did all three friends spend in total?
def solve() -> int: hours_jogging = 2 price_emily = 6 price_nathan = price_emily price_bob = price_nathan / 3 total_spent = (price_nathan + price_bob + price_emily) * hours_jogging result = total_spent return result
Jackson is organizing a party. He wants to use all the balloons he has to decorate the party area. He has 50 blue balloons, 75 green balloons, 100 yellow balloons, and 30 red balloons. He ties a simple knot between each balloon, which reduces the length by 2 inches. What is the total length of the balloons string after...
def solve() -> int: blue_balloons = 50 green_balloons = 75 yellow_balloons = 100 red_balloons = 30 total_balloons = blue_balloons + green_balloons + yellow_balloons + red_balloons total_length = total_balloons * (12 - 2) result = total_length return result
Josh has a box for storing his shoes. He can fit 60 pairs of shoes in the box, unless they are boots, which take up twice the space. He has already filled it with 5 pairs of boots and 25 pairs of regular shoes. How many pairs of regular shoes can he fit into the remainder of the box?
def solve() -> int: max_shoes = 60 * 2 filled_shoes = 5 * 2 + 25 remaining_space = max_shoes - filled_shoes remaining_shoes = remaining_space // 2 result = remaining_shoes return result
Student: Jake went to the grocery store and bought a loaf of bread for $2.75, 3 apples for $1.50 each, and 5 oranges for $0.75 each. How much money did Jake spend in total?
def solve() -> int: bread_price = 2.75 apple_price = 1.50 orange_price = 0.75 total_cost = bread_price + (apple_price * 3) + (orange_price * 5) result = total_cost return result
A pet store had some birds and dogs. There were 10 birds and 12 dogs. Someone bought 5 of the birds and 2 of the dogs. How many animals are left in the pet store?
def solve() -> int: b_init = 10 b_sold = 5 b_left = b_init - b_sold d_init = 12 d_sold = 2 d_left = d_init - d_sold result = b_left + d_left return result
A doctor has 70 adult patients and 120 child patients. If each appointment can only be for one patient, how many total appointments can the doctor make?
def solve() -> int: adult_patients = 70 child_patients = 120 total_patients = adult_patients + child_patients result = total_patients return result
If Mia's deodorant blocks all but 50% of sweat, and 30% of the sweat it doesn't block causes body odor, what percentage of sweat doesn't cause body odor and still gets blocked?
def solve() -> int: block_percentage = 50 odor_percentage = 30 non_odor_blocked_percentage = block_percentage - odor_percentage result = non_odor_blocked_percentage return result
After owning a piano for 7 years, Mr. Black decided to sell it. He sold it for a 10% profit and paid a 2.5% commission to the broker based on the original price of $6000. What was the selling price of the piano?
def solve() -> int: original_price = 6000 profit_percentage = 10 commission_percentage = 2.5 profit = original_price * (profit_percentage / 100) selling_price = original_price + profit commission = original_price * (commission_percentage / 100) final_selling_price = selli...
The conference lasts for 3 days. During the daytime, Rachel attends 4 workshops each day that are 90 minutes long. In the evening, she attends a 3-hour lecture each day. How much time does Rachel spend in total at the conference?
def solve() -> int: days = 3 workshops_per_day = 4 workshop_duration = 90 lecture_duration = 3 * 60 total_workshop_time = days * workshops_per_day * workshop_duration total_lecture_time = days * lecture_duration total_time = total_workshop_time + total_lecture_time result ...
A family picked out 9 shirts and 10 pants for their upcoming vacation trip. How many items of clothing did they select in total?
def solve() -> int: total_items = 9 + 10 result = total_items return result
1. Georgette raised $1200 from a bake sale. She gave $48 to each of her 15 siblings. How much money did she have left?
def solve() -> int: result = 1200 for i in range(15): result = result - 48 return result
If there are 60 seconds in a minute, how many seconds are in 2.5 minutes?
def solve() -> int: seconds_per_minute = 60 minutes = 2.5 total_seconds = seconds_per_minute * minutes result = total_seconds return result
A music festival had 1500 attendees. 1/10th of them left early due to bad weather, and 1/3rd of the remaining crowd didn't want to watch the last performer. Additionally, 100 people were asked to leave for breaking the rules. How many people enjoyed the last performance?
def solve() -> int: attendees = 1500 left_early = attendees / 10 stayed = attendees - left_early didnt_watch = stayed / 3 asked_to_leave = 100 enjoyed_last = stayed - didnt_watch - asked_to_leave result = enjoyed_last return result
5. Brad has a bag of cookies, each cookie has 3 chips. If Brad eats 3 cookies in one day, how many chips did he eat?
def solve() -> int: cookies_consumed = 3 chips_per_cookie = 3 result = cookies_consumed * chips_per_cookie print (result) return result
A rectangular box is 10cm long, 4cm wide and 2cm tall. What is the volume of the box?
def solve() -> int: volume = 10*4*2 result = volume return result
An ice cream shop sells $4 single scoops and $6 double scoops. If they make $500 in sales and sell 100 single scoops, how many double scoops did they sell?
def solve() -> int: single_scoop_price = 4 double_scoop_price = 6 total_sales = 500 num_single_scoops_sold = 100 total_single_scoop_sales = single_scoop_price * num_single_scoops_sold total_double_scoop_sales = total_sales - total_single_scoop_sales num_double_scoops_sold = total_double_scoo...
Student: A car can travel 30 miles per gallon of gas. If the gas tank has 12 gallons of gas, how far can the car travel without refueling?
def solve() -> int: miles_per_gallon = 30 gas_tank = 12 distance = miles_per_gallon * gas_tank result = distance return result
Sarah needs to buy 8 t-shirts that each cost $12, five pairs of jeans that each cost $30, and one jacket that costs $75. There are 100 cents to a dollar. How much will Sarah pay total, in dollars and cents?
def solve() -> int: t_shirts = 8 jeans = 5 jacket = 1 t_shirt_cost = 12 jeans_cost = 30 jacket_cost = 75 total_cost = (t_shirts * t_shirt_cost) + (jeans * jeans_cost) + (jacket * jacket_cost) total_cost_in_cents = total_cost * 100 result = total_cost_in_cents retur...
Rachel has a tablet with 16 GB of storage. She has already used 12 GB. If a game takes up 500 MB of storage, how many games can Rachel download on her tablet?
def solve() -> int: total_storage = 16 used_storage = 12 game_storage = 500 game_storage_gb = game_storage / 1000 remaining_storage = total_storage - used_storage num_games = remaining_storage // game_storage_gb result = num_games return result
A shirt costs $15 each and a pair of jeans costs $25 each. A shop offers a 10% discount on shirts and a 15% discount on jeans. How much does it cost to buy 3 shirts and 2 pairs of jeans after the discounts?
def solve() -> int: original_cost_shirt = 15 * 3 original_cost_jeans = 25 * 2 discounted_cost_shirt = original_cost_shirt * 0.9 discounted_cost_jeans = original_cost_jeans * 0.85 cost_total = discounted_cost_shirt + discounted_cost_jeans result = cost_total return result
How many college degrees are there among 6 people if each person has exactly 2 degrees and there are no duplicates?
def solve() -> int: total_degrees = 6 * 2 result = total_degrees return result
Every week, John sells 5 apples for each customer. Last week, he sold 100 apples. This week, only 15 customers bought apples. How many apples did John sell this week?
def solve() -> int: apples_per_customer = 5 total_customers = 15 apples_sold = apples_per_customer * total_customers result = apples_sold return result
Mary has 90 balls and wants to divide them into 6 even groups. How many balls will there be in each group?
def solve() -> int: total_balls = 90 groups = 6 each_balls = total_balls / groups result = each_balls return result
Isabel is a librarian. She has 450 books in her library. The bookshelves can hold 600 books. How many more books can Isabel add to the shelves?
def solve() -> int: books_in_library = 450 bookshelves_capacity = 600 books_can_be_added = bookshelves_capacity - books_in_library result = books_can_be_added return result
Daniel has 20 pencils in his pencil case, and he wants to buy three times as many. If he separates the pencils into five piles, how many pencils are in each pile?
def solve() -> int: pencils_in_case = 20 pencils_to_buy = 3 * pencils_in_case total_pencils = pencils_in_case + pencils_to_buy num_piles = 5 pencils_per_pile = total_pencils // num_piles result = pencils_per_pile return result
An office has 72 employees. The ratio of managers to assistants is 3:5. How many managers are in the office?
def solve() -> int: total_employees = 72 manager_ratio = 3/(3+5) managers = manager_ratio * total_employees result = managers return result
ofia baked 4 dozen cookies and 3 dozen muffins. She put 6 cookies or 4 muffins into each box. She sold a box of cookies for $8 and a box of muffins for $10. How much money does Sofia make from her baking?
def solve() -> int: cookies = 4 * 12 muffins = 3 * 12 cookie_boxes = cookies // 6 muffin_boxes = muffins // 4 cookie_revenue = cookie_boxes * 8 muffin_revenue = muffin_boxes * 10 total_revenue = cookie_revenue + muffin_revenue result = total_revenue return re...
If a car can travel 56 km on 4 liters of petrol, how much petrol is needed for a journey of 350 km?
def solve() -> int: distance = 350 km_per_liter = 56 / 4 petrol_needed = distance / km_per_liter result = petrol_needed return result
Charlie has a bookshelf. He reads 2 books every day for 15 days. After that, he buys 10 more books and adds them to his bookshelf. He now has 40 books on his bookshelf. How many books did Charlie have on his bookshelf before he started reading?
def solve() -> int: books_per_day = 2 days = 15 books_read = books_per_day * days books_bought = 10 final_books = 40 books_before = final_books - (books_read + books_bought) result = books_before return result
Rachel has 4 notebooks, each containing 80 pages. She also has 2 binders with 100 pages in each binder. If Rachel writes on half of the notebooks and fills half of the binders, how many pages of notebooks and binders has she written on or filled in total?
def solve() -> int: num_notebook_pages = 4 * 80 num_binder_pages = 2 * 100 num_notebook_pages *= 0.5 num_binder_pages *= 0.5 result = (num_notebook_pages, num_binder_pages) return result
Student: Zoey has $1000. She gave a third of her money to charity and then bought 12 things. Each thing cost $30. What is the total amount of Zoey's money remaining if all of Zoey's money is used to buy as many things as possible?
def solve() -> int: zoey_money = 1000 charity_fraction = 1/3 thing_cost = 30 things_bought = 12 charity_money = charity_fraction * zoey_money things_money = things_bought * thing_cost zoey_money_left = zoey_money - charity_money - things_money things_left = zoey_money_left // thing_c...
William is packaging cookies to sell. He has eight packages, and each package contains twelve cookies. How many cookies does he have in total?
def solve() -> int: num_packages = 8 cookies_per_package = 12 total_cookies = num_packages * cookies_per_package result = total_cookies return result
Michael is a driver deciding how much fuel to put in his car. The empty car needs 25 gallons of fuel per mile. Each passenger in the car increases this amount by 1 gallon per mile, and each extra item in the car increases it by 2 gallons per mile. If there are 3 passengers and 7 extra items, how many gallons of fuel do...
def solve() -> int: empty_car = 25 passenger_fuel = 1 extra_item_fuel = 2 passengers = 3 extra_items = 7 distance = 150 total_fuel = empty_car + (passenger_fuel * passengers) + (extra_item_fuel * extra_items) total_fuel_needed = total_fuel * distance result = total_fue...
Student: Nadia takes a taxi to work. She pays $8 for the first two miles and $3 for every additional mile. If her ride is 6 miles, how much does she pay?
def solve() -> int: base_fare = 8 extra_fare = 3 total_miles = 6 extra_miles = total_miles - 2 total_fare = base_fare + extra_fare * extra_miles result = total_fare return result
There are 60 students in a class. If the ratio of boys to girls is 2:3. How many girls are there in the class?
def solve() -> int: total_ratio = 2 + 3 girls_ratio = 3 / total_ratio girls = girls_ratio * 60 result = girls return result
Kyle, Leah, and Mike buy candy bars for a party. Kyle buys 24 candy bars. Leah buys 18 candy bars. Mike buys 6 candy bars less than Leah. Each candy bar costs 75 cents. How much money do they spend in total?
def solve() -> int: kyle = 24 leah = 18 mike = leah - 6 total = kyle + leah + mike money = total * 0.75 result = money return result
Sam saved $50 each week for 6 weeks, then saved $100 each week for 3 weeks. What was the average amount Sam saved per week?
def solve() -> int: savings_week1_to_6 = 50 * 6 savings_week7_to_9 = 100 * 3 total_savings = savings_week1_to_6 + savings_week7_to_9 weeks = 6 + 3 average_savings = total_savings / weeks result = average_savings return result
If a total of 29 cans of soda and juice are sold, and the ratio of soda to juice is 2:3, how many cans of juice are sold?
def solve() -> int: total_cans_sold = 29 soda_to_juice_ratio = 2/3 num_juice_cans_sold = total_cans_sold/(1+soda_to_juice_ratio)*soda_to_juice_ratio result = num_juice_cans_sold return result
Rachel's rollerblades take six fewer minutes to complete the same trip to the park as Jane's scooter. If Jane's scooter takes 18 minutes to travel 6 kilometers to the park, how long will it take Rachel's rollerblades to complete a round trip?
def solve() -> int: scooter_time = 18 scooter_distance = 6 rollerblades_time = scooter_time - 6 round_trip_time = rollerblades_time * 2 result = round_trip_time return result
A pizza has 8 slices. If 3 people each take 2 slices, how many slices are left?
def solve() -> int: slices_in_pizza = 8 slices_each_person = 2 people_take_slices = 3 slices_left = slices_in_pizza - (slices_each_person * people_take_slices) result = slices_left return result
A cookie recipe requires 2 1/4 cups of flour, 1 teaspoon baking soda, and 1/2 teaspoon salt. If Emma wants to make half of the recipe, how many cups of flour does she need?
def solve() -> int: full_recipe_flour = 2.25 half_recipe_flour = full_recipe_flour / 2 result = half_recipe_flour return result
A cyclist traveled 280 kilometers in 8 hours. He stopped for a break every 2 hours and spent 15 minutes for each break. What was his average speed in kilometers per hour when he was cycling?
def solve() -> int: distance = 280 time = 8 break_interval = 2 break_duration = 0.25 breaks = time // break_interval break_time = breaks * break_duration cycling_time = time - break_time average_speed = distance / cycling_time result = average_speed return ...