In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use operators in Python. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
1. The meaning of the operator
+ plus sign
-minus sign
/ (slash) division
* (asterisk) multiplication
% (percent sign) modular division
Greater than sign
= greater than or equal to sign
2. Operation
The operation of operators in Python basic learning is completely the difficulty of calculation at the primary level. Yes, you are not mistaken, the addition, subtraction, multiplication and division here completely follow the basic algorithms, such as starting from left to right, multiplication and division first, and parentheses first. Here is a code example:
Print "I will now count my chickens:"
Print "Hens", 25 + 30 / 6
Print "Roosters", 100-25 * 3% 4
Print "Now I will count the eggs:"
Print 3 + 2 + 1-5 + 4% 2-1 / 4 + 6
Print "Is it true that 3 + 2
< 5 - 7?" print 3 + 2 < 5 - 7 print "What is 3 + 2?", 3 + 2 print "What is 5 - 7?", 5 - 7 print "Oh, that's why it's False." print "How about some more." print "Is it greater?", 5 >-2
Print "Is it greater or equal?", 5 > =-2
Print "Is it less or equal?", 5
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: 292
*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.