good afternoon all, my self Muder Peer, i am working on the
You have written the code without proper spacing.after functions like while you have to give proper spacings.Please write the code as given in the course notes with proper spaces.
If still not clear search for indentation errors in the search option above .This type of questions are aldready solved there.
@muderpeer786 hi …in the course they all ready mention about blocks of the python code please go and check once… in the code you are not spacing properly ex:
hii @muderpeer786 you need to give proper indentation for python program to excute and i can see that all your code is not with proper indentation.So please type or paste the code which is given in bolt course platform exactly.
Indent your code as others have already shown. Also remember that python uses 4 spaces for indentation.
hey, hello all of them i have updated the project with correct spaces but still facing the same issue.and also thank you for you responses.
You’ve not intended it correctly , look at @rakeshpotharla0664’s screenshot, right after the
statement you need to put a tab space for every statement which needs to be in the while block.
Similarly for the ‘try:’ statement, the ‘if’ and ‘except’ too .
Rewrite the code with the above mentioned spacing , then it should work ,considering you dont have any error other than indentation one.
@muderpeer786 Sir please take a close look at the screenshot shared above it clearly shows how to write while loop with proper syntax and you are not following proper syntax after the while statement.If still confused please google search the syntax of while loop,it may help you.
Please don’t even check the error statement. check the previous lines whether the spacing is done properly and indentation error arises every time when you made mistake on previous line and on the confy file
Indentation refers to the spaces at the beginning of a code line. Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important.Python uses indentation to indicate a block of code.So you should give proper space before every line in a block of code in python.Try to give spaces before code lines properly and execute the code again.
Python has strict rules with respect to indentation in order to make the code more readable. So white spaces have to be given in order to separate blocks of code like after while loop, for loop, if condition etc…Please go through the training material for the code with indentation.
The lines of code after while loop are not indented properly. I recommend you to go through the indentation theory in the course.