运运520
发表于 2018-2-22 14:54:57
str1 ='I love FishC.'
list1 = []
for i in str1:
print(i)
list1.append(i)
str2 = ' '.join(list1)
print(str2)
8306最硬
发表于 2018-2-22 15:05:38
def fun(s):
return ' '.join(s)
woduhaitao
发表于 2018-2-22 15:44:21
>>> oldstr = '跟小甲鱼学习编程'
>>> newstr = ''
>>> for each in oldstr:
newstr = newstr +each +' '
>>> newstr
'跟 小 甲 鱼 学 习 编 程 '
LargeCat
发表于 2018-2-22 16:13:32
def a(msg):
r=''
for i in msg:
r=r+i+' '
return r
红门饕餮
发表于 2018-2-22 16:34:16
>>> str1 = 'abcd'
>>> for each in str1:
print(each, end = ' ')
colinshi
发表于 2018-2-22 17:19:36
def add_temp(list):
tmp = ''
for i in list:
tmp = tmp+i+' '
return tmp
喔呦~
发表于 2018-2-22 18:11:26
字母的不太会
文字的可以
L=['跟','小','甲','鱼','学','编','程']
for i in L:
print i,' '
int_lyc
发表于 2018-2-22 18:25:09
def jo():
a = input()
b = list(a)
a = ' '.join(b)
print(a)
if __name__ == '__main__':
while True:
jo()
majia1015
发表于 2018-2-22 19:16:38
a = "I love FishC"
for i in a:
print(i,'', end = '')
print('\n', end = '')
b = "跟小甲鱼学编程"
for x in b:
print(x,'',end = '')
print('\n',end = '')
wlb666
发表于 2018-2-22 19:56:18
i=input("输入数据")
print(" ".join(list(i)))
C4rB0n
发表于 2018-2-22 20:14:08
一行解决{:5_91:}
string =
shihua010
发表于 2018-2-22 20:23:37
import re
string = '跟小甲鱼学编程'
pattern = re.compile('.{1,1}')
print(' '.join(pattern.findall(string)))
solomonxian
发表于 2018-2-22 20:55:56
join?
def fun(string):
return " ".join(string)
JessiFly
发表于 2018-2-22 21:55:58
本帖最后由 JessiFly 于 2018-2-22 22:11 编辑
origin_str = input('请输入您需要改变的字符串:')
result_str =''
count = 0
#将字符串所有字符除了最后一个字符之后添加空格
while count < len(origin_str)-1:
result_str += origin_str + ' '
count += 1
#将原字符串最后一个字符加入新字符串
result_str += origin_str
print('插入空格后的字符串是:\n' + result_str)
fc1735
发表于 2018-2-22 22:02:29
#新手上路,请多指教
#例:
#>>> q155('fishc')
#>>> 'f i s h c'
def q155(s):
c=''
i,j= 0,len(s)-1
while i < j:
c+=s
c+=' '
i+=1
c+=s
return c
125zl
发表于 2018-2-23 01:16:42
str_1 = input('请输入一串字符:')
new_str = ''
for each in str_1:
new_str += each + ' '
print(new_str)
qwc3000
发表于 2018-2-23 06:04:22
a=input("请输入任意字符:")
list=list(a)
# print(list)
tmp=" "
a=tmp.join(list)
print(a)
小强森
发表于 2018-2-23 08:35:40
n=input('请输入一个字符串:')
print(' '.join(n))
时光不老
发表于 2018-2-23 09:49:47
终于有个简单的了,嘿嘿{:10_266:}
string = input('~')
# string = 'I love FishC.'
n_string = ''
for i in string:
n_string += i+' '
print(n_string)
qichq_7
发表于 2018-2-23 10:13:51
' '.join()