I have a list of strings in my code;
A = ['a1', 'a2', 'a3' ...] B = ['b1', 'b2', 'b3' ...]
and I want to print them separated by a linebreak, like this:
>a1 b1 >a2 b2 >a3 b3
I've tried:
print '>' + A + '/n' + B
But /n isn't recognized like a line break.
Python isspace() method is used to check space in the string. It returna true if there are only whitespace characters in the string. Otherwise it returns false. Space, newline, and tabs etc are known as whitespace characters and are defined in the Unicode character database as Other or Separator.
You first include the character f before the opening and closing quotation marks, inside the print() function. To print a variable with a string in one line, you again include the character f in the same place – right before the quotation marks.
You have your slash backwards, it should be "\n"
The newline character is actually '\n'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With