11 AnswersNew Answer
Or you can go to the genuine doco; always worth checking. It is possible for a class to inherit from multiple classes, and the optional arguments let you choose between them. https://docs.python.org/3/library/functions.html?highlight=super#super
Here's a pretty good explanation of super() https://realpython.com/python-super/
0MR4N , it doesn't always need to be self. If you are wanting to call a method from a parent class of one of your class' objects, you would specify that object instead of self. Another possibility is that you are importing a class from a library, and it has a private parent class that you don't want to import. If you wanted to access a class or static method from that private parent, you would put the class you have imported in that second argument, fitting the "or type" definition for the argument.
0MR4N If you had thoroughly read the link I provided you'd have already known the answer. 😉
ChaoticDawg yaaah i did 😆 but u knoooow i am hardhead
Myk Dowling but sorry i knw now wht it does but what meas the second argumenet exactly and why it always need to be "self".
Myk Dowling ok thank u so much i understand now
why 10.1*6 = 60.599999999999994 10.1*3 = 30.299999999999997
help me def balanced(expression): #your code goes here print(balanced(input())) Balanced Parentheses Parentheses are balanced, if all opening parentheses have their corresponding closing parentheses. Given an expression as input, we need to find out whether the parentheses are balanced or not. For example, "(x+y)*(z-2*(6))" is balanced, while "7-(3(2*9))4) (1" is not balanced. The problem can be solved using a stack. Push each opening parenthesis to the stack and pop the last inserted opening parenthesis whenever a closing parenthesis is encountered. If the closing bracket does not correspond to the opening bracket, then stop and say that the brackets are not balanced. Also, after checking all the parentheses, we need to check the stack to be empty -- if it's not empty, then the parentheses are not balanced. Implement the balanced() function to return True if the parentheses in the given expression are balanced, and False if not. Sample Input: (a( ) eee) ) Sample Output: False
Mostrar preguntas print ("chupones")