TORONTO KIDS COMPUTER CLUB | Monday 20:00 Python Practice 21.02.01.
19003
post-template-default,single,single-post,postid-19003,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Monday 20:00 Python Practice 21.02.01.

03 Feb Monday 20:00 Python Practice 21.02.01.

Question:

Continue modify the following method in the SimpleCalc class we made in the class:

def getResult(self):

so that it will check the following conditions:

    • number 1 has to be a number (you can consider using try and except to do it)
    • number 2 should not be empty and has to be a number
    • the self.op should not be None

Please use self.str_result to display the error message

No Comments

Post A Comment