2 + 2 1.4 + 2.25 4 - 2 2 * 3 4 / 2 0.5/2 3 // 2 15.5 // 2 2 + 2 2+2 (1 + 3) * 4 x = 4 x * 3 _ + 8 jeans = 5 shoes = 2 socks = 12 shirts = 1 items_packed = jeans + shoes + socks + shirts items_packed print(items_packed) type(shirts) type(0.99) "Hello" "Python, I'm your #1 fan!" type("Hello") name = "Carol" 2 + 2 "Carol" + "Willing" "Carol " + "Willing" "Carol" + " " + "Willing" name = "Carol" "My name is " + name "Hello" + 1 "Hello" + "1" type(1) type("1") "Hello" + str(1) len("Hello") len(name) "The length of my name is " + str(len(name)) "Hello" 'Hello' "Python, I'm your #1 fan!" "A" * 40 h = "Happy" b = "Birthday" (h + b) * 10 "Hello" print("Hello") 3 ** 3 type(1) type(1.0) type("1") True False type(True) type(False) 0 == 0 0 == 1 0 != 1 "a" == "A" 1 > 0 2 >= 3 -1<0 .5 <= 1 "H" in "Hello" "x" in "Hello" "a" not in "abcde" type(True) type("True") type(true) x = 4 x == 4 if 6 > 5: print("Six is greater than 5") if 0 > 2: print("Zero is greater") if "banana" in "bananarama": print("I miss the 80s") sister = 15 brother = 12 if sister > brother: print("Sister is older") else: print("Brother is older") 1 > 0 and 1 < 2 1 < 2 and "x" in "abc" "a" in "abc" and "b" in "abc" and "c" in "abc" "a" in "hello" or "e" in "hello" temp = 32 if temp > 60 and temp < 75: print("Nice and cozy") else: print("Too extreme for me") sister = 15 brother = 15 if sister > brother: print("Sister is older") elif sister == brother: print("Twinsies!!") else: print("Brother is older") from IPython.display import YouTubeVideo # a tutorial about Python at PyCon 2014 in Montreal, Canada by Jessica McKellar # Credit: William Stein. YouTubeVideo('MirG-vJOg04') from IPython.display import IFrame # Pull in the tutorial prep information from OpenHatch wiki IFrame('http://bit.ly/intro-setup', width='100%', height=350)