Proper form for printing a newline (python) -
if want print newline in python, better form use print(''), or print('\n', end = ''), or else?
print('\n', end = '') seems on complicated, while print('') feels bit strange.
using python3, if need print newline character, use:
print()
looking @ documentation print(), shows default end character '\n'.
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=false) prints values stream, or sys.stdout default. optional keyword arguments: file: file-like object (stream); defaults current sys.stdout. sep: string inserted between values, default space. end: string appended after last value, default newline. flush: whether forcibly flush stream. type: builtin_function_or_method
Comments
Post a Comment