+ 2

How to print output to next line using print keyword

I have two arrays(arr1 & arr2). I want to print those two arrays in two different lines using print keyword.

24th Jun 2017, 11:46 AM
Avinash Gupta
Avinash Gupta - avatar
4 Antworten
+ 1
i agree with hetbo you can use \n\n\n\n as many times as you want
24th Jun 2017, 11:56 AM
Uni Verse
Uni Verse - avatar
+ 3
\n this symbol takes you to next line
24th Jun 2017, 11:47 AM
Hetbo.net
Hetbo.net - avatar
0
Thanks hetbo and uni. It is working. Can you suggest which is best way to print arr and arr reverse in two different lines arr =[1,2,3] print arr print arr.reverse or by writing print \n in middle of those two print statement is only one option
24th Jun 2017, 12:03 PM
Avinash Gupta
Avinash Gupta - avatar
0
print can take as many arguments as you like. print arr, "\n", arr.reverse
17th Jul 2017, 10:53 PM
Jacques Müller
Jacques Müller - avatar