how to use underscore in python
def public_api():
print ("public api")
def _private_api():
print ("private api")
how to use underscore in python
def public_api():
print ("public api")
def _private_api():
print ("private api")
how to use underscore in python
# Ignore a value of specific location/index
for _ in range(10)
print ("Test")
# Ignore a value when unpacking
a,b,_,_ = my_method(var1)
how to use underscore in python
>>> class MyClass():
... def __init__(self):
... print ("OWK")
>>> def my_defination(var1 = 1, class_ = MyClass):
... print (var1)
... print (class_)
>>> my_defination()
1
__main__.MyClass
>>>
how to use underscore in python
>>> def function(class):
File "<stdin>", line 1
def function(class):
^
SyntaxError: invalid syntax
>>> def function(class_):
... pass
...
>>>
how to use underscore in python
class Prefix:
... def __init__(self):
... self.public = 10
... self._private = 12
>>> test = Prefix()
>>> test.public
10
>>> test._private
12
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us