naren_paste

only_numeric

Aug 22nd, 2024
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | Source Code | 0 0
  1. def only_numeric(a):
  2.     n = []
  3.     for i in a:
  4.         if type(i) == list:
  5.             for j in i:
  6.                 if type(j) == int or type(j) == float:
  7.                     n.append(j)
  8.         else:
  9.             if type(i) == int or type(i) == float:
  10.                 n.append(i)
  11.     return n
Advertisement
Add Comment
Please, Sign In to add comment