4 added 71 characters in body
source | link

-1 byte if I make ==0 into >0 but that's already another answer

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

1/2 gives 0 (floordiv) in Python 2 and 0.5 (truediv) in Python 3. Thus, 1/2==0 gives 1 in Python 3 and 0 in Python 2 (actually, booleans, but those are just integers), so 'acbbca'[1::2] => 'cba' is given for Python 3 and 'acbbca'[0::2] => 'abc' is given for Python 2.

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

1/2 gives 0 (floordiv) in Python 2 and 0.5 (truediv) in Python 3. Thus, 1/2==0 gives 1 in Python 3 and 0 in Python 2 (actually, booleans, but those are just integers), so 'acbbca'[1::2] => 'cba' is given for Python 3 and 'acbbca'[0::2] => 'abc' is given for Python 2.

-1 byte if I make ==0 into >0 but that's already another answer

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

1/2 gives 0 (floordiv) in Python 2 and 0.5 (truediv) in Python 3. Thus, 1/2==0 gives 1 in Python 3 and 0 in Python 2 (actually, booleans, but those are just integers), so 'acbbca'[1::2] => 'cba' is given for Python 3 and 'acbbca'[0::2] => 'abc' is given for Python 2.

3 added 283 characters in body
source | link

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

1/2 gives 0 (floordiv) in Python 2 and 0.5 (truediv) in Python 3. Thus, 1/2==0 gives 1 in Python 3 and 0 in Python 2 (actually, booleans, but those are just integers), so 'acbbca'[1::2] => 'cba' is given for Python 3 and 'acbbca'[0::2] => 'abc' is given for Python 2.

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

1/2 gives 0 (floordiv) in Python 2 and 0.5 (truediv) in Python 3. Thus, 1/2==0 gives 1 in Python 3 and 0 in Python 2 (actually, booleans, but those are just integers), so 'acbbca'[1::2] => 'cba' is given for Python 3 and 'acbbca'[0::2] => 'abc' is given for Python 2.

2 added 296 characters in body
source | link

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

Python 2, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!


Python 3, 26 bytes

print('acbbca'[1/2==0::2])

Try it online!

1
source | link