python - From tuple to 1d array -


i have list [(1,),(2,),(3,),(4,)] how can convert 1d array [1,2,3,4]?

test = [(1,),(2,),(3,),(4,)] single = []  in test:     single.append(i[0])  print(single) 

output

[1, 2, 3, 4] 

Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -