Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. >>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. >>> word1 = "hello" >>> word2 = "there" >>> print(word1 + word2) hellothere >>> print(word1, word2) hello there >>> print(word1, word2, "!") hello there ! >>> print(word1 + "!") hello! >>> print(word1, "!") hello ! >>> print(word1 + 0.5) Traceback (most recent call last): File "", line 1, in print(word1 + 0.5) TypeError: Can't convert 'float' object to str implicitly >>> print(word1, 0.5) hello 0.5 >>> 0.56324 0.56324 >>> 5 5 >>> print(word1 + 5) Traceback (most recent call last): File "", line 1, in print(word1 + 5) TypeError: Can't convert 'int' object to str implicitly >>> len(word1) 5 >>> len("!") 1 >>> len("") 0 >>> len(word1 + word2) 10 >>> len(" ") 1 >>> len("0.5") 3 >>> len(word1, word2) Traceback (most recent call last): File "", line 1, in len(word1, word2) TypeError: len() takes exactly one argument (2 given) >>> x = len(word1) >>> print(x) 5 >>> len(word1 + " " + word2) 11 >>> for i in range(3): print(i) 0 1 2 >>> for i in range(0,3,1): print(i) 0 1 2 >>> for i in range(87,92): print(i) 87 88 89 90 91 >>> for i in range(30,41,2): print(i) 30 32 34 36 38 40 >>> for i in range(30,40,2): print(i) 30 32 34 36 38 >>> for i in range(30,42,2): print(i) 30 32 34 36 38 40 >>> for i in (range(0,3) + range(10,12)): print(i) Traceback (most recent call last): File "", line 1, in for i in (range(0,3) + range(10,12)): TypeError: unsupported operand type(s) for +: 'range' and 'range' >>> for i in [0,1,2] + [10,11]: print(i) 0 1 2 10 11 >>> for i in range(0,10,0.1): print(i) Traceback (most recent call last): File "", line 1, in for i in range(0,10,0.1): TypeError: 'float' object cannot be interpreted as an integer >>> for i in range(10): print(i/10) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 >>> round(0.5) 0 >>> x = 0.3 >>> round(x) 0 >>> y = round(x) >>> y 0 >>> x 0.3 >>> ================================ RESTART ================================ >>> Enter temperature in celcius: 15 Traceback (most recent call last): File "/Users/ssheehan/Desktop/convert.py", line 6, in main() File "/Users/ssheehan/Desktop/convert.py", line 4, in main print(celsius) NameError: name 'celsius' is not defined >>> ================================ RESTART ================================ >>> Enter temperature in celcius: 15 59.0 >>> ================================ RESTART ================================ >>> Enter temperature in celcius: 15 The temperature in fahrenheit is 59.0 degrees. >>> ================================ RESTART ================================ >>> Enter temperature in celcius: 17 The temperature in fahrenheit is 62.6 degrees. >>> ================================ RESTART ================================ >>> Enter temperature in celcius: 17 The temperature in fahrenheit is 63 degrees. >>>