最近在做笔试题时,总会遇到将系统键入的一系列数转化为整数list,所以在此记录下,仅需一行代码 l = list(map(lambda x:int(x),list(input().split(' ')))) 举个栗子: