Apr-27-2023, 10:56 AM
Hello,
I am doing a Python training course and am stuck at this question:
Got a list:
Char_List = ['Bla', 'Blu', 10, 20, 30, 40]
Want to have this result:
Num_List = [10, 20, 30, 40]
Used this code:
I am doing a Python training course and am stuck at this question:
Got a list:
Char_List = ['Bla', 'Blu', 10, 20, 30, 40]
Want to have this result:
Num_List = [10, 20, 30, 40]
Used this code:
Num_List = [] for entry in range(len(Char_List)): if type(entry) != str: Num_List.append(entry) print(Num_List)But I get [0, 1, 2, 3, 4, 5], the indexes of the complete Char_List is shown instead of the numeric content. Thanks.