Polyglot CheatSheet - Print
Last Updated: 2021-11-19
Python
# with new line
print("1")
# without new line
print("1", end='')
pprint
can pretty-print arbitrary Python data structures
>>> import pprint
>>> pp = pprint.PrettyPrinter(indent=4)
>>> pp.pprint(foo)
Java
// with new line
System.out.println()
// without new line
System.out.print()
Print Array
Java
System.out.println(Arrays.toString(arr));