There are several ambiguities in the question that directly affect the solution.
The first is that we have no way of knowing for sure if the value ab
must be the concatenation of values a
and b
, getting 1020, or if ab
must be the product between a
and b
, getting 200. Whatever the correct form, your code is wrong.
If it’s concatenation, you need to convert to string and use the operator +
: str(a)+str(b)
; or, in Python 3.6+ use f-string: f'{a}{b}'
;
If it’s multiplication, you need to use the operator *
: a*b
;
I spoke a little about the operators of Python in Which operator is equivalent to different in Python?
The second is that you put (ab)+(bc)+(cd)+(de)/e
. That means, mathematically, that only the value de
will be divided by e
, which would only result in d
, if e
is other than zero.
As I believe right would be:
You will need to put your entire denominator between parentheses: ((ab)+(bc)+(cd)+(de))/e
.
Making these corrections, you will probably arrive at the expected result.
To format the code, select it completely and hit the shortcut
CTRL+K
– NoobSaibot
ab
should be the values appalled or multiplied?– Woss
In "dismayed", read concatenated.
– Woss