wrong indentation error


  • orderparams = {
    "variety": "NORMAL",
    "tradingsymbol": "SBIN-EQ",
    "symboltoken": "3045",
    "transactiontype": "BUY",
    "exchange": "NSE",
    "ordertype": "LIMIT",
    "producttype": "INTRADAY",
    "duration": "DAY",
    "price": "390",
    "squareoff": "0",
    "stoploss": "0",
    "quantity": "10"
    }
    orderId=obj.place0rder(orderparams)
    print("The order id is: {}".format(orderId))
    except Exception as e:
    print("Order placement failed: {}".format(e.message))

    Iam using above code. It gives following errorr

    File "<ipython-input-44-d8c4717597ee>", line 15
    orderId=obj.place0rder(orderparams)
    ^
    IndentationError: unexpected indent

    Pl help


  • @lavly

    Use pycharm, vscode or sublime text.. they will indent for you,..


  • @lavly

    Properly formatting your code will solve the issue. This is very common issue of improperly formatted code.