string - I want to cut variable on another variables using Python -
i have variable c
.
c = ' fr,de,uk,it '
i want cut variable on variables: c1
, c2
, c3
, c4
so c1 = 'fr'
, c2 = 'de'
, c3 = 'uk'
, c4 = 'it'
.
how do that?
c1, c2, c3, c4 = c.split(',')
note if, suspect, you're hoping arbitrary number of dynamic variables created depending on length of list, should not try that. keep them in list:
c_list = c.split(',')
Comments
Post a Comment