题解 | #截断电话号码#
截断电话号码
https://www.nowcoder.com/practice/078d1abcb55648f687a78d87e4b3cb69
strs = input() tiqu = list() for i in strs: if(i == '0' or i == '1' or i == '2' or i == '3' or i == '4' or i == '5' or i == '6' or i == '7' or i == '8' or i == '9' or i == '-'): tiqu.append(i) elif (i == '#'): break else: continue for i in tiqu: print(i,end='')