Twilio project (Intendation error)

good afternoon all, my self Muder Peer, i am working on the

Twilio project. i am facing a intendation error in the 9 line of the code which i have attached.i searched for this error on the google but couldn’t clear it.

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.

1 Like

@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:

1 Like

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.

1 Like

Hi @muderpeer786,

Indent your code as others have already shown. Also remember that python uses 4 spaces for indentation.

1 Like

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

while True:

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. :slight_smile:

@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.

Hello @muderpeer786
The lines of code after while loop are not indented properly. I recommend you to go through the indentation theory in the course.