In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "brief introduction of Python Boolean value and null value". In daily operation, I believe that many people have doubts about the brief introduction of Python Boolean value and null value. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "brief introduction of Python Boolean value and null value". Next, please follow the editor to study!
Code implementation
# =
# function: Boolean and null
# author: brother python
# time: 2020-3-24
# Wechat official account: DJXY00001
# Wechat name: Python Promotion Class
# Version:1.0
# =
A = Truea = Falseprint ('a =', a)
B = Noneprint (b)
Code run output:
A = False
None
Program analysis
Description:
# Boolean (bool)
# Boolean values are mainly used to make logical judgments
# Boolean has two True and False
# True means true and False means false
# Boolean values actually belong to integers. True is equivalent to 1, and false is equal to 0.
# print (1 + False) output 1, that is, true
# print (1+Ture) output 2
# None (null)
# None is specifically used to indicate that it does not exist
# Null value: is a special value in Python, represented by None. None cannot be understood as 0 because 0 is meaningful and None is a special value.
Analysis:
The first behavior of the program, a=True, represents that the value of an is true, and then a=False, then an is false at this time, and then use print ('axiomorphine a) to represent the value of output a, which is False, of course.
Then b=None, which means that the value of b is a special null value, but not zero, and finally print (b), resulting in None.
In the program, if statements are definitely used. If statements need to determine whether the variables are true or false, and then execute the corresponding process according to the judgment results, which is a very important basic knowledge.
At this point, the study of "A brief introduction to Python Boolean values and null values" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 202
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.