[英]How do I separate a single string containing to individual values
I have two strings the first is:我有两个字符串,第一个是:
a = str(7.19% 8.16%)
and I would like to store this as two different strings as seen below:我想将其存储为两个不同的字符串,如下所示:
b = str(7.19%)
c = str(8.16%)
I have two strings the first is:我有两个字符串,第一个是:
a = str(7.19% 8.16%)
and I would like to store this as two different strings as seen below:我想将其存储为两个不同的字符串,如下所示:
b = str(7.19%)
c = str(8.16%)
This is a one liner这是单班轮
a = '7.19% 8.16%'
b,c=a.split(' ')
print(b,c)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.