user stringlengths 14 993 | assistant stringlengths 23 6.76k |
|---|---|
If a rectangle has a length of 12 cm and a width of 6 cm, what is the perimeter of the rectangle? | ```python
def simple_math_problem() -> float:
"""
If a rectangle has a length of 12 cm and a width of 6 cm, what is the perimeter of the rectangle?
"""
length = 12 # length of the rectangle
width = 6 # width of the rectangle
# formula for the perimeter of a rectangle: 2*(length + width)
perimeter = 2 * (length + wid... |
The number of chocolates in a box was originally five times the number of candies in the box. After 10 candies were eaten, there were twice as many chocolates as candies in the box. How many chocolates were initially in the box, if there are 30 candies now? | ```python
def simple_math_problem() -> int:
"""
The number of chocolates in a box was originally five times the number of candies in the box. After 10 candies were eaten, there were twice as many chocolates as candies in the box. How many chocolates were initially in the box, if there are 30 candies now?
""... |
A car can travel 25 miles on 1 gallon of gas. If the car has a 15-gallon gas tank and has already traveled 100 miles, how many more miles can the car travel before it needs to refuel? | ```python
def car_gas_mileage() -> float:
"""
A car can travel 25 miles on 1 gallon of gas. If the car has a 15-gallon gas tank and has already traveled 100 miles, how many more miles can the car travel before it needs to refuel?
"""
miles_per_gallon = 25 # The car can travel 25 miles on 1 gallon of ga... |
If Noah creates a triangular-shaped bookmark with a base measuring 2 inches and a height of 8 inches, and his two friends also construct similar bookmarks, what is the total area of the triangular bookmarks? | ```python
def triangular_bookmarks_area() -> float:
"""
If Noah creates a triangular-shaped bookmark with a base measuring 2 inches and a height of 8 inches, and his two friends also construct similar bookmarks, what is the total area of the triangular bookmarks?
"""
noah_bookmark_base = 2 # inches
... |
A basketball player makes 80% of his free throws. If he attempts 10 free throws in a game, how many will he make on average? | ```python
def basketball_free_throws() -> float:
"""
A basketball player makes 80% of his free throws. If he attempts 10 free throws in a game, how many will he make on average?
"""
percentage_made = 0.80
|
Michael wants to buy a new computer monitor. He spends $150 on a monitor and $30 on cables. If he has $70 left to spend on speakers, how much money did he have at first? | ```python
def simple_math_problem() -> float:
"""
Michael wants to buy a new computer monitor. He spends $150 on a monitor and $30 on cables. If he has $70 left to spend on speakers, how much money did he have at first?
"""
cost_monitor = 150
cost_cables = 30
money_left = 70
money_at_first =... |
A club wants to buy equal numbers of figurines and keychains for an upcoming event. Each figurine costs $7, and each keychain costs $3. They have a budget of $1200. How many of each item should they buy? | def simple_math_problem() -> tuple[int, int]:
"""
A club wants to buy equal numbers of figurines and keychains for an upcoming event. Each figurine costs $7, and each keychain costs $3. They have a budget of $1200. How many of each item should they buy?
"""
figurine_cost = 7
keychain_cost = 3
budget = 1200
# Calculate... |
In a department store, there are 200 shoppers and 20 sales associates. The store provides 100 shopping bags for customers. If each sales associate brings 2 shopping bags, how many more shopping bags does the store need to have 3 bags for each shopper? | ```python
def simple_math_problem() -> int:
"""
In a department store, there are 200 shoppers and 20 sales associates. The store provides 100 shopping bags for customers. If each sales associate brings 2 shopping bags, how many more shopping bags does the store need to have 3 bags for each shopper?
"""
... |
There are 40 students in a classroom, and 27 students in another classroom. How many more students are there in the first classroom than the second classroom? | ```python
def simple_math_problem() -> int:
"""
There are |
The area of a square is 64 square units. What is the length of each side of the square? | ```python
def simple_math_problem() -> float:
"""
The area of a square is 64 square units. What is the length of each side of the square?
"""
area = 64
side_length = area ** 0.5
result = side_length
return result
```
Explanation:
* We start by defining the function `simple_math_problem` and specifying that it returns... |
Emma has twice as many books as her friend Olivia. Olivia has 7 fewer books than her friend Mia. If Mia has 15 books, how many books does Emma have? | def simple\_math\_problem() -> int:
"""
Emma has twice as many books as her friend Olivia. Olivia has 7 fewer books than her friend Mia. If Mia has 15 books, how many books does Emma have?
"""
# Variable assignments with descriptive names
olivia\_books = 15 - 7
emma\_books = olivia\_books \* 2
# Calculate step by step... |
In a company of 100 employees, 60 of them like coffee, 40 like tea, and 20 like both. How many employees in the company do not like coffee or tea? | ```python
def simple_math_problem() -> int:
"""
In a company of 100 employees, 60 of them like coffee, |
In a bag of marbles, the ratio of red to blue marbles is 2:3. If there are 60 blue marbles, how many red marbles are there? | ```python
def simple_math_problem() -> int:
"""
In a bag of marbles, the ratio of red to blue marbles is 2:3. If there are 60 blue marbles, how many red marbles are there?
"""
reds_to_blues = 2/3
total_blue = 60
red_marbles = total_blue * reds_to_blues * (2/1) # Scale the ratio by the number of blue marbles
result =... |
In a classroom, there are 80 pencils. If 5 pencils are used each day and there are only 55 pencils left after 9 days, how many pencils were used in total? | ```python
def simple_math_problem() -> int:
"""
In a classroom, there are 80 pencils. If 5 pencils are used each day and there are only 55 pencils left after 9 days, how many pencils were used in total?
"""
total_pencils = 80
pencils_used_per_day = 5
days = 9
pencils_left = 55
pencils_u... |
Sarah has 20 marbles in her marble collection. She found 5 more marbles on the ground and then lost 2 marbles. How many marbles does Sarah have now? | ```python
def simple_math_problem() -> int:
"""
Sarah has 20 marbles in her marble collection. She found |
The sum of two consecutive even numbers is 86. What are the numbers? | ```python
def sum_of_consecutive_even_numbers() -> int:
"""
The sum of two consecutive even numbers is 86. What are the numbers?
"""
# Assign the first even number as x
x = 0
# Since even numbers are separated by 2, the second even number would be x + 2
y = x + 2
# The sum of these two... |
Liam filled his water bottle with 6 ice cubes before adding water. Later, when he prepares a pitcher of iced coffee, he puts four times as many ice cubes as he used in his water bottle. How many ice cubes does he use to make the pitcher of iced coffee? | ```python
def simple_math_problem() -> int:
"""
Liam filled his water bottle with 6 ice cubes before adding water. Later, when he prepares a pitcher of iced coffee, he puts four times as many ice cubes as he used in his water bottle. How many ice cubes does he use to make the pitcher of iced coffee?
"""
... |
A coffee shop charges $4 for a cup of coffee. They sell coffee in three sizes - small, medium, and large - priced at $3, $4, and $5 respectively. If they sell 10 small coffees, 15 medium coffees, and 5 large coffees, how much money will the coffee shop make? | ```python
def coffee_shop_revenue() -> float:
"""
A coffee shop charges $4 for a cup of coffee. They sell coffee in three sizes - small, medium, and large - priced at $3, $4, and $5 respectively. If they sell 10 small coffees, 15 medium coffees, and |
A farmer has 100 chickens. He decides to sell 25% of them to a neighboring farm. After selling them off, he decides to increase his remaining chickens by 50%. What is the final number of chickens he has? | ```python
def simple_math_problem() -> int:
"""
A farmer has 100 chickens. He decides to sell 25% of them to a neighboring farm. After selling them off, he decides to increase his remaining chickens by 50%. What is the final number of chickens he has?
"""
total_chickens = 100
chickens_sold = total_c... |
Emma builds model skyscrapers. A full-size skyscraper is 1000 feet tall. The mid-size model skyscraper that Emma creates is 1/20th the size, and the smallest model skyscraper that Emma creates is half the size of the mid-size model. How tall is the smallest model skyscraper? | ```python
def height_of_smallest_model_skyscraper() -> float:
"""
Emma builds model skyscrapers. A full-size skyscraper is 1000 feet tall.
The mid-size model skyscraper that Emma creates is 1/20th the size, and
the smallest model skyscraper that Emma creates is half the size of the
mid-size model. H... |
Laura wants to purchase 4 boxes of markers. Each box has 12 markers and costs $2.50. How much money will Laura need to buy all the boxes? | ```python
def simple_math_problem() -> float:
"""
Laura wants to purchase 4 boxes of markers. Each box has 12 markers and costs $2.50. How much money will Laura need to buy all the boxes?
"""
boxes_to_buy = 4
markers_per_box = 12
cost_per_box = 2.50
cost_for_all_boxes = boxes_to_buy * cost_p... |
If Mark spent $50 on 5 markers and got $10 in change, what was the cost of each marker? | def simple\_math\_problem() -> float:
"""
Mark spent $50 on 5 markers and got $10 in change. What was the cost of each marker?
"""
amount\_spent = 50
num\_markers = 5
change\_received = 10
cost\_of\_markers = (amount\_spent - change\_received) / num\_markers
result = cost\_of\_markers
return result
This code defines ... |
Mr. Johnson purchased a television for $850. He paid $350 upfront and plans to make monthly payments of $75. How many months will it take for him to fully pay for the television? | ```python
def simple_math_problem() -> int:
"""
Mr. Johnson purchased a television for $850. He paid $350 upfront and plans to make monthly payments of $75. How many months will it take for him to fully pay for the television?
"""
total_cost = 850
down_payment = 350
monthly_payment = 75
mont... |
John has 4 times as many toy cars as Michael, who has 2 fewer toy cars than Peter. After giving 3 toy cars to Michael and 2 toy cars to Peter, how many toy cars does John have left? | ```python
def simple_math_problem() -> int:
"""
John has 4 times as many toy cars as Michael, who has 2 fewer toy cars than Peter. After giving |
Mr. Johnson has 5 boxes of apples. Each box contains 36 apples. He sold 3 boxes of apples in the morning and then received 2 more boxes in the afternoon. If each apple costs $0.50, how much revenue did Mr. Johnson generate from selling the apples throughout the day? | ```python
def simple_math_problem() -> float:
"""
Mr. Johnson has 5 boxes of apples. Each box contains 36 apples. He sold 3 boxes of apples in the morning and then
received 2 more boxes in the afternoon. If each apple costs $0.50, how much revenue did Mr. Johnson generate
from selling the apples through... |
Jill has 4 apples and gives 2 to her friend. How many apples does Jill have now? | ```python
def simple_math_problem() -> int:
"""
Jill has 4 apples and gives 2 to her friend. How many apples does Jill have now?
"""
apples_total = 4
|
John is 3 years older than twice his sister's age. If his sister is 10 years old, how old is John? | ```python
def johns_age() -> int:
"""
John is 3 years older than twice his sister's age. If his sister is 10 years old, how old is |
Yesterday, there were 12 eggs in the fridge. Today, Mom brought 16 more eggs. If Dad used 5 eggs to make an omelette, how many eggs are left in the fridge now? | ```python
def simple_math_problem() -> int:
"""
Yesterday, there were 12 eggs in the fridge. Today, Mom brought 16 more eggs. If Dad used 5 eggs to make an omelette, how many eggs are left in the fridge now?
"""
eggs_yesterday = 12
eggs_mom_brought = 16
eggs_used_by_dad = 5
eggs_total = egg... |
Sue had 64 candy canes. She put them in bags that contained 4 candy canes each. How many bags did she fill? | def simple\_math\_problem() -> int:
"""
Sue had 64 candy canes. She put them in bags that contained 4 candy canes each. How many bags did she fill?
"""
candyCanesTotal = 64
candyCanesPerBag = 4
bagsFilled = candyCanesTotal // candyCanesPerBag
result = bagsFilled
return result
This problem can be solved using integer ... |
Mr. Valentino has 150 cats on his farm. He has twice as many dogs as cats and three times as many rabbits as dogs. How many animals does Mr. Valentino have on his farm in total? | ```python
def simple_math_problem() -> int:
"""
Mr. Valentino has 150 cats on his farm. He has twice as many dogs as cats and three times as many rabbits as dogs. How many animals does Mr. Valentino have on his farm in total?
"""
cats = 150
dogs = 2 * cats
|
Alex bought one box of pencils for $3, four notebooks for $5 each, and two calculators for $10 each. Calculate the total cost of his purchases. | ```python
def simple_math_problem() -> float:
"""
Alex bought one box of pencils for $3, four notebooks for $5 each, and two calculators for $10 each. Calculate the total cost of his purchases.
"""
pencil_cost = 3
notebook_cost = 5
|
Jack is going on a road trip. He starts with a full tank of gas which holds 50 liters. He drives for 200 kilometers and his car consumes 10 liters of gas per 100 kilometers. How many liters of gas does Jack have left in his tank? | ```python
def simple_math_problem() -> float:
"""
Jack is going on a road trip. He starts with a full tank of gas which holds 50 liters. He drives for 200 kilometers and his car consumes 10 liters of gas per 100 kilometers. How many liters of gas does Jack have left in his tank?
"""
tank_capacity = 50 ... |
Jane has 1200 dollars to purchase textbooks for college. The price of a single book is 60 dollars. After purchasing textbooks, she has 300 dollars in her pocket. How many textbooks has she purchased? | def simple_math_problem() -> int:
"""
Jane has 1200 dollars to purchase textbooks for college. The price of a single book is 60 dollars. After purchasing textbooks, she has 300 dollars in her pocket. How many textbooks has she purchased?
"""
money_given_to_textbooks = 1200
price_per_textbook = 60
money_left = 300
text... |
There are 8 bags, each containing 40 candies. Out of those, 15 candies are expired. If 25 candies are used for a birthday party, how many candies will be sold? | ```python
def simple_math_problem() -> int:
"""
There are 8 bags, each containing 40 candies. Out of those, 15 candies are expired. If 25 candies are used for a birthday party, how many candies will be sold?
"""
total_bags = 8
candies_per_bag = 40
expired_candies = 15
candies_used = 25
total_candies = total_bags * can... |
A conveyor belt moves 150 boxes in 8 hours. How many boxes does it move in 20 hours? | ```python
def conveyor_belt_speed() -> float:
"""
A conveyor belt moves 150 boxes in 8 hours. How many boxes does it move in 20 hours?
"""
boxesMovedPerHour = 150 / 8
boxesMovedIn20Hours = boxesMovedPerHour * 20
result = boxesMovedIn20Hours
return result
```
This function calculates the num... |
Ms. Thompson has a bakery. She bakes 200 cookies in each batch. If she delivers 80% of the batches to a local cafe, how many cookies does she have left? | ```python
def simple_math_problem() -> int:
"""
Ms. Thompson has a bakery. She bakes 200 cookies in each batch. If she delivers 80% of the batches to a local cafe, how many cookies does she have left?
"""
batches_baked = 1 # assuming she bakes at least one batch
cookies_per_batch = 200
delivered_batches = 0.8
cookies_... |
Tom wants to go on a weekend camping trip. The campsite rental fee is $30 per night. He plans to stay for 2 nights. There is also a $10 entrance fee per person. How much will Tom have to pay for the camping trip if there are 2 people going with him? | def simple\_math\_problem() -> float:
"""
Tom wants to go on a weekend camping trip. The campsite rental fee is $30 per night. He plans to stay for 2 nights. There is also a $10 entrance fee per person. How much will Tom have to pay for the camping trip if there are 2 people going with him?
"""
campsite\_rental\_fee = ... |
Emily wants to buy a camera for $549.99, a memory card for $39.50, and a camera bag for $24.25. She currently has $600. How much more money does Emily need? | def simple\_math\_problem() -> float:
"""
Emily wants to buy a camera for $549.99, a memory card for $39.50, and a camera bag for $24.25. She currently has $600. How much more money does Emily need?
"""
cost\_camera = 549.99
cost\_memory\_card = 39.50
cost\_camera\_bag = 24.25
total\_cost = cost\_camera + cost\_memory\... |
Tom has 3 hours less than half the amount of time that Mark has left to study for the exam. Mark has two times the amount of time left to study for the exam as Emily. If Emily has 9 hours left to study for the exam, calculate the total number of hours they all have left to study for the exam? | ```python
def simple_math_problem() -> int:
"""
Tom has 3 hours less than half the amount of time that Mark has left to study for the exam. Mark has two times the amount of time left to study for the exam as Emily. If Emily has 9 hours left to study for the exam, calculate the total number of hours they all hav... |
A group of students want to raise $100 for their school's fundraiser. If each student needs to sell at least 5 candy bars for $2 each, how many students need to participate? | ```python
def simple_math_problem() -> int:
"""
A group of students want to raise $100 for their school's fundraiser. If each student needs to sell at least 5 candy bars for $2 each, how many students need to participate?
"""
target_amount = 100 # dollars to raise
candy_bar_price = 2 # dollars per... |
Lily had a cup of milk and a pint of apple juice before her dance rehearsal. She cannot go to the bathroom during rehearsal, and her maximum capacity is 30 ounces. How much water can she drink from her water bottle without needing a bathroom break? | ```python
def liquid_capacity() -> float:
"""
Lily had a cup of milk and a pint of apple juice before her dance rehearsal. She cannot go to the bathroom during rehearsal, and her maximum capacity is 30 ounces. How much water can she drink from her water bottle without needing a bathroom break?
"""
# Var... |
A shoe store decides to switch from selling sneakers to selling sandals. Previously, they sold each pair of sneakers for $50 and it cost $30 to make. Now, they sell each pair of sandals for $40 and it costs $20 to make. How much more profit do they make per week by selling sandals instead of sneakers? | ```python
def simple_math_problem() -> float:
"""
A shoe store decides to switch from selling sneakers to selling sandals. Previously, they sold each pair of sneakers for $50 and it cost $30 to make. Now, they sell each pair of sandals for $40 and it costs $20 to make. How much more profit do they make per week... |
John bought a smartphone for $1,000. He paid 25% down and then financed the remaining amount. If he has paid off 80% of the finance, how much money does John still owe on his smartphone? | ```python
def smartphone_payment() -> float:
"""
John bought a smartphone for $1,00 |
Patricia wants to bake some cookies and needs 3/4 cup of butter. She only has 1/2 cup of butter, how much more does she need to buy? | def simple\_math\_problem() -> float:
"""
Patricia wants to bake some cookies and needs 3/4 cup of butter. She only has 1/2 cup of butter, how much more does she need to buy?
"""
butter\_needed = 3/4
butter\_on\_hand = 1/2
butter\_short = butter\_needed - butter\_on\_hand
result = butter\_short
return result |
Tom is packing fruit baskets. He packs 5 baskets of apples and 7 baskets of oranges separately. If it takes 3 minutes to pack each apple basket and 4 minutes to pack each orange basket, how long did it take for Tom to pack all the fruit baskets? | ```python
def packing_time() -> int:
"""
Tom is packing fruit baskets. He packs 5 baskets of apples and |
A garden center bought 15 cartons of flowers. Each carton contains 6 pots of flowers and each pot costs $8. How much did the garden center spend on flowers? | ```python
def garden_center_spending() -> float:
"""
A garden center bought 15 cartons of flowers. Each carton contains 6 pots of flowers and each pot costs $8. How much did the garden center spend on flowers?
"""
number_of_cartons = 15
flowers_per_carton = 6
cost_per_pot = 8
pots_purchased... |
Jack and Mia are running a relay race. Jack runs 200 meters in 22 seconds, while Mia runs 400 meters in 45 seconds. Assuming they both maintained their speed, what would've been the average time in seconds for the runners? | ```python
def simple_math_problem() -> float:
"""
Jack and Mia are running a relay race. Jack runs 200 meters in 22 seconds, while Mia runs 400 meters in 45 seconds. Assuming they both maintained their speed, what would've been the average time in seconds for the runners?
"""
jack_distance = 200 # mete... |
A fruit seller has 50 apples, 30 bananas, and 20 oranges in a basket. If he sells 20% of the apples, 15% of the bananas, and 10% of the oranges, how many fruits does he have left in the basket? | ```python
def simple_math_problem() -> int:
"""
A fruit seller has 50 apples, |
Sarah works 4 hours every day from Monday to Friday and 2 hours on Saturday and Sunday. If she earns $6 per hour, how much does Sarah earn every week? | ```python
def simple_math_problem() -> float:
"""
Sarah works 4 hours every day from Monday to Friday and 2 hours on Saturday and Sunday. If she earns $6 per hour, how much does Sarah earn every week?
"""
hours_per_weekday = 4
hours_per_weekend = 2
days_in_a_week = 7
wage_per_hour = 6
t... |
A train travels 300 miles in 5 hours. What is the average speed of the train in miles per hour? | ```python
def simple_math_problem() -> float:
"""
A train travels 300 miles in 5 hours. What is the average speed of the train in miles per hour?
"""
distance_traveled = 300 # miles
time_taken = 5 # hours
average_speed = distance_traveled / time_taken
return average_speed
```
When you ru... |
A bakery sells cakes, cupcakes, and cookies. The ratio of cakes to cupcakes sold is 2:3 and the ratio of cupcakes to cookies sold is 5:8. If the bakery sold 60 cakes, how many cookies did they sell? | ```python
def simple_math_problem() -> int:
"""
A bakery sells cakes, cupcakes, and cookies. The ratio of cakes to cupcakes sold is 2:3 and the ratio of cupcakes to cookies sold is 5:8. If the bakery sold 60 cakes, how many cookies did they sell?
"""
# Ratio of cakes to cupcakes to cookies
|
A football team has played 8 games this season, and they've scored 24 touchdowns. If each touchdown is worth 6 points, how many points have they scored in total? | ```python
def simple_math_problem() -> int:
"""
A football team has played |
A pizza has 8 equally sized slices. If 3 people are going to share 2 pizzas, how many slices will each person get? | ```python
def simple_math_problem() -> float:
"""
A pizza has 8 equally sized slices. If 3 people are going to share 2 pizzas, how many slices will each person get?
"""
slices_per_pizza = 8 # number of slices in each pizza
people = 3 # number of people sharing the pizzas
pizzas = 2 # number o... |
A lemonade recipe calls for 4 cups of water, 2 cups of lemon juice, and 1 cup of sugar to make 6 servings. If you want to make 24 servings, how many cups of sugar will you need? | ```python
def lemonade_sugar_needed() -> float:
"""
A lemonade recipe calls for |
A student got the following grades in his exams: 80, 95, 78, 90 and 85. What is the average of his grades? | ```python
def simple_math_problem() -> float:
"""
A student got the following grades in his exams: |
The ratio of men to women in a company is 7:9. If there are a total of 256 employees in the company, how many men are there? | ```python
def simple_math_problem() -> int:
"""
The ratio of men to women in a company is 7:9. If there are a total of 256 employees in the company, how many men are there?
"""
ratio_men_women = 7 / 9 # the given ratio
total_employees = 256 # total number of employees
men_women_ratio = ratio_... |
A shop sells T-shirts for $15 each and jeans for $30 each. In a day, the shop sells 20 T-shirts and 15 jeans. What is the total revenue from T-shirt and jeans sales? | ```python
def simple_math_problem() -> float:
"""
A shop sells T-shirts for $15 each and jeans for $30 each. In a day, the shop sells 20 T-shirts and 15 jeans. What is the total revenue from T-shirt and jeans sales?
"""
tshirt_price = 15 # price of each T-shirt
jeans_price = 30 # price of each jea... |
There are 78 pencils in a store. The store owner orders 35 more pencils. How many pencils are there now in the store? | ```python
def simple_math_problem() -> int:
"""
There are 78 pencils in a store. The store owner orders 35 more pencils. How many pencils are there now in the store?
"""
pencils_initial = 78
|
Jenny had $60 but she lost one-third of it. Then, she found $15. How much money does Jenny have now? | ```python
def simple_math_problem() -> float:
"""
Jenny had $60 but she lost one-third of it. Then, she found $15. How much money does Jenny have now?
"""
total_money_jenny_start = 60
one_third_of_money = total_money_jenny_start / 3
money_lost = total_money_jenny_start / 3
money_left = total... |
A rectangle has a length of 7 inches and a width of 4 inches. A square has a width of 2 inches. What is the difference in area between the two shapes? | ```python
def simple_math_problem() -> float:
"""
A rectangle has a length of 7 inches and a width of 4 inches. A square has a width of 2 inches. What is the difference in area between the two shapes?
"""
rectangle_length = 7
rectangle_width = 4
square_width = 2
rectangle_area = rectangle_length * rectangle_width
squa... |
A car travels 500 km in 5 hours. What is the average speed of the car? | ```python
def simple_math_problem() -> float:
"""
A car travels 500 km in 5 hours. What is the average speed of the car?
"""
distance_traveled = 500 # km
|
A cafeteria sells 200 burgers on Monday, 125 on Tuesday, and twice the number on Wednesday compared to Tuesday. How many burgers did they sell in total over the three days? | ```python
def simple_math_problem() -> int:
"""
A cafeteria sells 200 burgers on Monday, 125 on Tuesday, and twice the number on Wednesday compared to Tuesday.
How many burgers did they sell in total over the three days?
"""
burgers_monday = 200
|
Anna walks to the nearby grocery store which is 2 kilometers away. If she walks to the store twice a day, how many kilometers will she walk in 10 days? | def simple\_math\_problem() -> float:
"""
Anna walks to the nearby grocery store which is 2 kilometers away. If she walks to the store twice a day, how many kilometers will she walk in 10 days?
"""
distance\_to\_store = 2 # kilometers
walks\_per\_day = 2
days = 10
total\_distance\_walked = distance\_to\_store \* walk... |
A container has 18 more red balls than yellow balls. If there are 32 yellow balls, how many balls are there in total? | ```python
def simple_math_problem() -> int:
"""
A container has 18 more red balls than yellow balls. If there are 32 yellow balls, how many balls are there in total?
"""
red_balls_extra = 18
yellow_balls = 32
total_balls = red_balls_extra + yellow_balls
result = total_balls
return resul... |
Sally has 50 more stickers than Mark. If Mark has 30 stickers, how many stickers does Sally have? | ```python
def simple_math_problem() -> int:
"""
Sally has 50 more stickers than Mark. If Mark has 30 stickers, how many stickers does Sally have?
"""
mark_stickers = 30
sally_stickers = mark_stickers + 50
result = sally_stickers
return result
```
This function, `simple_math_problem()`, calc... |
A birthday cake has 16 candles. If the birthday boy blows out 3/4 of the candles and his little sister blows out 2, how many candles are left? | ```python
def simple_math_problem() -> float:
"""
A birthday cake has 16 candles. If the birthday boy blows out 3/4 of the candles and his little sister blows out 2, how many candles are left?
"""
total_candles = 16
candles_blown_by_boy = 3/4 * total_candles
candles_blown_by_sister = 2
candles_left = total_candles - ca... |
Samantha is knitting a scarf. She knits half of the scarf and then stops to take a break. While she's away, her cat plays with the yarn and unravels half of the knitted part. When Samantha comes back, she knits three times the remaining stitches. If the scarf is 60 inches long and 8 inches wide, how many stitches does ... | ```python
def samanthas_scarf() -> int:
"""
Samantha is knitting a scarf. She knits half of the scarf and then stops to take a break.
|
Linda sold a total of 7 necklaces and 9 bracelets at a craft fair for a total of $225. If each necklace costs $18, what is the cost of each bracelet? | ```python
def simple_math_problem() -> float:
"""
Linda sold a total of 7 necklaces and 9 bracelets at a craft fair for a total of $225. If each necklace costs $18, what is the cost of each bracelet?
"""
necklace_cost = 18
necklaces_sold = 7
bracelets_sold = 9
total_sales = 225
# Calculate the total cost of the neckla... |
Melissa is twice as old as her sister Olivia. If Olivia is 10 years old, how old is Melissa? | ```python
def melissa_age() -> int:
"""
Melissa is twice as old as her sister Olivia. If Olivia is 10 years old, how old is Melissa?
"""
olivia_age = 10
melissa_age = olivia_age * 2
result = melissa_age
return result
```
The function `melissa_age()` returns `20`, which is Melissa's age. |
A car's fuel tank can hold 50 liters of fuel. If 20% of the fuel is used, how many liters of fuel are left in the tank? | ```python
def simple_math_problem() -> float:
"""
A car's fuel tank can hold 50 liters of fuel. If 20% of the fuel is used, how many liters of fuel are left in the tank?
"""
tank_capacity = 50 # in liters
fuel_used = 20 # as a percentage
fuel_left = tank_capacity * (100 - fuel_used) / 100
... |
A box contains 6 bags of chips, and each bag has 15 chips. How many bags would there be if each bag had 20 chips instead? | ```python
def simple_math_problem() -> int:
"""
A box contains 6 bags of chips, and each bag has 15 chips. How many bags would there be if each bag had 20 chips instead?
"""
# Current number of bags
current_bags = 6
# Current number of chips per bag
|
John earns $12 per hour and worked for 40 hours last week. If he needs to pay 20% tax on his income, how much money will he have after paying taxes? | ```python
def simple_math_problem() -> float:
"""
John earns $12 per hour and worked for 40 hours last week. If he needs to pay 20% tax on his income, how much money will he have after paying taxes?
"""
hourly_wage = 12
|
Jenny and Alex went fishing in a pond. Jenny caught 15 rainbow trout and 8 bass. Alex caught 10 salmon and 5 catfish. If one-third of the catfish, half of the trout, and one-fourth of the bass have golden scales, how many golden-scaled fish did they catch? | ```python
def golden_scaled_fish() -> int:
"""
Jenny and Alex went fishing in a pond. Jenny caught 15 rainbow trout and |
In a store, there are 456 pens, 245 pencils, and 789 erasers. How many items are there in total? | ```python
def simple_math_problem() -> int:
"""
In a store, there are 456 pens, |
Tim bought a book for $14.50 and a notebook for $5.20. The cashier applied a 10% discount on the total price. How much did Tim pay in total? | ```python
def simple_math_problem() -> float:
"""
Tim bought a book for $14.50 and a notebook for $5.20. The cashier applied a 1 |
In a class of 32 students, 25% are boys. If there are 4 more girls than boys in the class, how many girls are in the class? | ```python
def simple_math_problem() -> int:
"""
In a class of 32 students, 25% are boys. If there are |
David went on a road trip and started with 55 dollars. He spent 25 dollars on gas and 10 dollars on snacks. He wants to split the remaining money evenly between himself and his two friends. How much money will each person receive? | def simple_math_problem() -> float:
"""
David went on a road trip and started with 55 dollars. He spent 25 dollars on gas and 10 dollars on snacks. He wants to split the remaining money evenly between himself and his two friends. How much money will each person receive?
"""
money_started = 55
money_spent_on_gas = 25
mo... |
Emily designs and sells keychains. She orders her keychains in a unit of 50 and is charged $0.75 per keychain. If she turns around and sells all 50 keychains for $3.00 each, what is her net profit? | ```python
def simple_math_problem() -> float:
"""
Emily designs and sells keychains. She orders her keychains in a unit of 50 and is charged $0.75 per keychain. If she turns around and sells all 50 keychains for $3.00 each, what is her net profit?
"""
cost_per_keychain = 0.75
selling_price_per_keychain = 3.00
keychains... |
If there are four puppies each on two farms and six on another, how many puppies are there in total? | ```python
def simple_math_problem() -> int:
"""
If there are four puppies each on two farms and six on another, how many puppies are there in total?
"""
farm1_puppies = 4
|
Result: 67 Olivia is organizing a carnival and invites 35 of her friends. She asks each friend to bring seven more people with them. If only a quarter of the invited guests actually bring seven extra people, what's the total number of people at the carnival, including Olivia? | ```python
def carnival_math_problem() -> int:
"""
Olivia is organizing a carnival and invites |
Daniel and Olivia want to go camping with a budget of $150. Daniel spends $80 on camping gear and $30 on food, while Olivia spends $50 on camping gear and $20 on snacks. How much money do they have left after their camping trip? | def simple_math_problem() -> float:
"""
Daniel and Olivia want to go camping with a budget of $150. Daniel spends $80 on camping gear and $30 on food, while Olivia spends $50 on camping gear and $20 on snacks. How much money do they have left after their camping trip?
"""
daniel\_budget = 150 # total budget
daniel\_sp... |
On a farm, the number of cows is 2 times the number of horses. If there are 8 horses, how many cows are there? | def simple\_math\_problem() -> int:
"""
On a farm, the number of cows is 2 times the number of horses. If there are 8 horses, how many cows are there?
"""
number\_of\_horses = 8
multiplier = 2
number\_of\_cows = number\_of\_horses \* multiplier
result = number\_of\_cows
return result
Printing the result of the funct... |
Tom created a budget plan for his monthly expenses. His total expenses amount to $800, but he wants to cut his expenses by 20%. How much money will Tom save per month? | ```python
def simple_math_problem() -> float:
"""
Tom created a budget plan for his monthly expenses. His total expenses amount to $800, but he wants to cut his expenses by 20%. How much money will Tom save per month?
"""
total_expenses = 800
savings_percentage = 20
savings_amount = total_expens... |
There are a total of 455 fruits in the basket. The ratio of apples to oranges is 4:3. How many oranges are there in the basket? | ```python
def simple_math_problem() -> int:
"""
There are a total of 455 fruits in the basket. The ratio of apples to oranges is |
Amy throws 3 quarters, 4 dimes, and 2 nickels into the pond. Aaron tosses in 10 pennies. If Aaron dips his hands into the water and pulls out a penny, how much money, in cents, did they put into the pond? | ```python
def simple_math_problem() -> float:
"""
Amy throws 3 quarters, 4 dimes, and 2 nickels into the pond. Aaron tosses in 10 pennies. If Aaron dips his hands into the water and pulls out a penny, how much money, in cents, did they put into the pond?
"""
# variable assignments
quarter_value = 0.... |
Emma can run 5 kilometers in 25 minutes. How many minutes would it take her to run 8 kilometers? | ```python
def emma_running_time() -> float:
"""
Emma can run 5 kilometers in 25 minutes. How many minutes would it take her to run 8 kilometers?
"""
distance_emma_can_run = 5 # kilometers
|
A car travels 120km in 2 hours. If the car maintains the same speed, how long will it take to travel 300km? | ```python
def simple_math_problem() -> float:
"""
A car travels 120km in 2 hours. If the car maintains the same speed, how long will it take to travel |
Tom is ordering a pizza for dinner. The pizza he wants to order costs $12. If there is an additional charge of $2.50 for extra toppings and a tax of 7%, how much will Tom have to pay in total? | ```python
def simple_math_problem() -> float:
"""
Tom is ordering a pizza for dinner. The pizza he wants to order costs $12. If there is an additional charge of $2.50 for extra toppings and a tax of 7%, how much will Tom have to pay in total?
"""
pizza_cost = 12
topping_charge = 2.50
tax_percent = 7
# Calculate the to... |
A toy store offers a 40% discount on the purchase of a game. If the original price of the game was $50, what is the discounted price? | ```python
def simple_math_problem() -> float:
"""
A toy store offers a 40% discount on the purchase of a game. If the original price of the game was $50, what is the discounted price?
"""
original_price = 50
discount_percent = 40
discount_amount = original_price * (discount_percent / 100)
di... |
Daniel bought some bags of marbles. He gave a bag to his friend. He then gave away one-third of the remaining bags. If Daniel has 3 bags of marbles left, how many bags did he buy in the first place? | ```python
def simple_math_problem() -> float:
"""
Daniel bought some bags of marbles. He gave a bag to his friend. He then gave away one-third of the remaining bags. If Daniel has 3 bags of marbles left, how many bags did he buy in the first place?
"""
initial_bags = 3 # The remaining bags after giving... |
In a cake shop, the number of chocolate cakes sold is 5 times the number of vanilla cakes sold. If a total of 60 cakes were sold, how many chocolate cakes were sold? | ```python
def simple_math_problem() -> int:
"""
In a cake shop, the number of chocolate cakes sold is |
Ethan bought six boxes of crayons at $1.75 each and four markers at $2.50 each. How much change did he get back if he gave a twenty-dollar bill? | ```python
def simple_math_problem() -> float:
"""
Ethan bought six boxes of crayons at $1.75 each and four markers at $2.50 each. How much change did he get back if he gave a twenty-dollar bill?
"""
# Variable assignments with descriptive names
crayons_cost = 6 * 1.75
markers_cost = 4 * 2.50
... |
The perimeter of a rectangle is 60 meters, and its width is 10 meters. What is its length? | ```python
def simple_math_problem() -> float:
"""
The perimeter of a rectangle is 60 meters, and its width is 10 meters. What is its length?
"""
perimeter = 60 # meters
width = 10 # meters
length = perimeter / 2 / width
result = length
return result
```
The length of the rectangle is ... |
In a school, there are 40 teachers. If 1/4 of them are on leave, how many teachers are in the school? | def simple_math_problem() -> int:
"""
In a school, there are 40 teachers. If 1/4 of them are on leave, how many teachers are in the school?
"""
total\_teachers = 40
teachers\_on\_leave = total\_teachers // 4
teachers\_present = total\_teachers - teachers\_on\_leave
result = teachers\_present
return result
print(simpl... |
Ethan loves to collect stamps. On the first day, he buys 3 new stamps. On the second day, he buys twice as many stamps as the day before. On the third day, he buys half the number of total stamps he already bought. Finally, on the fourth day, he buys as many stamps as the total number he bought over the previous three ... | ```python
def stamps_collection() -> int:
"""
Ethan loves to collect stamps. On the first day, he buys |
The perimeter of a rectangle is 26 meters and its length is 9 meters. What is its width? | ```python
def simple_math_problem() -> float:
"""
The perimeter of a rectangle is 26 meters and its length is 9 meters. What is its width?
"""
perimeter = 26
length = 9
# The formula for the perimeter of a rectangle is 2*(length + width)
# We can rearrange this to find the width: width = (perimeter / 2) - length
width... |
Ethan is studying for his math test and he spends an average of 5 minutes on each practice problem. If he completes 8 problems in half an hour, how many minutes per hour does Ethan spend studying? | ```python
def ethan_study_time() -> float:
"""
Ethan is studying for his math test and he spends an average of 5 minutes on each practice problem.
If he completes |
Alex goes on a road trip and rents a car. The rental company charges $50 per day plus $0.30 per mile driven. If Alex drives 200 miles in total and rents the car for 3 days, how much does the rental cost him in total? | ```python
def rental_cost() -> float:
"""
Alex goes on a road trip and rents a car. The rental company charges $50 per day plus $0.30 per mile driven. If Alex drives 200 miles in total and rents the car for 3 days, how much does the rental cost him in total?
"""
daily_charge = 50
miles_driven = 200
... |
A store has one-third as many shirts as pants. If there are 18 pants in the store, how many shirts are there? | ```python
def simple_math_problem() -> int:
"""
A store has one-third as many shirts as pants. If there are 18 pants in the store, how many shirts are there?
"""
pants = 18
shirts_per_pant = 1/3
shirts = pants * shirts_per_pant
result = shirts
return result
```
This code defines a funct... |
During a science experiment, 12 ml of hydrochloric acid was added to a beaker containing 35 ml of water. The resulting solution was poured into two smaller beakers in a ratio of 3:4. How many ml of the solution was poured into the smaller beaker with the greater volume? | ```python
def simple_math_problem() -> float:
"""
During a science experiment, 12 ml of hydrochloric acid was added to a beaker containing |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 2