Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> x=5 >>> x 5 >>> y=3.14 >>> y 3.14 >>> course="intro2CS" >>> course 'intro2CS' >>> course='intro2CS' >>> course 'intro2CS' >>> type(x) >>> type(y) >>> type(course) >>> type(4) >>> type(5.0) >>> 10/4 2.5 >>> type(10/4) >>> 10/3 3.3333333333333335 >>> 10//3 3 >>> 10/2 5.0 >>> 4+5 9 >>> 4+5.0 9.0 >>> 2**0.5 1.4142135623730951 >>> "4"+"5" '45' >>> "4"+5 Traceback (most recent call last): File "", line 1, in "4"+5 TypeError: Can't convert 'int' object to str implicitly >>> "4"*5 '44444' >>> "4"*"5" Traceback (most recent call last): File "", line 1, in "4"*"5" TypeError: can't multiply sequence by non-int of type 'str' >>> 5*"4" '44444' >>> 10%2 0 >>> 10.0%2 0.0 >>> 10%3 1 >>> 10.3%3 1.3000000000000007 >>> x=453 >>> x 453 >>> x%10 3 >>> x//10 45 >>> (x//10)%10 5 >>> type(x/10) >>> x/10 45.3 >>> (x/10)%10 5.299999999999997 >>> int("6") 6 >>> int("3.14") Traceback (most recent call last): File "", line 1, in int("3.14") ValueError: invalid literal for int() with base 10: '3.14' >>> int("a6") Traceback (most recent call last): File "", line 1, in int("a6") ValueError: invalid literal for int() with base 10: 'a6' >>> int("a") Traceback (most recent call last): File "", line 1, in int("a") ValueError: invalid literal for int() with base 10: 'a' >>> y = 3.14 >>> z = int(y) >>> z 3 >>> y = 3.7 >>> z = int(y) >>> z 3 >>> s = "5" >>> z = int(s) >>> z 5 >>> s '5' >>> float("3.14") 3.14 >>> float("4") 4.0 >>> str(4) '4' >>> str(5.16) '5.16' >>> course = "intro" + str(2) + "CS" >>> course 'intro2CS' >>> y = 3.7 >>> y = int(y) >>> y 3 >>> >>> ================================ RESTART ================================ >>> Recitation! Bye >>> ================================ RESTART ================================ >>> Recitation! Bye >>> ================================ RESTART ================================ >>> Go home Enjoy Bye >>> ================================ RESTART ================================ >>> Recitation! Enjoy Bye >>> ================================ RESTART ================================ >>> New week Bye >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 6 >>> ================================ RESTART ================================ >>> 0 0 >>> ================================ RESTART ================================ >>> 0 1 >>> ================================ RESTART ================================ >>> -10 0 = 0: " (instead of "while num >0:" ) we get an infinite loop> >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 Traceback (most recent call last): File "C:/work/Python/Tuesday/zero_counter1.py", line 12, in cnt = cnt + 1 KeyboardInterrupt >>> >>> >>> -1//10 -1 >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 6 >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 1 2 6 7 6 5 0 6 0 0 2 2 8 2 2 9 4 0 1 4 9 6 7 0 3 2 0 5 3 7 6 counteris: 6 >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 1 2 6 7 6 5 0 6 0 0 2 2 8 2 2 9 4 0 1 4 9 6 7 0 3 2 0 5 3 7 6 counter is: 6 >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 6 >>> ================================ RESTART ================================ >>> 1267650600228229401496703205376 Traceback (most recent call last): File "C:/work/Python/Tuesday/zero_counter3.py", line 5, in cnt = str.count(num,"0") TypeError: descriptor 'count' requires a 'str' object but received a 'int' >>>