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

syntax error, I think #7

Open
gab192727 opened this issue Apr 7, 2024 · 0 comments
Open

syntax error, I think #7

gab192727 opened this issue Apr 7, 2024 · 0 comments

Comments

@gab192727
Copy link

Hello, good afternoon. I was looking through all the calculator tutorials, and then I found your video on YouTube. I love your content, but I see a little mistake on line 113 and line 122
This is line 113:
113 self.current_expression = str(eval(f"{self.current_expression}**2"))
Line 113 must be:
self.current_expression = str(eval(f"{float(self.current_expression) ** 2}"))
This is line 122:
self.current_expression = str(eval(f"{self.current_expression}**0.5"))
Line 122 must be
self.current_expression = str(eval(f"{float(self.current_expression) ** 0.5}"))

Or else I think it will produce a SyntaxError. Anyway, you have one of the best calculator apps. 99/100!

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