Jan-08-2020, 08:28 PM
My code is meant to multiply a number with pi, but when I run it I get the error: TypeError: setText(self, str): too many arguments
I get the error on both the 'if' and the 'else', so I'm guessing the problem is with the format() function, but I don't what.
1 2 3 4 5 |
def pi( self ): if self .tall_input.text() = = "" or self .tall_input.text() = = 0 : self .tall_input.setText( format (math.pi), '.15g' ) else : self .tall_input.setText( format ( float ( self .tall_input.text()) * math.pi), '.15g' ) |