How do I rectify the error \"unexpected indent\" in python?
By using correct indentation. Python is whitespace aware, so you need to follow its indentation guidlines for blocks or you'll get indentation errors.