From ff14723ee6a4486a9e567f56dfb2eb7c69df582a Mon Sep 17 00:00:00 2001 From: "js.sevestre" Date: Fri, 28 Jun 2013 09:52:39 +0200 Subject: Add inequality and chained comparisons --- python.html.markdown | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/python.html.markdown b/python.html.markdown index 42801657..300a5519 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -49,11 +49,24 @@ False not True #=> False not False #=> True - # Equality is == 1 == 1 #=> True 2 == 1 #=> False +# Inequality is != +1 != 1 #=> False +2 != 1 #=> True + +# More comparisons +1 < 10 #=> True +1 > 10 #=> False +2 <= 2 #=> True +2 >= 2 #=> True + +# Comparisons can be chained ! +1 < 2 < 3 #=> True +2 < 3 < 2 #=> False + # Strings are created with " or ' "This is a string." 'This is also a string.' -- cgit v1.2.3