Python tricks

1. >>> a=b=c=0.
>>> a=1.
>>> a
1.0
>>> b
0.0
>>> c
0.0

2.>>> a=b=c=[0.,0.,0.,0.]
>>> a[0]=1.0
>>> a
[1.0, 0.0, 0.0, 0.0]
>>> b
[1.0, 0.0, 0.0, 0.0]
>>> c
[1.0, 0.0, 0.0, 0.0]

About yhtian

I am an academic researcher working on Offshore Geotechnical Engineering. My blog aims to write down some work related trivial things and tricks about software, programming. It is basically a memo for me to back up some thoughts and small details. But I am more than happy if someone would visit and discuss.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment