Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
d0mine
on Nov 28, 2008
|
parent
|
context
|
favorite
| on:
Ruby and the Opposite of Momentum
This particular example could be written as follows:
>>> char = 'f' >>> char * "foobaf".count(char) 'ff'
Or
>>> [char] * "foobaf".count(char) ['f', 'f']
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: