diff --git "a/\354\260\275\354\235\230\354\206\214\355\224\204\355\212\270\354\233\250\354\226\264\354\236\205\353\254\270 11/python11_20#2.py" "b/\354\260\275\354\235\230\354\206\214\355\224\204\355\212\270\354\233\250\354\226\264\354\236\205\353\254\270 11/python11_20#2.py" new file mode 100644 index 0000000000000000000000000000000000000000..ad1ae24d3e624c14c51479368960232eedf96e01 --- /dev/null +++ "b/\354\260\275\354\235\230\354\206\214\355\224\204\355\212\270\354\233\250\354\226\264\354\236\205\353\254\270 11/python11_20#2.py" @@ -0,0 +1,134 @@ +Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32 +Type "help", "copyright", "credits" or "license()" for more information. +>>> a = ([1,2,4],[5,6,7]) +>>> a +([1, 2, 4], [5, 6, 7]) +>>> type(a) +<class 'tuple'> +>>> a[0] +[1, 2, 4] +>>> a[0][0] = 4 +>>> a +([4, 2, 4], [5, 6, 7]) +>>> a[0] = 1,2,4 +Traceback (most recent call last): + File "<pyshell#6>", line 1, in <module> + a[0] = 1,2,4 +TypeError: 'tuple' object does not support item assignment +>>> dic = {} +>>> dic['파이썬'] = 'www.python.org' +>>> 얓 +Traceback (most recent call last): + File "<pyshell#9>", line 1, in <module> + 얓 +NameError: name '얓' is not defined +>>> dic +{'파이썬': 'www.python.org'} +>>> type(dic) +<class 'dict'> +>>> dic.keys() +dict_keys(['파이썬']) +>>> dic.values() +dict_values(['www.python.org']) +>>> dic.items() +dict_items([('파이썬', 'www.python.org')]) +>>> '파이썬' in dic.keys() +True +>>> dic.pop('파이썬') +'www.python.org' +>>> 얓 +Traceback (most recent call last): + File "<pyshell#17>", line 1, in <module> + 얓 +NameError: name '얓' is not defined +>>> dic +{} +>>> b = [(2,3,4),(5,6,7)] +>>> b +[(2, 3, 4), (5, 6, 7)] +>>> b[0][0] = 3 +Traceback (most recent call last): + File "<pyshell#21>", line 1, in <module> + b[0][0] = 3 +TypeError: 'tuple' object does not support item assignment +>>> b[0] = 4 +>>> b +[4, (5, 6, 7)] +>>> b[0] = (2,3,4) +>>> b +[(2, 3, 4), (5, 6, 7)] +>>> a = 123456 +>>> a & 1 +0 +>>> a & 2 +0 +>>> a & 3 +0 +>>> a & 0b11 +0 +>>> a & 0b11111111 +64 +>>> a & 255 +64 +>>> a // 255 +484 +>>> a % 255 +36 +>>> +============= RESTART: C:/Users/AJOU/Downloads/python11_20#1.py ============= +14 +>>> +============= RESTART: C:/Users/AJOU/Downloads/python11_20#1.py ============= +23232323 0b1011000100111111101000011 14 +>>> +============= RESTART: C:/Users/AJOU/Downloads/python11_20#1.py ============= +23232323 0b1011000100111111101000011 18 +>>> a = "0" +>>> not a +False +>>> a = 0 +>>> not a +True +>>> a = "" +>>> not a +True +>>> +============= RESTART: C:\Users\AJOU\Downloads\python11_20#1.py ============= +23232323 0b1011000100111111101000011 14 +수를 입력하세요 : +1 +3 / 1 = 3.0 +>>> +============= RESTART: C:\Users\AJOU\Downloads\python11_20#1.py ============= +23232323 0b1011000100111111101000011 14 +수를 입력하세요 : +NDH +Traceback (most recent call last): + File "C:\Users\AJOU\Downloads\python11_20#1.py", line 10, in <module> + a = int(input()) +ValueError: invalid literal for int() with base 10: 'NDH' +>>> +============= RESTART: C:\Users\AJOU\Downloads\python11_20#1.py ============= +23232323 0b1011000100111111101000011 14 +수를 입력하세요 : +100 +Traceback (most recent call last): + File "C:\Users\AJOU\Downloads\python11_20#1.py", line 11, in <module> + if (a.isnumeric()): +AttributeError: 'int' object has no attribute 'isnumeric' +>>> +============= RESTART: C:\Users\AJOU\Downloads\python11_20#1.py ============= +23232323 0b1011000100111111101000011 14 +수를 입력하세요 : +100 +Traceback (most recent call last): + File "C:\Users\AJOU\Downloads\python11_20#1.py", line 11, in <module> + if( a.isnumeric()): +AttributeError: 'int' object has no attribute 'isnumeric' +>>> +============= RESTART: C:\Users\AJOU\Downloads\python11_20#1.py ============= +23232323 0b1011000100111111101000011 14 +수를 입력하세요 : +NDH +숫자를 입력하세요 +>>>