Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 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 ...