python3 super fuction arguments | Sololearn: Learn to code for FREE!

-1

python3 super fuction arguments

hi i discover that the super funciton takes some optional argument but can someone explain to me what super function does if the areguments are exist ?

4/16/2021 12:56:06 AM

0MR4N

11 Answers

New Answer

+1

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

+2

Here's a pretty good explanation of super() https://realpython.com/python-super/

+2

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.

+2

0MR4N If you had thoroughly read the link I provided you'd have already known the answer. πŸ˜‰

+1

ChaoticDawg yaaah i did πŸ˜† but u knoooow i am hardhead

0

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".

0

Myk Dowling ok thank u so much i understand now

0

why 10.1*6 = 60.599999999999994 10.1*3 = 30.299999999999997

0

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

0

Mostrar preguntas print ("chupones")

-1

https://aramydesign.blogspot.com/?m=1