감동, 마음이 움직이는 것

[Python] deep copy & range of variable 본문

Tips (Utility, Computer Language, and etc.)

[Python] deep copy & range of variable

Struggler J. 2017. 7. 18. 19:16


[1] deep copy

https://stackoverflow.com/questions/17873384/deep-copy-a-list-in-python

import copy

>>> x=[1,0,0]

>>>x0 = copy.deepcopy(x)

>>>x[0] =0

>>>x

>>>[0,0,0]

>>>x0

>>>[1,0,0]



[2] Range of float 

>>> import sys

>>> sys.float_info

>>> sys.float_info[0]

>>> 1.7976931348623157e+308