Python Forum

Full Version: Geany 1.25 terminal not showing whitespace
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am using Python 3.5 with Geany 1.25.

One of the exercises I cam across while studying python as a beginner was stripping whitespace from string.
I stored 'python ' as the value in variable favourite_language. The terminal should return me a value with a white space at the end of the word python, but I only see python with no indication of white space. It's a black terminal window.

How do see whitespace in my output?

Thanks!
Using print() it will not show quotes.
Example:
>>> # in a REPL it show quotes
>>> s = 'python '
>>> s
'python '
>>> s.strip()
'python'
 
>>> # print will not show quotes,if it's 1 or 10 whitespace it will not be visible
>>> print(s)
python 
>>> # Can use repr to show quotes
>>> print(repr(s))
'python '
>>> print(repr(s.strip()))
'python'