如题所述
代码如下:
N_list = [123, 321, 12, 1, 10, 20, 999]H_digit = []for i in N_list:if len(str(i)) == 3:H_digit.append(str(i)[0])print(H_digit)
输出: