题目:给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字。 There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence. The blog content is all parallel
a=[x[:2] for x in train a 问题: 要取第一列 Item_identifier的前两位字母, 比如0行中的‘FDA15’,需要提取‘FD’两个字符,并创建新的一列Iden2在表格中。 train['Iden2']=[x[:2] for x in train['Item_Identifier']] **Output:**最后一列Iden2只有头两位字符。
代码: positive_integer = input('请输入不多于5位的正整数:')number_list = list(positive_integer)number_list.reverse()print(f'{positive_integer}是一个{len(number_list)}位数')for i in range(len(number_list)):print(num