def numbers_only(s):
for i in s:
if not(i.isdigit()):
s = s.replace(i,"")
print(s)
test = input("Введите строку: ")
numbers_only(test)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def numbers_only(s):
for i in s:
if not(i.isdigit()):
s = s.replace(i,"")
print(s)
test = input("Введите строку: ")
numbers_only(test)