《Practical Set Reconciliation》
Yaron Minsky Cornell University https://blog.janestreet.com/author/yminsky/
Ari Trachtenberg Boston University
def set_reconcile(src_seq, dst_seq):
"Return required operations to mutate src_seq into dst_seq"
src_set= set(src_seq) # no-op if already of type set
dst_set= set(dst_seq) # ditto
for item in src_set - dst_set:
yield 'delete', item
for item in dst_set - src_set:
yield 'create', item
for i in set_reconcile([1,2,3,4], [2,3,4,5]):
$ python set_reconcile.py
Guido van Rossum is the creator and benevolent dictator for life (a.k.a. BDFL) of the Python programming language. Here he reflects on his path and shares what he’s been working on since joining Dropbox. Read on for this and a hint at what’s next for Dropbox, for Python, and for the BDFL himself.
You were an electronics hobbyist before becoming a programmer. How did you get started in electronics?
Okay, we’re going waaaay back. I don’t know exactly why I got into electronics as a kid. I remember that from the last grade in elementary school and probably through my second year in university, electronics kits and my own designs were one of my big passions.
It wasn’t always an easy path. In elementary school, I took one of the first projects I built into class as a show and tell project. There was no one who understood what it was or why it was interesting or cared. It’s a very vague memory. I just know that I took it in, and it fell flat.
Was there a time when you eventually found your people?
In high school, I hung out with a few other guys who had similar hobbies. We were all the geekiest kids in class.
I remember our physics teacher really encouraging us. The three of us worked together to build a large electronic device that was then used in demonstrations in front of the classroom. That was very satisfying.
Throughout high school, I had a very vague idea of what kinds of careers would be open to me. My general idea was that I was good at both sciences and languages and not so good in social areas. I ended up choosing mathematics.
How did you go from electronics to programming? Continue reading “(Python Author) Guido van Rossum on finding his way”
step用来移动对象，默认移动猴子。 “turtle.step 10” 用来移动乌龟10步。
turn 用于转动方向，”turn left”：向左移动90度，”turn -90″: 顺时针移动90度，“turnTo bridge”：移动到bridge所在方向。
3.times -> 实现循环