Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String Concatenation #4

Open
durgadarba97 opened this issue Jun 8, 2021 · 0 comments
Open

String Concatenation #4

durgadarba97 opened this issue Jun 8, 2021 · 0 comments

Comments

@durgadarba97
Copy link
Owner

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant