按下回车键跳到正文

Category: Notes

Understanding the underscore( _ ) of Python

I’m not a native speaker. Sorry for my english. Please understand. The underscore (_) is special in Python. While the underscore (_) is used for just snake-case variables and functions in most languages (Of course, not for all), but it has special meanings in Python. If you are python programmer, for _ in range(10) , __init__(self) like syntax may be familiar. This post will explain the about when and how use the underscore (_) and help you understand it. There are 5 cases for using the underscore in Python. For storing the value of last expression in interpreter. For ignoring the specific values. (so-called “I don’t care”) To give special meanings and…

阅读文章 Understanding the underscore( _ ) of Python

虚位以待