Hi, I'm new to the Pi but have quite a lot of experience of other computers and languages. This concerns the PRINT function in Python:
I'm using IDLE3 because as a newcomer I can't see the point of using earlier versions. I'm going through the tutorials in the MagPi, and using the Raspberry Pi User Guide too. But neither of these sources seem to contain the information I need.
I am trying to use the PRINT function to display messages on the screen, but have come across some annoying problems. The first is that PRINT always adds a space to whatever it has just outputted, so for instance if x=1 and y=2, I can't say:
print(x,y) because it comes out as 1 2 and not 12.
The User Guide says that the comma at the end ensures that strings are concatenated, but this doesn't work either. If I try to do the following:
print ("Foot"), on one line, and then, a few lines later, print("ball"),
It comes out as 'Foot' on one line and 'ball' on the next, no matter how many commas I use. I think I did have it print 'Foot ball' on one line at one time, but I have never seen 'Football' (all one word) yet.
This is pretty basic stuff, which I never had any trouble with before. In C there are various backslash commands to deal with this sort of thing, and in good ole' BBC BASIC there were things you could do with semi-colons, commas, and even nothing at all, after PRINT commands.
Where can I get information? I can't afford to keep spending a fortune on books that quickly go out of date and which are not available for viewing before buying to check for suitability. I want something like the BBC User Guide, with all the Python instructions listed, showing syntaxes and with an explanatory few paragraphs on each one. I've even searched this web site and found nothing.
In the meantime, could somebody out there give me a clue? How do I get rid of unwanted spaces and carriage returns? Its probably not rocket science...