Skip to content

Commit 48cfcec

Browse files
authored
Update underscore.md
Fix the display of "asinit\, "
1 parent dcdaf85 commit 48cfcec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/underscore.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The underscore (_) has special meaning in Python.
1+
The underscore (\_) has special meaning in Python.
22

33
### For ignoring values:
44

@@ -19,7 +19,7 @@ for _, val in list_of_tuples: # [(1,2),(3,4),(5,6)]
1919
print(val) # output - 3
2020
```
2121

22-
### _single_leading_underscore
22+
### \_single_leading_underscore
2323

2424
This convention is used for declaring private variables, functions, methods and classes. Anything with this convention are ignored in `from module import *`.
2525

@@ -32,15 +32,15 @@ class_ = dict(n=50, boys=25, girls=25)
3232
# avoiding clash with the class keyword
3333
```
3434

35-
### __double_leading_underscore
35+
### \__double_leading_underscore
3636

3737
Double underscore will mangle the attribute names of a class to avoid conflicts of attribute names between classes. Python will automatically add "\_ClassName" to the front of the attribute name which has a double underscore in front of it.
3838

3939
[Read more](https://docs.python.org/3/tutorial/classes.html#private-variables)
4040

41-
### __double_leading_and_trailing_underscore\_\_
41+
### \__double_leading_and_trailing_underscore\_\_
4242

43-
This convention is used for special variables or ( magic )methods such as__init_\_, __len\__. These methods provides special syntactic features.
43+
This convention is used for special variables or ( magic )methods such as`__init__`, `__len__`. These methods provides special syntactic features.
4444

4545
```
4646
class FileObject:

0 commit comments

Comments
 (0)