Indentation Error

0

I am trying to do a Cloud Quest project for the role of solutions architect the project name being "Cloud Infrastructure with Generative AI". I am facing an indentation error which I am not able to understand. I have attached a screenshot of it as well for your reference. Kindly help Enter image description here

질문됨 3달 전104회 조회
1개 답변
1
수락된 답변

Hi Mayank,

Python uses spacing at the start of the line to determine when code blocks start and end. Errors you can get are:

Unexpected indent. This line of code has more spaces at the start than the one before, but the one before is not the start of a subblock (e.g., the if, while, and for statements). All lines of code in a block must start with exactly the same string of whitespace. For instance:

def a():
...   print "foo"
...     print "bar"
IndentationError: unexpected indent

It looks like the code on line 80 has an unexpected indent compared to the line(s) above it. I suggest that you review the indentation of the lines above it. Alternatively, you can share a screenshot with more context.

Thanks, Ben

profile pictureAWS
전문가
답변함 3달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠