Using the print command in Python3

Benjamin Kaplan benjamin.kaplan at case.edu
Tue Aug 10 01:34:54 EDT 2010


On Mon, Aug 9, 2010 at 10:17 PM, Grady Knotts <gradyknotts at gmail.com> wrote:
> In earlier versions of Python I can do:
>        print 'A',
>        print 'B'
> to print everything on the same line: 'A B'
>
> But I don't know how to do this with Python3
> I've been trying things like:
>        print('A',)
>        print('B')
> and it prints two different lines.
>
> So, do I get two different print statements to output on the same line?
>


>>> help(print)
Help on built-in function print in module builtins:

print(...)
    print(value, ..., sep=' ', end='\n', file=sys.stdout)

    Prints the values to a stream, or to sys.stdout by default.
    Optional keyword arguments:
    file: a file-like object (stream); defaults to the current sys.stdout.
    sep:  string inserted between values, default a space.
    end:  string appended after the last value, default a newline.



More information about the Python-list mailing list