Nested for loops and print statements

breamoreboy at gmail.com breamoreboy at gmail.com
Mon Sep 26 18:00:27 EDT 2016


On Monday, September 26, 2016 at 9:57:52 PM UTC+1, Cai Gengyang wrote:
> Ok it works now:
> 
> >>>for row in range(10):
>       for column in range(10):
>        print("*",end="")
> 
>      
> ****************************************************************************************************
> 
> but how is it different from ---
> 
> >>> for row in range(10): 
>        for column in range(10): 
>           print("*",end="") 
>            
> SyntaxError: inconsistent use of tabs and spaces in indentation 
> 
> Why does the example on top work and the example below doesn't work ? The only difference is that the "print" statement is one space different from each other. Forgive me if i can't explain things clearly over the forum 
> 

Perhaps you'd be more comfortable on the tutor mailing list https://mail.python.org/mailman/listinfo/tutor

Kindest regards.

Mark Lawrence.



More information about the Python-list mailing list