In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the operation rules between different types of Python". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the operation rules between different types of Python".
Operation rules between different types
Generally speaking, we don't operate on data of numeric type and Boolean type, nor do we operate on data of string type and Boolean type.
We need to use the arithmetic operator provided by Python to complete the operation between variables. Python provides two kinds: arithmetic operator and compound assignment operator.
The arithmetic operator operator describes the example + plus 10 + 20 = 30-minus 10-20 =-10 * multiplied by 10 * 20 = 200 / divided by 10 / 20 = 0.5 stroke / division returns the integer part of the division (quotient) 9 / / 2 the remainder of the output result 4% returns the remainder of the division 9% 2 = 1 times * power, power, power 2 * * 3 = 8 compound assignment operator description example = simple assignment operator c = a + b assigns the result of a + b operation to c = addition assignment operator c = an equivalent to c = c + a color = subtraction assignment operator c-= an is equivalent to c = c-a = multiplication assignment operator c = an is equivalent to the division assignment operator c / = a The assignment operator c / / = an is equivalent to c = c / a% = modulo (remainder) assignment operator c% = an is equivalent to c = c% axiom = power assignment operator c = c% * = an is equivalent to c = c% * a
Note:
All operations can be performed between numbers and numbers.
Multiplication can only be performed between a number and a string.
Only addition can be performed between strings.
Thank you for your reading, the above is the content of "what are the operation rules between different types of Python". After the study of this article, I believe you have a deeper understanding of what the operation rules between different types of Python are, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.