How to split a string into multiple variables in Python

1 Answer

0 votes
string = 'python java c c++'

a, b, c, d = string.split(' ')

print(a) 
print(b) 
print(c) 
print(d) 



'''
run:

python
java
c
c++

'''

 



answered Aug 7, 2022 by avibootz

Related questions

...