Skip to content

syntax error, I think  #7

Description

@gab192727

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions