print(*'IloveFishC.com', sep='\n')
str1 ='''
I
l
o
v
e
F
i
s
h
C
.
c
o
m
'''
print(str1)
神奇
答题
str1 = 'IloveFishC.com'
print('\n'.join(str1))
str1 = 'IloveFishC.com'
print('\n'.join(str1))
本帖最后由 子沙 于 2018-9-22 23:15 编辑
str1 = 'IloveFishC.com'
print('\n'.join(str1))
str0 = 'IloveFishC.com'
print('\n'.join(str0))
>>> str1 = "IloveFishC.com"
>>> for i in str1:
print(i)
print("\n".join(list(str1)))
{:5_109:}
我学习一下
求答案
for i in str1:
print(i)
123
第一眼看题目 很简单,想着写个for a in str1:拉到最后看,不能用循环。瞬间傻眼了。
然后对print()有了新的认识。
看了楼上有个大佬用递归写的,学习一下。
>>> string = (
"I\n"
"l\n"
"o\n"
"v\n"
"e\n"
"F\n"
"i\n"
"s\n"
"h\n"
"C\n"
".\n"
"c\n"
"o\n"
"m\n")
str1='ILoveFishC.com'
str2=['I','L','o','v','e','F','i','s','h','C','.','c','o','m']
for a in str2:
print(a)
看看答案
str1 = "IloveFishC.com"
print("\n".join(str1))
def func(thing):
if thing=='':return
print(thing)
func(thing)