Skip to content
Snippets Groups Projects
Commit 2441bd7b authored by rejenver's avatar rejenver
Browse files

Upload New File

parent 557d8979
Branches
No related tags found
No related merge requests found
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
숫자를 입력하세요
>>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment