Write a python code for below problem,
We have a list
Input = [5,'Unnamed: 1','Unnamed: 2','Unnamed: 3', 6, 'Unnamed: 5','Unnamed: 6']
want to convert it into: Output= [5,5,5,5,6,6,6]
1
Expert's answer
2021-10-12T00:37:28-0400
list1 = [5,'Unnamed: 1','Unnamed: 2','Unnamed: 3', 6, 'Unnamed: 5','Unnamed: 6']
for i in range(len(list1)):
if 0 <= i <=3:
list1[i] = 5
else:
list1[i] = 6
list1
[5, 5, 5, 5, 6, 6, 6]
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment