题解 | #截断电话号码#
截断电话号码
https://www.nowcoder.com/practice/078d1abcb55648f687a78d87e4b3cb69
str1 = input() num_list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '-'] for i in str1: if i in num_list and i != '#': print(i, end = '') else : break
截断电话号码
https://www.nowcoder.com/practice/078d1abcb55648f687a78d87e4b3cb69
str1 = input() num_list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '-'] for i in str1: if i in num_list and i != '#': print(i, end = '') else : break
相关推荐