You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error :
line 63, in evaluate
return int(self.expLeft.evaluate()) + int(self.expRight.evaluate())
ValueError: invalid literal for int() with base 10: 'hello'
Input :
hello = "hello" + "world"
print(hello)
I should check the type when doing addition. I could also implement a subtract feature that removes all instances of a token. For example,
"Hello" + "World" = "Hello World"
"Hello World" - "World" = "Hello"
"Hello World" - "o" = "Hell Wrld"
The text was updated successfully, but these errors were encountered:
Error :
line 63, in evaluate
return int(self.expLeft.evaluate()) + int(self.expRight.evaluate())
ValueError: invalid literal for int() with base 10: 'hello'
Input :
hello = "hello" + "world"
print(hello)
I should check the type when doing addition. I could also implement a subtract feature that removes all instances of a token. For example,
"Hello" + "World" = "Hello World"
"Hello World" - "World" = "Hello"
"Hello World" - "o" = "Hell Wrld"
The text was updated successfully, but these errors were encountered: