2022年7月6日 星期三

underscore

underscore 

2022/07/05

-----


https://pixabay.com/zh/photos/dog-cat-pets-mammals-animals-2606759/

-----

「What do single and double leading underscores before an object's name represent in Python?」[1]。


「This post is a breakdown of the different ways underscores are used. It’ll cover:

1. single leading underscores: _foo

2. single trailing underscores: foo_

3. single underscores: _

4. double leading and trailing underscores (used in defining dunder methods): __bar__

5. double leading underscores: __bar」[2]。

-----

References


[1] python - What is the meaning of single and double underscore before an object name? - Stack Overflow

https://stackoverflow.com/questions/1301346/what-is-the-meaning-of-single-and-double-underscore-before-an-object-name


[2] What’s the Meaning of Single and Double Underscores In Python? | by Ahmed Besbes | Towards Data Science

https://towardsdatascience.com/whats-the-meaning-of-single-and-double-underscores-in-python-3d27d57d6bd1


[3] The Meaning of Underscores in Python – dbader.org

https://dbader.org/blog/meaning-of-underscores-in-python


[4] Underscore in Python Tutorial : What is the purpose and meaning of _ & __ | DataCamp

https://www.datacamp.com/tutorial/role-underscore-python


[5] Underscore (_) in Python - GeeksforGeeks

https://www.geeksforgeeks.org/underscore-_-python/

-----

鐵達尼號 Python 實作(目錄)

https://mandhistory.blogspot.com/2022/06/titanic.html

-----

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。