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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -