If you want to get some recommendations with regards to spacing and other best practices, do a search
for Python Pep eight in Google and this gives you information about how you should be writing code in
Python.
This is the style guide for Python code and they talk about indentation and we told to use four spaces
per indentation level.
So if you want any recommendations about how you should write code.
Have a look at the style guide.
One of the questions that often comes up is string quotes.
Should you be using single or double quotes?
In this PPIP guide, we told that single and double quotes are treated the same.
The PEP doesn't make a recommendation for this.
You should simply pick a rule and stick to it.
So in other words, either use single quotes or double quoted strings when a string contains single
or double code characters, however, use the other one to avoid back slashes to improve readability.
In other words, in this example with my python range.
I'm using single quote characters.
If you actually want to quote the word hello as if you're quoting someone saying something like this.
Then use the other.
Quotation within your string.
So python three, python three range.
Notice we see.
Hello.
Like this.
If however.
I did.
Thus we would have a problem in our code.
So if I try to run that, we're getting an error.
If I wanted to keep on using single quotes.
I'd have to do this to indicate that it's actually what I want.
And that works or.
I could do what Pep eight says.
And use a double quotation marks to indicate that this hello is actually within a quote.
Run that again.
And that once again works.
So the moral of the story is be consistent.