What does the% in Python mean?

Source: Internet
Author: User
http://zhidao.baidu.com/link?url=MQLeRPckNfavTJYvMQbVj_ What does the% Pdnn5ssadtfvfek7nncuspcpw4t1o45esiuttubw3ensbs7kl2hz3lae1fnsg1o_ python mean? weixinweiboqqqzoneannie157 | browse 11,226 times 2012-10-21 22:52  2012-10-22 01:58 Best Answer
Modulo arithmetic, the equivalent of a mod, which computes the remainder of a division, such as 5%3, gets 2.

% is also used in Python formatted output, such as:
A = ' test '
print ' It is a%s '% (a)
The result of the printing is that it is a test

What does the% in Python mean?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.