Python预增量运算符(++ x)

时间:2019-07-14 07:28:43

标签: python operator-keyword pre-increment

在Python中,这段代码是什么意思? Python是否具有递增形式的前缀形式?

app.post("/checkout",isLoggedIn,(req,res)=>{

    for(var i=0;i<req.body.order.length;i++){
      if(req.body.order[i].itname=="nullified")
      req.body.order.splice(i,1);
      i=0;
    }

   var orderpp={
     restroname:req.body.restro,
     cusname:req.body.custo,
     deliveryadd:req.body.loc,
     bill:req.body.bill,
     items:req.body.order,
     deliveryslot:req.body.slot,
     payment:req.body.pay,
     roomdet:req.body.room
   };

   console.log(orderpp.items);

   Order.create(orderpp,(err,neworder)=>{
     if (err) {
       req.flash("error",err.message);
       res.redirect("/index");
     } else {

       console.log(neworder);

     }
   })
  })

帖子增量在Python中无效,并且在终端中显示错误。但是前缀增量不会显示错误。那么>>> x=5 >>> ++x 5 >>> print(x) 5 在Python中是什么意思?

0 个答案:

没有答案