#try to avoid input function a = (1,2,3,4,"hello","good","morning","friends",1.23,3.14,55.43,(1j),(54j),[1.1,1.2,1.3],["hi","hello"],[1,2,3],("a","b","c"),(101,102)) n = [] for i in a: if type(i) == type(1) or type(i) == type(1.5) or type(i) == type("1"): n.append(i) a = tuple(n) print(a)
Click the run button. Try to avoid input() function.