What's the difference of these following indentation?


#1

On python 2, practice makes perfect, where you were making a censor function, how does the following indent really changes the code?

for w in words:
if w == word:
words[count] = stars
count += 1
return " ".join(words)

OR:

for w in words:
if w == word:
words[count] = stars
count += 1
return " ".join(words)


#2

Without code sample formatting in your post we cannot tell the difference. If the only difference is the number of spaces, then that will have no effect. You may even use all tabs, but that can lead to mixed tabs and spaces so keep to spaces as a general rule. Two or four are the norm per nested block level.