In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use the characteristics of and-or conditional judgment in C language to achieve ternary conditional judgment, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.
Using the characteristics of and-or condition judgment to realize ternary condition judgment
First of all, let's introduce the usage of and and or:
And in python evaluates the expression from left to right, and returns the last value if all values are true, and the first false value if there is a false.
Whether it is a list, tuple, or string, empty represents False, non-empty indicates True
> 'python' and [] and (2mem3) [] >' python' and [2mem3] and (3Jing 4) (3Jing 4)
Or also evaluates the expression from left to right. If there is a true, the first true value is returned, and if both false, the last value is returned.
> 'python' or [3pr 4] or ()' python' >'or [] or () ()
Then, we use the characteristics of and-or conditional judgment to realize ternary conditional judgment:
A _
C = (a > b and [a] or [b]) [0]
>
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: 0
*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.