Skip to main content
Switched over to full program
Source Link
jqkul
  • 2.3k
  • 1
  • 18
  • 24

Python 2 to CJam, 1818 20 bytes

Thanks to LegionMammal978 for correcting the functionality.

lambda n:"print"{%f+}"%n"%input()

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.

Edit: An alternative which is a full program.

print"{%f+}"%input()

(20 bytes)

This only works in Python 2.

Python to CJam, 18 bytes

lambda n:"{%f+}"%n

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.

Edit: An alternative which is a full program.

print"{%f+}"%input()

(20 bytes)

This only works in Python 2.

Python 2 to CJam, 18 20 bytes

Thanks to LegionMammal978 for correcting the functionality.

print"{%f+}"%input()

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.

Added an alternative full-program version.
Source Link
jqkul
  • 2.3k
  • 1
  • 18
  • 24

Python to CJam, 18 bytes

lambda n:"{%f+}"%n

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.

Edit: An alternative which is a full program.

print"{%f+}"%input()

(20 bytes)

This only works in Python 2.

Python to CJam, 18 bytes

lambda n:"{%f+}"%n

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.

Python to CJam, 18 bytes

lambda n:"{%f+}"%n

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.

Edit: An alternative which is a full program.

print"{%f+}"%input()

(20 bytes)

This only works in Python 2.

Source Link
jqkul
  • 2.3k
  • 1
  • 18
  • 24

Python to CJam, 18 bytes

lambda n:"{%f+}"%n

The Python does a basic string format. %f is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.

The CJam is much the same as the Golfscript->CJam answer. It looks something like this:

{7.4+}

or:

{23+}

It's a block that takes the top value off the stack, pushes the special number, then adds them.