Q爸爸
发表于 2018-2-23 10:30:06
' '.join('跟小甲鱼学编程')
pynliu
发表于 2018-2-23 14:53:10
>>> a = 'I love FishC.'
>>> ' '.join(a)
'I l o v e F i s h C .'
南城顾她
发表于 2018-2-23 21:29:47
def main():
c= 'love FishC.'
q = ''
for x in c:
q += ' '
q += x
print(q)
main()
被翻红浪
发表于 2018-2-23 22:19:41
def str_mod(str1):
return ' '.join(str1)
achun
发表于 2018-2-24 11:58:35
def newString(string):
newS = ''
for each in string :
newS = newS + each + ' '
return newS
str = input("请输入你的字符串")
print(newString(str))
纳兰小寒
发表于 2018-2-24 18:48:54
old = input('请输入你的文字:')
new = old
for i in old:
if i != ' ':
new += ' ' + i
else:
new += i
print(new)
冬雪雪冬
发表于 2018-2-24 19:15:43
评分完毕!
a690089735
发表于 2018-2-25 08:25:00
a = 'Love'
for i in a:
print(i,end = ' ')
a690089735
发表于 2018-2-25 08:25:36
Liuxiuneng 发表于 2018-2-22 10:38
str1 = '跟小甲鱼学编程'
print(' '.join())
6666,这个想法开拓了我的思路
a690089735
发表于 2018-2-25 08:26:41
°蓝鲤歌蓝 发表于 2018-2-22 10:50
哇....一行代码...
victor.xu
发表于 2018-2-25 16:39:20
太简单了吧?是不是我搞错了?
str1 = 'I Love FishC'
' '.join(str1)
haijun123
发表于 2018-2-26 00:10:12
看看
checkily
发表于 2018-2-26 08:27:24
a="I love FishC."
b=' '.join(a)
776667
发表于 2018-2-26 12:10:18
def fun155(x):
return ' '.join()
if __name__ == '__main__':
x = input('输出字符串:')
print(fun155(x))
Caillen
发表于 2018-2-26 19:18:22
def space(*str1):
length = len(str1)
for i in range(length):
a=''
for j in str1:
a+=j+' '
b = len(a)-1
print(a)
新人JOJO
发表于 2018-2-27 10:43:28
a= str(input("输入字符"))
b=""
for each in a:
b = each + " "+b
print(b)
graceasyi
发表于 2018-2-27 17:17:56
自己写了再看别人的代码,发现别人的更简单~
s1 = input("输入一个字符串:")
s2 = []
for i in s1:
tmp = i + ' '
s2.append(tmp)
print(''.join(s2))
结果咧
发表于 2018-2-27 19:17:08
temp=input('请输入字符串:')
for i in temp:
print(i,end=' ')
lenin_king
发表于 2018-2-27 21:09:44
text ='I love FishC.'
for i in text:
print(i,end = ' ')
miraclexy
发表于 2018-2-28 21:49:41
a=input("请输入一串字符串:")
for i in a:
if i!=" ":
print(str(i)+str(" "),end="")