What does % in python mean?

藏色散人
Release: 2019-06-25 11:04:51
Original
13236 people have browsed it

What does % in python mean?

What does % in python mean?

What does % in python mean:

1. Modulo operation is equivalent to mod, which is to calculate the remainder of division. For example, 5%2 will get 1.

2. % is also used in python’s formatted output, for example:

 a = 'test'
 print 'it is a %s' %(a)
Copy after login

The printed result is

it is a test
Copy after login

Related recommendations: "Python Tutorial

The above is the detailed content of What does % in python mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!