current position:Home>_ What are the application scenarios in Python

_ What are the application scenarios in Python

2022-06-24 06:56:38CSDN Q & A

  1. 1000_000_000 Split numbers , Let people quickly see how many digits there are
  2. be used for for loop
    for i in range(1000) And for _ in range(1000), If you just control the loop and don't use variables later i In terms of , use _ More efficient .



Take the answer :

python Private variable does not exist in , If there are properties in the class that need to be protected , Then you can prefix the attribute with two underscores , The actual name of the attribute is hidden ( Of course it was just renamed , There is still a way to access , But at least IDE Don't show it directly in , You can't misuse it if you don't use it intentionally )


copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/175/202202150002035601.html

Random recommended