431 karma · joined March 21, 2012
for i in range(110):
pr = ""
pr += "Fizz" * (i%3 == 0)
pr += "Buzz" * (i%5 == 0)
pr += "Bazz" * (i%7 == 0)
print (pr if pr else i)
I iterated over range(110) to show that it handles the "FizzBuzzBazz" case correctly.EDIT: Or we could use lambdas as OP's Ruby code did; this might be more maintainable...
cases = [
lambda n: "Fizz" * (n%3 == 0),
lambda n: "Buzz" * (n%5 == 0),
lambda n: "Bazz" * (n%7 == 0) ]
for i in range(110):
pr = ""
for case in cases:
pr += case(i)
print (pr if pr else i)
That's nine nonblank lines."Individual investors and the funds that just invest in stocks and bonds are not going to crash the market."
So what happened in 1929 then?
Another point that the article makes is that these savers are rarely making "investments" that would meaningfully help the economy down the road (a possible argument against nudging them towards consumption). They're "stuffing it under the mattress," parking it in the safest investments they can find (cf. lower-middle-class America watching Glenn Beck and then rushing off to buy gold from his advertisers). Or at best, they're entrusting it to a "guy" (as described in TFA) who does roughly the same thing for them, while providing a nice placebo effect that makes them believe they're "investing."