Home > Backend Development > Python Tutorial > What does the python double equal sign mean?

What does the python double equal sign mean?

藏色散人
Release: 2019-07-06 11:26:38
Original
46210 people have browsed it

What does the python double equal sign mean?

What does the double equal sign mean in python?

pythonThe double equal sign is a Python comparison operator, which means equal and is used to compare whether objects are equal.

Assume variable a is 10 and variable b is 20: (a == b) Return False.

Example:

#!/usr/bin/python
# -*- coding: UTF-8 -*-
 
a = 21
b = 10
 
if  a == b :
   print "a 等于 b"
else:
   print "a 不等于 b"
Copy after login

Output:

a 不等于 b
Copy after login

Related recommendations: "Python Tutorial"

The above is the detailed content of What does the python double equal sign 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