Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen challenge 2 | test challenge
test daily challenge
course content

Kursinhalt

test daily challenge

test daily challenge

book
challenge 2

Implement a function that evaluates mathematical expressions given as strings. The expressions will contain positive integers and the operators '+', '-', '*', '/', '(', and ')'. Your function should correctly handle operator precedence and parentheses, and return the result as an integer.

You need to write the code that evaluates such expressions and outputs the correct result for each expression provided.

Examples:

Input

python

Output

python

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 2
toggle bottom row

book
challenge 2

Implement a function that evaluates mathematical expressions given as strings. The expressions will contain positive integers and the operators '+', '-', '*', '/', '(', and ')'. Your function should correctly handle operator precedence and parentheses, and return the result as an integer.

You need to write the code that evaluates such expressions and outputs the correct result for each expression provided.

Examples:

Input

python

Output

python

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 2
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
Wir sind enttäuscht, dass etwas schief gelaufen ist. Was ist passiert?
some-alt