开发者

Getting a syntax error when converting a string into an int

I开发者_开发知识库 am trying to convert a string into an int using the typecast "(int)". Here is what I am doing:

num = (int) request.POST['num']


Try using the int() function instead.

num = int(request.POST['num'])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜