** * This article is from Udemy "[Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style](https://www.udemy.com/course/python-beginner/" Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style ")" It is a class notebook for myself after taking the course of. It is open to the public with permission from the instructor Jun Sakai. ** **
print_arrange_space
print('Hi', 'Mike')
result
Hi Mike
If you separate a character string and a character string with ,
with print ()
, they will be paralleled with a space in between.
print_arrange_sep=''
print('Hi', 'Mike', sep=',')
result
Hi,Mike
If a character is specified with sep =''
, the specified character is sandwiched between them.
print_end_\n
print('Hello', end='\n')
print('Hello', end='\n')
result
Hello
Hello
You can specify how to end the character string output by print with ʻend =''.
\ n` means "line feed".
print_end_nothing
print('Hello')
print('Hello')
result
Hello
Hello
If you do not write ʻend =''`, it will end with a line break.
print_end_''
print('Hello', end='')
print('Hello', end='')
result
HelloHello
If you do not write anything in ''
after describing ʻend =''`, it will be paralleled without inserting anything.
Recommended Posts