+ 4
(Challenge) Value Table Calculator
Write a program that take the following inputs expression: (example: âsin(x)â) independent variable: (example: âxâ) var min: example: â-10â var max: example: â+10â step: example: â0.1â and generate a table, based on the inputs, printing the value of the stepped independent variable and the expression. Reasonable simple in python, ...
6 Respostas
+ 8
this my initial code for sin/ cos /tan
https://code.sololearn.com/c8iZREZeV903/?ref=app
+ 2
https://code.sololearn.com/cl65x6dj8sO3/?ref=app
+ 2
Good initial work! Try to be more generic and to support all mathematical expressions that your programming language understands ...
For example also more complex things like 2*x + sin(x) + (x*cos(x)). In python this can be done without writing a complex parser ...
+ 2
https://code.sololearn.com/cy9ZcWkI3wZP/?ref=app
Hereâs an attempt in python that allows additionally expressions for the min / max and step values ...
+ 1
Markus, with eval :) ? I update my answer
+ 1
Exactly ... eval is the magic command ...