int()语法: int(x,base=10) 默认是10进制的,如果输入的数字是16进制,则只需 num16=input() num10=int(num16,16) 则此时num10中保存的是该数字的10进制形式