I found strange thing while studying through idle

Ben Finney ben+python at benfinney.id.au
Thu Mar 8 20:59:52 EST 2018


Welcome, and congratulations on beginning with Python.

노연수<clear0755 at naver.com> writes:

> If you type print (" hello\ rpython ") into the python 3.7.0.b2

I am not using Python 3.7 (it isn't released yet); I recommend staying
with the latest Python release. Today, that is version 3.6.

That difference in version should not make a difference to the ‘print’
behaviour, so I will assume your code behaves the same in Python 3.6.

When I use Python 3.6 and run the code example you give, it behaves this
way::

    >>> print (" hello\ rpython ")
     hello\ rpython 

> only the python is printed and i learned it's a crystal.

(I don't understand that last clause; what crystal?)

The output above is what I expect. What do you expect?

> However, if you type print (" hello\ rpython ") in the python 3.7.0.b2
> idle, it is output as hellopython.

That's not what I see; the output in Idle version 3.6 is exactly the
same::

    >>> print (" hello\ rpython ")
     hello\ rpython 

> I wonder why it prints like this.

So do I.

Please take the time to cut and paste *exactly* what program code is
being run, and *exactly* what text output you see.

Don't attempt to re-type it manually, because often that makes it
different in detail. One of the tricky things to learn in programming is
that small details can make a big difference!

> I have attached the file so I would appreciate your reference.

File attachments are unlikely to survive to most readers of this forum
(they get dropped, to reduce traffic size and spam and dangerous
attachments).

Instead, keep the program code short and simple; then, copy and paste it
exactly into the text body of your message. That's much more likely to
let us see exactly what you're seeing.

-- 
 \          “Better not take a dog on the space shuttle, because if he |
  `\   sticks his head out when you're coming home his face might burn |
_o__)                                                up.” —Jack Handey |
Ben Finney




More information about the Python-list mailing list