try except IndentationError try except IndentationError shell shell

try except IndentationError


Here no need any indentation, "except" statement must be at the top level (the same as try statement).


>>> try:    print("hello")except:    passhello>>> 


The “except” block can't be empty. So, your code must be:

try:    print("Hello World!")except:    pass