Answer the question
In order to leave comments, you need to log in
How to split a string into multiple variables?
variable X stores a string of three words, you want variable Y to contain the second word of the string, and variable Z the third word of the string
example:
x = "один два три"
you want variable Y to have the word "two"
and variable Z to have the word "three"
Answer the question
In order to leave comments, you need to log in
Just for this case. For a different string length, a different solution is needed.
x = "один два три"
a,b,c = x.split()
print(a)
print(b)
print(c)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question