Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> = RESTART: C:\Dropbox\amir\Teaching\1001py\lectures\2021A\A. Python\1\ID.py = >>> = RESTART: C:\Dropbox\amir\Teaching\1001py\lectures\2021A\A. Python\1\ID.py = >>> control_digit("20811584") '0' >>> print("Hello") Hello >>> print("Hello !!") SyntaxError: unexpected indent >>> print("Hello !!") Hello !! >>> print("Hello" + "CS10001") HelloCS10001 >>> print("Hello" + " " + "CS10001") Hello CS10001 >>> type("Hello") >>> type("334") >>> type(334) >>> type(-4) >>> type(0) >>> str.upper("Amir") 'AMIR' >>> str.lower("Amir") 'amir' >>> str.replace("Amir", "A", "!") '!mir' >>> str.replace("Amir", "s", "!") 'Amir' >>> str.replace("AmirAAA", "A", "!") SyntaxError: unexpected indent >>> print("Amir" *7) AmirAmirAmirAmirAmirAmirAmir >>> >>> >>> >>> >>> >>> >>> >>> print(1+2) 3 >>> print(3*2) 6 >>> 3*2 6 >>> 2/3 0.6666666666666666 >>> 3/2 1.5 >>> 12/5 2.4 >>> 12//5 2 >>> 3/4 0.75 >>> 3//4 0 >>> 3%4 3 >>> 12%5 2 >>> 2**3 8 >>> 9**0.5 3.0 >>> type(4) >>> type(4.5) >>> 3/0 Traceback (most recent call last): File "", line 1, in 3/0 ZeroDivisionError: division by zero >>> 4+3.14 7.140000000000001 >>> 0.1+0.1 0.2 >>> 0.1+0.1+0.1 0.30000000000000004 >>> n = 10 >>> print(n) 10 >>> n = 11 >>> print(n) 11 >>> n+4 15 >>> n-4 7 >>> m = "Amir" >>> m 'Amir' >>> m + 6 Traceback (most recent call last): File "", line 1, in m + 6 TypeError: must be str, not int >>> m + "!" 'Amir!' >>> m = 100 >>> m + 6 106 >>> n+m 111 >>> n**m 137806123398222701841183371720896367762643312000384664331464775521549852095523076769401159497458526446001 >>> n 11 >>> m 100 >>> n+1 12 >>> n 11 >>> n = n+1 >>> n 12 >>> print(n,m,n+m) 12 100 112 >>> name = "Amir" >>> grade = 100 >>> n = n+1 >>> n= n + 1 >>> n 14 >>> >>> >>> >>> >>> >>> >>> >>>