аватар question@mail.ru · 01.01.1970 03:00

Conclusion in one line from different Print in Python

I need to make the function print () written by the same Obrz:

   print  ( 'a' a ')   print  (' b ')   print  ( 'c' )  

brought something:

  & GT; C: \ Users \ User \ Documents & GT; Python Test.pyabc    

should be displayed in one line, but print () in the code in different lines!
I will be very glad if someone will help.

аватар answer@mail.ru · 01.01.1970 03:00

"

The function print () has such key parameters:

  • sep = & ndash; when a few values ​​are removed, which character or line is separated by the
    (standard - pro -trumpet. i.e., line '' ),

  • end = & ndash; '\ n' ),

  • file = & ndash in which file to display the values ​​of the
    (standard - on the screen, i.e. sys.stdout ),

  • flush = & ndash; immediately display the stream; false ).

In your case, after the output of the value , to stay in the same line , then you do not want the standard ending to the new line ( end = '\ n' ), but to finish something else with something else. (with a gap, a comma, and so on), too,

because end the output empty line '' '):

Print ( 'a' , end = '' ) print ( 'b ", end = '' ) print ( 'c' ) ​​

Latest

Similar