I solved the problem of changing interest = ('Samsung Electronics', 'LG Electronics', 'SK Hynix')
to list type with interest = ['Samsung Electronics', 'LG Electronics', 'SK Hynix']
and the answer was data = list (interrest)
. However, if you proceed according to the answer, it will still come out as a tuple when you print out the type. What's the problem?
No way. It's going to say list.
interest=('Samsung Electronics', 'LG Electronics', 'SK Hynix')
data = list(interest)
print(type(interest) # Of course, this comes out as <class 'tuple'>
print(type(data)) # But this one comes out well as <class 'list'>
© 2024 OneMinuteCode. All rights reserved.