3 ms·
With similar properties, but more disgusting: for n in range(1, 101): print(n, end='\r') if n % 3 == 0: print("Fizz", end='') if
by duckerude 8y ago
With similar properties, but more disgusting:
for n in range(1, 101):
print(n, end='\r')
if n % 3 == 0:
print("Fizz", end='')
if n % 5 == 0:
print("Buzz", end='')
print()
- drfuchs 8y agoExtra points for deviousness, but this won't produce the correct visual result when logged in on a hardcopy terminal (e.g. DECwriter); or even on a glass tty (e.g. DEC VT100) if you set the upper limit to 10001. It will also always fail a correctness test of diffing against the proper output. You should definitely consider entering the Obfuscated C contest, though.