题目:给一个不多于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
zip() 可以接受多于两个的序列的参数。这时候所生成的结果元组中元素个数跟输入序列个数一样 >>> a = [1, 2, 3]>>> b = [10, 11, 12]>>> c = ['x','y','z']>>> for i in zip(a, b, c):... print(i)...(1, 10, 'x')(2, 11, 'y')(3, 12, 'z')>>> zi
代码: 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