https://github.com/jundel-malazarte/eval-function-python
Simple function using eval ()
https://github.com/jundel-malazarte/eval-function-python
Last synced: about 2 months ago
JSON representation
Simple function using eval ()
- Host: GitHub
- URL: https://github.com/jundel-malazarte/eval-function-python
- Owner: Jundel-Malazarte
- Created: 2024-12-04T19:36:14.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-04T19:40:06.000Z (6 months ago)
- Last Synced: 2025-02-12T06:25:03.392Z (4 months ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Sample eval function using python
def function_creator():
# expression to be evaluated
expr = input("Enter the function(in terms of x):")# variable used in expression
x = int(input("Enter the value of x:"))# evaluating expression
y = eval(expr)# printing evaluated result
print("y =", y)if __name__ == "__main__":
function_creator()## OUTPUT:
```output
Enter the function(in terms of x):x*(x+1)*(x+2)
Enter the value of x:3
y = 60