Skip to content
Snippets Groups Projects
Commit 30e3501c authored by 장범진's avatar 장범진
Browse files

Upload New File

parent 80807238
No related branches found
No related tags found
No related merge requests found
ptyhon.py 0 → 100644
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> a[1]=(4,5,6)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
a[1]=(4,5,6)
NameError: name 'a' is not defined
>>> a[1]= (4,5,6)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
a[1]= (4,5,6)
NameError: name 'a' is not defined
>>> a=(1,2,3)
>>> a
(1, 2, 3)
>>> a.append(4,5,6)
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
a.append(4,5,6)
AttributeError: 'tuple' object has no attribute 'append'
>>> a.append(4)
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
a.append(4)
AttributeError: 'tuple' object has no attribute 'append'
>>> a[0]
1
>>> a[:2]
(1, 2)
>>> a[2:]
(3,)
>>> a[0]=[1,2,3]
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
a[0]=[1,2,3]
TypeError: 'tuple' object does not support item assignment
>>> a
(1, 2, 3)
>>> a=[1,2,3]
>>> a.append(4)
>>> a.append(5,6)
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
a.append(5,6)
TypeError: append() takes exactly one argument (2 given)
>>> a
[1, 2, 3, 4]
>>> b=([1,2,3],[4,5,6])
>>> b[0][0]=4
>>> b
([4, 2, 3], [4, 5, 6])
>>> a=123456
>>> a&1
0
>>> a|1
123457
>>> a&&1
SyntaxError: invalid syntax
>>> a|1
123457
>>> type(b)
<class 'tuple'>
>>> type(a)
<class 'int'>
>>> 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/Desktop/r.py ====================
23232321 0b1011000100111111101000001 13
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232321 0b1011000100111111101000001 0x1627f41 0o130477501 13
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232321 0b1011000100111111101000001 0x1627f41 0o130477501 13
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232321 0b1011000100111111101000001 0x1627f41 0o130477501 13
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232321 0b1011000100111111101000001 0x1627f41 0o130477501 13
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
2323232 0b1000110111001100100000 0x237320 0o10671440 9
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
232323223 0b1101110110001111100010010111 0xdd8f897 0o1566174227 17
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232323 0b1011000100111111101000011 0x1627f43 0o130477503 14
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232323 0b1011000100111111101000011 0x1627f43 0o130477503 14
>>>
==================== RESTART: C:/Users/AJOU/Desktop/r.py ====================
23232323 0b1011000100111111101000011 0x1627f43 0o130477503 18
>>> a=3>2
>>> a
True
>>> a=3<2
>>> a
False
>>> type(a)
<class 'bool'>
>>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment