+ 1
Is there something similiar to eval but doesn't take ALL the input?
Is there something like eval that calculates input of integers only. Because eval takes all of ur input For example: in the input i can say print("hello world") and it would print it. Im trying to make a calculator that wont take all the code they input, just integers and binary operaters +-/*. Thnx
4 Answers
+ 6
Why not do a check for an incorrect input and inform the user to input the correct thing?
+ 3
You can use an if statement or a try/catch.
+ 2
Thnx
+ 1
How do i do that? With an if statement?