Tutorial by Examples

In Python 3 and higher, print is a function rather than a keyword. print('hello world!') # out: hello world! foo = 1 bar = 'bar' baz = 3.14 print(foo) # out: 1 print(bar) # out: bar print(baz) # out: 3.14 You can also pass a number of parameters to print: print(foo, bar, b...
You can do more than just print text. print also has several parameters to help you. Argument sep: place a string between arguments. Do you need to print a list of words separated by a comma or some other string? >>> print('apples','bannas', 'cherries', sep=', ') apple, bannas, cherries...

Page 1 of 1