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'])
精彩评论