New course! Every coder should learn Generative AI!
Try a free lesson7 Answers
+ 4
print([c for c in input() if c.isnumeric()])
+ 1
import re
output = map(int,re.findall(r'\d+',string))
0
As you are a beginner, read this 👇
https://www.kite.com/JUMP_LINK__&&__python__&&__JUMP_LINK/answers/how-to-extract-integers-from-a-string-in-python
0
Hi, thank you so much,
By the way, do you how to use import while we're coding
0
Like import function, I'm kinda confused on this
0
Ok thanks
- 1
For c in string:
If type(c)== int:
Output.append(c)