U
U
Udozer2022-03-23 22:26:46
Python
Udozer, 2022-03-23 22:26:46

How to solve a math problem with python?

623b73b4d4c03844224285.png
There is such a task from the Unified State Examination in mathematics, just for the sake of interest I wanted to solve it with the help of python. I know the problem itself how to solve it manually, but at the same time I wanted to improve my knowledge of python. Thanks in advance for your help. I will not publish my shameful code. Normal people don't need to see this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2022-03-23
@Udozer

This is not a programming problem, but a math problem. The solution is one formula.
First, solve the equation, at what value of the contribution X will the income from the paper and from the bank deposit be the same?
1.1X+2000 = 1.12X
Before this amount, it is more profitable to take paper - after - a deposit.
Next, you need to take one of the two 4 times, comparing the current amount with the threshold value above.
From Python, you need to be able to perform an action 4 times: Compare 2 values ​​​​and do different actions depending on this.
for i in range(0, 4):

if a < b:
  foo
else:
  bar

Well, you probably don't know, you still need to be able to assign variables and perform arithmetic - multiplication and addition.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question