输入的数是几位数

 1 a = int(input(">>"))
 2 n = 1
 3 while True:
 4     b = a%10
 5     print(b,end=',')
 6     a = a//10
 7     if a != 0:
 8         n += 1
 9     else:
10         break
11 print('这是',n,'位数')

posted @ 2018-08-01 23:10  JerryZao  阅读(192)  评论(0编辑  收藏  举报