Doc:2.6/Manual/Extensions/Python/Intro to Python/Examples

提供: wiki
移動先: 案内検索
# Comment: Hello World example using string literals and print function

>>> print("Hello World")    	
Hello World


>>> print('"Hello World"') 
"Hello World"


>>> print("'Hello World'") 
'Hello World'


>>> print('"Hello \n World"') 
"Hello 
 World"


>>> print("Hello World " * 10) 
Hello World Hello World Hello World Hello World Hello World Hello
World Hello World Hello World Hello World Hello World 


>>> print("Hello World\n" * 5) 
Hello World
Hello World
Hello World
Hello World
Hello World


>>>print(3 * "Hello World\n") 
Hello World
Hello World
Hello World