question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Lisa's car travels at 28 miles per hour. When she enters the tunnel, her speed drops by 15 percent, and when she exits, it increases by 25 percent. If she has to travel for 80 miles, with two-thirds of it through the tunnel, how long will the entire journey last?
def solve() -> int: speed = 28 distance = 80 tunnel_distance = distance * (2/3) tunnel_speed = speed - (speed * 0.15) tunnel_time = tunnel_distance / tunnel_speed outside_tunnel_speed = speed + (speed * 0.25) outside_tunnel_distance = distance - tunnel_distance outside_tunnel_t...
John paid $20 for 4 movie tickets and popcorn. If each movie ticket costs $5, how much was the popcorn?
def solve() -> int: total_cost = 20 num_tickets = 4 ticket_cost = 5 popcorn = total_cost - num_tickets*ticket_cost result = popcorn return result
There are 4183 pink balloons and there are 5992 more white balloons than pink balloons. If the balloons will be evenly divided among 10 schools, how many balloons will one school receive?
def solve() -> int: total_balloons = 4183 + 5992 balloons_per_school = total_balloons / 10 result = balloons_per_school return result
A recipe calls for 2 cups of flour to make 12 muffins. If you want to make 24 muffins, how much flour will you need?
def solve() -> int: cups_per_muffin = 2/12 flour_needed = cups_per_muffin * 24 result = flour_needed return result
Carla is planning a trip to Europe. She wants to visit three countries. Plane tickets for the first country cost $500, for the second one $600, and for the third one $800. She also needs $600 for visas. If she gets a 15% discount on the tickets, how much does she pay altogether?
def solve() -> int: tickets_cost = 500 + 600 + 800 visas_cost = 600 total_cost = tickets_cost + visas_cost discount = tickets_cost * 0.15 total_cost -= discount result = f'<<<{total_cost}>>>' result = total_cost return result
Ryan has eight rabbits and two of them are white. If each white rabbit has 4 babies, and Ryan sells 3 of them, what percentage of his remaining rabbits are white (rounded to the nearest percent)?
def solve() -> int: total_rabbits = 8 + 2 * 4 remaining_rabbits = total_rabbits - 3 remaining_white = 2 + 2 * 4 - 3 percentage = remaining_white / remaining_rabbits * 100 percentage = round(percentage) result = percentage return result
John is landscaping his backyard and plants 5 tulip bulbs per square foot. If his backyard is 24 sq ft, how many tulip bulbs does he need?
def solve() -> int: tulips_per_sqft = 5 backyard_area = 24 total_tulips = tulips_per_sqft * backyard_area result = total_tulips return result
A hospital plans to purchase 1500 new medical devices, but due to budget constraints, they reduce the amount of devices by 40%. Due to quality issues, the hospital decides to suspend the use of 25% of the remaining devices. How many devices will the hospital eventually use?
def solve() -> int: initial_devices = 1500 reduced_devices = initial_devices * 0.6 final_devices = reduced_devices * 0.75 final_devices = round(final_devices) result = final_devices return result
- Some possible new questions and programs are: Mia bakes 5 batches of cookies. Each batch has 24 cookies. She gives away 3 cookies to each of her 10 friends and keeps the rest for herself. Each cookie has 80 calories. How many calories does Mia eat from the cookies?
def solve() -> int: total_cookies = 5 * 24 given_cookies = 3 * 10 remaining_cookies = total_cookies - given_cookies calories = remaining_cookies * 80 result = calories return result
A square has an area of 16 square centimeters. What is the length of one of its sides?
def solve() -> int: side_length = 4 result = f'<<<{side_length}>>>' result = side_length return result
Dave grows flowers in his garden. He plants 18 seeds the first day and 24 seeds the second day. On the third day, he plants 20% fewer seeds than the second day. He sells each flower for $2. How much money can he make if all the seeds grow into flowers?
def solve() -> int: seeds_day1 = 18 seeds_day2 = 24 seeds_day3 = seeds_day2 * 0.8 total_seeds = seeds_day1 + seeds_day2 + seeds_day3 total_money = total_seeds * 2 result = total_money return result
A recipe calls for 2 and a half cups of flour. If you want to make half of the recipe, how many cups of flour will you need?
def solve() -> int: half_flour = (2.5 / 2) * 0.5 result = half_flour return result
If Katie has $100 and she spends 25% of her money on candy, how much money does Katie have left?
def solve() -> int: katie_initial_amount = 100 katie_spent_candy = katie_initial_amount * 0.25 result = katie_initial_amount - katie_spent_candy return result
In a group of 400 people, 25% are children and the rest are adults. How many adults are there?
def solve() -> int: people = 400 children_percentage = 25 adults_percentage = 100 - children_percentage adults = (adults_percentage / 100) * people result = adults return result
If a store opens at 10 am on Tuesday and Friday, and closes at 5 pm on Tuesday and 7 pm on Friday, how many hours is the store open in 6 Weeks?
def solve() -> int: tuesday = 7 friday = 7 average_open_hours_in_one_week = (tuesday + friday)/2 total_open_hours_in_6_weeks = average_open_hours_in_one_week * 6 result = total_open_hours_in_6_weeks return result
Student: A grocery store offers a discount of 5% if a customer buys at least 10 items. If a customer purchased 15 items at $2 each, how much will the customer pay after the discount?
def solve() -> int: items = 15 price = 2 discount_rate = 0.05 total_price = items * price discount_amount = total_price * discount_rate final_price = total_price - discount_amount result = final_price return result
At 33, Josh is 4/5 the age of Emily. What is their average age in 8 years?
def solve() -> int: josh_age = 33 emily_age = josh_age / (4/5) average_age = (josh_age + emily_age + 8*2) / 2 result = average_age return result
A pack of six pens costs $3.60. How much would 30 pens cost?
def solve() -> int: num_pens_in_pack = 6 cost_of_pack = 3.60 cost_per_pen = cost_of_pack / num_pens_in_pack num_pens = 30 total_cost = num_pens * cost_per_pen result = total_cost return result
Inge has 18 apples. She decided to give 5 apples to her friends and keep the rest of the apples for herself. How many apples did she keep?
def solve() -> int: apples_total = 18 apples_given = 5 apples_kept = apples_total - apples_given result = apples_kept return result
If Alex has 40 candies, and Bob has 80 candies, and Charlie has 60 candies, how many times can Alex's number of candies fit into the average amount of candies for a person in the group?
def solve() -> int: alex_candies = 40 bob_candies = 80 charlie_candies = 60 total_candies = alex_candies + bob_candies + charlie_candies average_candies = total_candies / 3 times_fit = average_candies // alex_candies result = times_fit return result
If a painter can paint a wall in 5 hours, how long does it take for 3 painters to paint the same wall?
def solve() -> int: painters_count = 3 time_taken = 5 result = time_taken/1 * painters_count return result
A rectangular plot needs to be fenced. The length of the plot is 47 meters and the width of the plot is 28 meters. A pillar will be placed at every 2 meters and a roll of wire is enough for 40 meters. How many rolls of wire will be needed to fence the plot?
def solve() -> int: length, width = 47,28 pillar_spacing = 2 extra = 0 if length % 2!= 0: extra += width if width % 2!= 0: extra += length total_wire_length = 2 * (length + width) + extra rolls_needed = total_wire_length / 40 result = () return result
In a closet, there are 15 dresses and 10 pairs of shoes. Lily goes to the mall and buys 8 more dresses and 1/2 as many shoes as before. After returning home, her sister gives her 1/6 times more shoes than the number she purchased at the store. How many clothing items does Lily have if she puts all of them together?
def solve() -> int: dresses_in_closet = 15 shoes_in_closet = 10 dresses_bought = 8 shoes_bought = shoes_in_closet / 2 shoes_from_sister = shoes_bought * (1 + 1/6) total_dresses = dresses_in_closet + dresses_bought total_shoes = shoes_in_closet + shoes_bought + shoes_from_siste...
John drives to work every day and takes 10 minutes to walk from his car into the office building. If he drives 20 minutes to work on Monday, and decreases his driving time by 2 minutes every day, and leaves for work at the same time every day, how long will it take him to get to work on Friday?
def solve() -> int: monday_drive_time = 20 driving_time_decrease = 2 total_driving_time = sum(range(monday_drive_time, monday_drive_time - (driving_time_decrease*4), -driving_time_decrease)) total_walking_time = 10*5 time_to_work_friday = total_driving_time + total_walking_time result = time_to_...
Alex went to the store and bought 6 items. Each item costs $3.50. He gave the cashier a $40 bill, how much change should he get back?
def solve() -> int: total_price = 6 * 3.50 change = 40 - total_price result = change return result
A pack of 24 pencils costs $4, and a pack of 36 pencils costs $6.50. Which pack of pencils is more expensive per pencil?
def solve() -> int: pack_of_24_price = 4 pack_of_36_price = 6.5 num_pencils_in_pack_of_24 = 24 num_pencils_in_pack_of_36 = 36 price_per_pencil_for_24_pack = pack_of_24_price / num_pencils_in_pack_of_24 price_per_pencil_for_36_pack = pack_of_36_price / num_pencils_in_pack_of_36 more_expensive...
A store is offering a 30% discount on all items. If a shirt originally costs $50, what is the discounted price?
def solve() -> int: original_price = 50 percentage_discount = 0.3 discount_amount = original_price * percentage_discount discounted_price = original_price - discount_amount result = discounted_price return result
Sam has a rectangular garden that is 12 meters long and 8 meters wide. He wants to plant some flowers along the perimeter of the garden, leaving 1 meter of space between each flower. If each flower requires 0.25 square meters of soil, how much soil does he need to buy?
def solve() -> int: perimeter = 2 * (12 + 8) flower_area = perimeter - 4 flowers = flower_area / 1 soil = flowers * 0.25 result = soil return result
Ben and Tom shared a pizza that cost $12. Ben paid $7 and Tom paid the rest. How much did Tom pay?
def solve() -> int: difference = 12 - 7 result = difference return result
James wants to buy a bike, a skateboard, and a scooter with a total of $300. The bike costs $120 and the skateboard is $80 less than the scooter. How much does the scooter cost?
def solve() -> int: bike_cost = 120 total_cost = 300 skateboard_cost = (total_cost - bike_cost) / 2 scooter_cost = skateboard_cost + 80 result = scooter_cost return result
Brian earns $11 an hour on Geography tutoring. For the first four days, he earned $44; and for the second four days, he earned $88 more than the first four days. How many hours did he spend on tutoring for eight days?
def solve() -> int: Hours1 = 44/11 Hours2 = (44+88)/11 result = Hours1 + Hours2 return result
A museum has 12 vases and 20 sculptures. The ratio of vases to sculptures is 3:4. The number of paintings is one-fifth of the number of vases and sculptures combined, and there are 10 times more photographs than paintings. What is the difference in number between sculptures and photographs?
def solve() -> int: vases = 12 sculptures = 20 paintings = (vases + sculptures) / 5 photographs = paintings * 10 result = sculptures - photographs return result
David has five times as many coins as Ella. Frank has 10 fewer coins than David. How many coins do these three kids have, if Ella has 8 coins?
def solve() -> int: Ella = 8 David = 5 * Ella Frank = David - 10 total = Ella + David + Frank result = total return result
Student: Emily has 8 blocks. Her grandpa gives her 11 more blocks. She now wants to divide all of them into 4 piles. How many blocks are in each pile?
def solve() -> int: blocks = 8 blocks = blocks + 11 piles = 4 blocks_per_pile = blocks // piles result = blocks_per_pile return result
Student: David has $50 in his bank account. He deposits $20 and then withdraws $10. How much money does David have in his account now?
def solve() -> int: initial_balance = 50 deposit = 20 withdrawal = 10 balance_after_deposit = initial_balance + deposit balance_after_transaction = balance_after_deposit - withdrawal result = balance_after_transaction return result
A garden is divided into two sections, one section has an area of 600 sq. meters and the other section has an area of 800 sq. meters. If each section has a width of 20 meters, what is the length of the garden?
def solve() -> int: section_area_one = 600 section_area_two = 800 width = 20 length = (section_area_one + section_area_two)/width result = length return result
Susan has a bag of flour to make cakes. The flour is enough to make six cakes, and each cake contains 2.5 cups of flour. A bag of flour has 15 cups. How many cups of flour does Susan need to make one cake?
def solve() -> int: flour_in_bag = 15 num_cakes = 6 flour_per_cake = flour_in_bag / num_cakes cups_per_cake = 2.5 flour_per_cup = flour_per_cake / cups_per_cake result = flour_per_cup return result
A furniture store sells chairs for $50 each and tables for $120 each. If it sold 20 chairs and 10 tables, what is the total revenue?
def solve() -> int: num_chairs = 20 chair_price = 50 num_tables = 10 table_price = 120 total_revenue = num_chairs * chair_price + num_tables * table_price result = total_revenue return result
Tom bought a bag of apples weighing 4 kg. Each day, he eats one-fifth of the bag. How many kg of apples will be left on the fourth day?
def solve() -> int: bag_weight = 4 eaten_per_day = bag_weight / 5 remaining_after_4_days = bag_weight - (eaten_per_day * 4) result = remaining_after_4_days return result
Cody scored 6 times as many points as Jake, who scored 8 points. Leah scored half as many points as Cody. How many points did Leah score?
def solve() -> int: jake = 8 cody = 6 * jake leah = cody / 2 result = leah return result
Jack drove for 4 hours at a speed of 60 km/h. How far did he travel?
def solve() -> int: time = 4 speed = 60 distance = time * speed result = distance return result
A classroom has 35 students. On average, 25 students attend the class every day. What percentage of students attend the class daily?
def solve() -> int: total_students = 35 number_of_students_attending = 25 percentage_attending = (number_of_students_attending / total_students) * 100 result = percentage_attending return result
Peter is in charge of ordering lunch for a meeting of 10 people. If each person needs 2 sandwiches, how many sandwiches does Peter need to order?
def solve() -> int: number_of_people = 10 sandwiches_per_person = 2 total_number_of_sandwiches = number_of_people * sandwiches_per_person result = total_number_of_sandwiches return result
Student: Leah is making bracelets with beads. She has 120 red beads, 90 blue beads, and 60 green beads. She wants to make bracelets that have the same number of red, blue, and green beads in each. What is the largest number of bracelets she can make?
def solve() -> int: red_beads = 120 blue_beads = 90 green_beads = 60 least_common_multiple = red_beads * blue_beads * green_beads greatest_common_divisor = min(red_beads, blue_beads, green_beads) result = least_common_multiple // greatest_common_divisor return result
Mike has a flower shop and is paid by the bunch. He gets $2 for each bunch of carnations, $3 for each bunch of roses, and $4 for each bunch of tulips. How much money will Mike make if he sells 7 bunches of carnations, 9 bunches of roses, and 5 bunches of tulips?
def solve() -> int: carnations = 2 * 7 roses = 3 * 9 tulips = 4 * 5 result = carnations + roses + tulips return result
Jacob buys 1.5 pounds of salmon for $9 a pound, 3 pounds of white rice for $1.50 a pound, and 1 pound of spinach for $3 a pound. What percentage of his grocery budget did he spend on fish, rounded to the nearest percent?
def solve() -> int: total_cost = 1.5*9 + 3*1.50 + 1*3 fish_cost = 1.5*9 percentage_fish_cost = (fish_cost/total_cost)*100 result = round(percentage_fish_cost) return result
- Maya is baking a cake for her birthday. She needs 4 eggs, 2 cups of flour, 1 cup of sugar, and 0.5 cup of oil for the recipe. She has 12 eggs, 5 cups of flour, 3 cups of sugar, and 1.5 cups of oil in her pantry. How many cakes can she bake with the ingredients she has?
def solve() -> int: cakes_eggs = 12 // 4 cakes_flour = 5 // 2 cakes_sugar = 3 // 1 cakes_oil = 1.5 // 0.5 cakes_all = min(cakes_eggs, cakes_flour, cakes_sugar, cakes_oil) result = cakes_all return result
A pizza joint has a special offer where they give a free pizza if the customer orders 5 or more pizzas. If each pizza costs $8, what is the total cost if 10 pizzas are ordered?
def solve() -> int: num_pizzas = 10 price_per_pizza = 8 free_pizzas = num_pizzas//5 total_cost = (num_pizzas - free_pizzas) * price_per_pizza result = total_cost return result
In a test, a student scored 400 out of 500 marks. If the passing the percentage is 35%, did the student pass or fail the test?
def solve() -> int: total_marks = 500 marks_scored = 400 pass_percentage = 35 pass_marks = total_marks * pass_percentage / 100 if marks_scored >= pass_marks: result = "Pass" else: result = "Fail" return result
6. During a family vacation, the Smith family had spent a total of 98 dollars for their meals. The cost for Mr. Smith was 45 more than the cost for Mrs. Smith. How much did Mrs. Smith spend?
def solve() -> int: cost_mr_smith = 98 / (45 + 1) result = cost_mr_smith - 45 return result
At the school library, 62 students are borrowing books and exchanging them. Half of the students are borrowing history books, a third are borrowing science fiction books, and the rest are borrowing science books. What is the total number of students borrowing science books?
def solve() -> int: total_students = 62 history_students = (total_students/2) sf_students = (total_students/3) science_students = total_students - (history_students + sf_students) result = science_students return result
The sum of the sides of a triangle is 71 centimeters. If two of the sides are 28 and 17 centimeters respectively, what is the length of the third side?
def solve() -> int: total_sum = 71 first_side = 28 second_side = 17 third_side = total_sum - first_side - second_side result = third_side return result
Student: There are 75 cars in a parking lot. There are 25 fewer cars at the end of the day. How many cars left the parking lot during the day?
def solve() -> int: cars_in_parking_lot = 75 cars_left_parking_lot = 25 result = cars_in_parking_lot - cars_left_parking_lot return result
Violet, Willow, and Xavier took part in a spelling bee. Violet spelled 10 more words correctly than Willow, and Willow spelled 7 more words than Xavier. If Xavier spelled 23 words correctly, how many words were spelled in total?
def solve() -> int: xavier_words = 23 willow_words = xavier_words + 7 violet_words = willow_words + 10 total_words = xavier_words + willow_words + violet_words result = total_words return result
Mary bought 6 books for $72. Each book cost the same amount. How much did she pay per book?
def solve() -> int: books = 6 total_price = 72 price_per_book = total_price/books result = price_per_book return result
Maya has a batch of cookies which requires 3 cups of flour, 1 cup of sugar and 2 eggs. If she wants to make 24 cookies, how many cups of flour and sugar will she need?
def solve() -> int: flour_per_cookie = 3/24 sugar_per_cookie = 1/24 eggs_per_cookie = 2/24 flour_needed = flour_per_cookie * 24 sugar_needed = sugar_per_cookie * 24 result = f'{flour_needed} cups of flour and {sugar_needed} cups of sugar are needed.' return result
A zoo has three times more birds than reptiles. If it has 240 reptiles, how many birds does it have?
def solve() -> int: b = 3 * 240 result = b return result
Dan rides a bike at 12 mph for 2 hours, and then takes 15 minutes of rest, and then rides again at 7 mph for 45 minutes. How many miles did he cover?
def solve() -> int: timeOnBike1 = 2 speed1 = 12 timeOnBike2 = 0.75 speed2 = 7 distance1 = timeOnBike1 * speed1 distance2 = timeOnBike2 * speed2 result = distance1 + distance2 return result
Liam is studying for a test. On the first day he studied 10 minutes. Every day after that he studied double the amount as the day before. If he studied for 6 days, how many minutes did he study in total?
def solve() -> int: day1 = 10 day2 = day1 * 2 day3 = day2 * 2 day4 = day3 * 2 day5 = day4 * 2 day6 = day5 * 2 total_minutes = day1 + day2 + day3 + day4 + day5 + day6 result = total_minutes return result
Sophia is five times as old as Ava. In eleven more years, Ava will be 27 years old. How old will Sophia be in eleven years?
def solve() -> int: ava_age = 27 - 11 sophia_age = 5 * ava_age sophia_age_in_eleven_years = sophia_age + 11 result = sophia_age_in_eleven_years return result
A jar is filled with 93 jelly beans. If 6 children take turns getting a handful of jelly beans each time until the jar is empty, how many handfuls of jelly beans does each child receive?
def solve() -> int: handfuls_each_child = 93 // 6 result = handfuls_each_child return result
An artist has 50 tubes of acrylic paint and 15 tubes of oil paint. If she takes away 7 tubes of acrylic paint and half as many oil paints as acrylic paints (without looking), how many paint tubes in total does she have left?
def solve() -> int: acrylic_paint_tubes = 50 oil_paint_tubes = 15 acrylic_paint_tubes -= 7 oil_paint_tubes -= acrylic_paint_tubes / 2 total_paint_tubes = acrylic_paint_tubes + oil_paint_tubes result = total_paint_tubes return result
arah bought 5 pairs of gloves for $6 each. She also bought 2 hats for $12 each. She paid the cashier $54. How much change did she receive?
def solve() -> int: gloves_price = 6 gloves_quantity = 5 hat_price = 12 hat_quantity = 2 total_price = gloves_price * gloves_quantity + hat_price * hat_quantity paid_amount = 54 change = paid_amount - total_price result = change return result
A train travels 300 kilometers at a speed of 50 kilometers per hour. How long does it take to reach its destination?
def solve() -> int: distance = 300 speed = 50 time = distance / speed result = time return result
The sum of three consecutive odd integers is 33. What is the product of these three numbers?
def solve() -> int: sum = 33 x = (sum - 6)/3 xx = x * 2 + 1 result = xx * (xx + 2) * (xx + 4) return result
Samantha has a rectangular garden with a width of 10 meters and a perimeter of 42 meters. What is the length of the garden?
def solve() -> int: perimeter = 42 width = 10 length = (perimeter - 2*width)/2 result = length return result
A recipe calls for 2 cups of flour to make 1 dozen cookies. How much flour is needed to make 6 cookies?
def solve() -> int: flour_per_dozen_cookies = 2 cookies_needed = 6 flour_needed = (flour_per_dozen_cookies / 12) * cookies_needed result = flour_needed return result
Oliver invested $1,000 for 5 years at a simple interest rate of 6%. How much interest did he earn?
def solve() -> int: interest = 1000*0.06*5 result = round(interest,2) return result
If 8 workers can paint a house in 10 days, how many workers are needed to paint the house in 4 days?
def solve() -> int: original_workers = 8 original_days = 10 new_days = 4 new_workers = (original_workers * original_days) / new_days result = new_workers return result
A school has 500 students and 25 teachers. Each student pays $1000 for tuition and each teacher receives $4000 for salary. The school also spends $10000 for utilities and $5000 for supplies. How much profit or loss does the school make in a year?
def solve() -> int: students = 500 student_tuition = 1000 teachers = 25 teacher_salary = 4000 utilities = 10000 supplies = 5000 total_income = students * student_tuition total_expense = teachers * teacher_salary + utilities + supplies profit_or_loss = total_income - total_expen...
In a library that can hold 1000 readers, 75% of the capacity was filled with readers who paid $5 each for access. What is the difference between the total collected in fees if the library was 75% full and if it was completely full?
def solve() -> int: capacity = 1000 filled_capacity = capacity * 0.75 fee_per_reader = 5 total_collected_75_percent = filled_capacity * fee_per_reader total_collected_full = capacity * fee_per_reader difference = total_collected_full - total_collected_75_percent result = diffe...
Olivia and her classmates ordered a pizza and asked to have it cut into 20 slices. During their lunch break, they only ate one-eighth of it. The next day, Olivia ate one-fifth of the remaining pizza. Then her classmates each ate 1/10 of the pizza. How many slices of pizza were left?
def solve() -> int: total_slices = 20 eaten_slices = total_slices / 8 remaining_slices = total_slices - eaten_slices olivia_slices = remaining_slices / 5 remaining_slices -= olivia_slices classmate_slices = remaining_slices / 10 remaining_slices -= classmate_slices result ...
Ashley's balcony is 8 feet by 12 feet. She increases each dimension by 1.5 feet, and builds 3 more balconies of the same size and 1 balcony that is twice that size. What is the total area of the balconies?
def solve() -> int: balcony_length = 8 balcony_width = 12 increased_length = balcony_length + 1.5 increased_width = balcony_width + 1.5 total_area_of_balconies = (increased_length * increased_width) * 4 + (increased_length * increased_width * 2) result = total_area_of_balconies ...
A can of soda is 355ml. If a person drinks 2 cans of soda per day, how many liters of soda will they drink in a week?
def solve() -> int: cans_per_day = 2 ml_in_liter = 1000 total_ml = cans_per_day * 355 * 7 total_liters = total_ml / ml_in_liter result = total_liters return result
If Sally wants to create curtains that pool on the floor in her room which is 7.5 feet tall, how much extra fabric should she add when making the curtains with a total length of 10 feet and a pooling of 4 inches at the bottom?
def solve() -> int: curtain_length = 10 pooling = 4 room_height = 7.5 pooling_feet = pooling / 12 curtain_length_without_pooling = curtain_length - pooling_feet extra_fabric = room_height - curtain_length_without_pooling result = extra_fabric return result
The gym charges $10 for a day-pass, or $50 for a pass that lasts the entire month. How much will Jeff pay for a gym pass if he plans to exercise for 25 days?
def solve() -> int: day_pass_price = 10 month_pass_price = 50 days = 25 if days <= 30: total_price = day_pass_price * days else: num_months = days // 30 remaining_days = days % 30 total_price = month_pass_price * num_months + day_pass_price * remaining_days ...
Student: There are 1293 students in a school. If there are 7 students of the same age in a certain classroom, what part of the school population is this age group?
def solve() -> int: students_in_school = 1293 students_in_classroom = 7 part_of_school_population = students_in_classroom / students_in_school result = part_of_school_population return result
A bike's handlebars are one-sixth its height. If a bike is 54 inches tall, what is the length of the bike's frame?
def solve() -> int: height = 54 handlebars = height / 6 frame = height - handlebars result = frame return result
Student: Liz created a garden with 20 plants. 3 of them are coneflowers, 8 of them are daisies, and the rest are roses. How many roses does Liz have?
def solve() -> int: coneflowers = 3 daisies = 8 total_plants = 20 roses = total_plants - coneflowers - daisies result = roses return result
A musician received 15% of the total sales from selling 100,000 digital copies of a song at $0.99 each and 20% of the total sales from selling 5,000 CDs at $10 each. How much did the musician earn?
def solve() -> int: digital_copies = 100000 digital_price = 0.99 cds = 5000 cd_price = 10 digital_sales = digital_copies * digital_price cd_sales = cds * cd_price total_sales = digital_sales + cd_sales digital_earnings = 0.15 * digital_sales cd_earnings = 0.2 * cd_sales ...
``` A store has a 10% off sale. If a person buys a $50 item, how much will they pay?
def solve() -> int: original_price = 50 discount = original_price * 0.1 sale_price = original_price - discount result = sale_price return result
Mia likes to collect stickers and has 156 stickers in her album. She buys a pack of 12 stickers for $1.25 every week and adds them to her album. She also trades 3 stickers with her friend every week and gets 4 different stickers in return. How many stickers will she have in her album after 10 weeks?
def solve() -> int: number_of_stickers = 156 for week in range(1, 11): number_of_stickers = number_of_stickers + 12 number_of_stickers = number_of_stickers - 3 + 4 result = number_of_stickers return result
Tyler, Brandon, and Daniel have some pencils. Tyler has 4 fewer pencils than Brandon, and Brandon has 8 fewer pencils than Daniel. If Daniel has 21 pencils, how many pencils do all 3 of them have in total?
def solve() -> int: daniel_pencils = 21 brandon_pencils = daniel_pencils + 8 tyler_pencils = brandon_pencils - 4 total_pencils = daniel_pencils + brandon_pencils + tyler_pencils result = total_pencils return result
Noah bought 20 balloons for his party and gave away a fifth of them to his sister, who gave away one-third of her 9 party hats to Noah. How many party hats does Noah have now?
def solve() -> int: balloons = 20 sister_balloons = balloons / 5 sister_hats = 9 / 3 noah_hats = sister_hats result = noah_hats return result
A CD has a total of 15 songs. There are 7 slow songs, 4 medium tempo songs, and 4 fast songs. What percentage of the songs are medium tempo?
def solve() -> int: total_songs = 15 num_medium = 4 percentage_medium = (num_medium / total_songs) * 100 result = percentage_medium return result
A video game costs $49.99 with a 25% discount. What is the final cost after the discount?
def solve() -> int: original_price = 49.99 discount_percentage = 0.25 discount_amount = original_price * discount_percentage new_price = original_price - discount_amount result = new_price return result
John went to the grocery store and bought 1 gallon of orange juice priced at $4.19 and 3 tablespoons of olive oil priced at $3.15 per tablespoon. How much did John spend in total?
def solve() -> int: orange_juice_cost_per_gallon = 4.19 olive_oil_cost_per_tablespoon = 3.15 orange_juice_gallons_bought = 1 olive_oil_tablespoons_bought = 3 total_cost = orange_juice_gallons_bought * orange_juice_cost_per_gallon + olive_oil_tablespoons_bought * olive_oil_cost_per_tables...
A hotel has 50 rooms. During the busy season, 80% of the rooms are occupied. How many rooms are occupied during the busy season?
def solve() -> int: total_rooms = 50 percentage_occupied = 80 number_occupied = percentage_occupied * total_rooms / 100 result = int(number_occupied) return result
Elif is going to a camping site which is 180 km away. She will use her scooter that has a fuel tank capacity of 6 liters and can travel 45 km on one liter of fuel. How many times will Elif need to refill her fuel tank for a one-way trip? Assume that she starts with a full tank.
def solve() -> int: distance = 180 tank = 6 efficiency = 45 max_distance = tank * efficiency refills = (distance - 1) // max_distance result = refills return result
A tank is filled with a mixture of 40% gasoline and 60% water. If the tank holds 20 liters of liquid, how many liters of gasoline are in the tank?
def solve() -> int: percentage_of_gasoline = 0.4 tank_capacity = 20 amount_of_gasoline = percentage_of_gasoline * tank_capacity result = amount_of_gasoline return result
James has 9 hours of free time on each weekend day. He wants to spend 75% of his time fishing and the rest of his time doing his homework. He can complete 4 math problems in 15 minutes. If he has 50 math problems to complete, how many can James finish in his free time?
def solve() -> int: weekend_day_hours = 9 fishing_time_percentage = 0.75 homework_time_percentage = 1 - fishing_time_percentage math_problems_per_15_minutes = 4 total_math_problems = 50 total_fishing_time = weekend_day_hours * fishing_time_percentage total_homework_time = weekend_day_ho...
The Seattle Mariners scored 5 home runs in the first inning, 3 home runs in the fifth inning, and 1 home run in the ninth inning. Their opponents, the Angels, scored 2 home runs in the third inning and 0 home runs in the seventh inning. How many more home runs did the Seattle Mariners score than the Angels in the game?
def solve() -> int: inning1 = 5 inning3 = 2 inning5 = 3 inning7 = 0 inning9 = 1 homeRunsMariners = inning1 + inning5 + inning9 homeRunsAngels = inning3 + inning7 result = homeRunsMariners - homeRunsAngels return result
A bookshelf is 6 feet long and has 5 shelves. Each shelf can hold up to 18 pounds of books. If the bookshelf is completely filled with books, what is the maximum total weight of the books that can be stored on the bookshelf?
def solve() -> int: length = 6 num_shelves = 5 shelf_capacity = 18 total_capacity = num_shelves * shelf_capacity total_weight = total_capacity * (length / 3) result = total_weight return result
A farmer has 32 chickens. If each chicken lays an average of 5 eggs per week, how many eggs does the farmer collect in a year (assume 52 weeks in a year)?
def solve() -> int: chickens = 32 eggs_per_week = 5 weeks = 52 total_eggs = chickens * eggs_per_week * weeks result = f'The farmer collects {total_eggs} eggs in a year.' result = total_eggs return result
A school bought 480 new textbooks for the library, and each cost $31.25. What was the total cost?
def solve() -> int: num_text_books = 480 price_per_book = 31.25 total_cost = num_text_books *price_per_book result = total_cost return result
Student: Bailey was making a snowman in her backyard. She needed to make a round base with a 3 meter diameter and then build a body 1.5 meters higher. What is the circumference of the snowman's base?
def solve() -> int: diameter = 3 height = 1.5 radius = diameter / 2 circumference = 2 * 3.14 * radius result = circumference return result
Mark needs to buy plastic sheets for a new project. Each plastic sheet is 4' x 8'. He needs to cover an area that is 9' by 6'. How many plastic sheets does he need in total?
def solve() -> int: length = 8 width = 4 length1 = 9 width1 = 6 result = (length1/length)*(width1/width) return result
Possible questions and programs: Susie can run 600 meters in 3 minutes. John can run 20% faster than Susie. Emma can run 40% slower than John. How long does it take Emma to run 600 meters?
def solve() -> int: susie_speed = 600 / 3 john_speed = susie_speed * 1.2 emma_speed = john_speed * 0.6 emma_time = 600 / emma_speed result = round(emma_time, 2) return result
Lily bought a dress for $250, a pair of shoes for $80, and a necklace costing $60. If she gets a discount of 10%, how much does she have to pay in total?
def solve() -> int: dress_cost = 250 shoes_cost = 80 necklace_cost = 60 total_cost = dress_cost + shoes_cost + necklace_cost discount = total_cost * 0.10 final_cost = total_cost - discount result = final_cost return result
The price of a phone was originally $400. If you had a 25% discount, how much would you have paid in total?
def solve() -> int: total = 0 original_price = 400 discount = 0.25 total = original_price * (1 - discount) result = total return result