str1 = 'IloveFishC.com'
for i in str1:
print(i)
看看
不自觉地就想用循环。。。
sunnychou 发表于 2017-9-5 14:32
为什么在notebook上不加\n也换行尼
应该是因为print函数默认换行吧
for i in "IloveFishC.com":
print(i)
冬雪雪冬 发表于 2017-9-4 19:12
如果函数可以接收多个参数,可以将一个可迭代对象在前面加上*分解为多个参数传入。
例如
fun(*)
...
哦
回复学习一下
66666666666666666
来个通俗易懂的{:9_241:}
print('将IloveFishC.com竖向打印')
print('------------------------')
str1 = 'IloveFishc.com'
for i in range(len(str1)):
print(str1,end = '\n')
str1 = 'IloveFishC.com'
str2="\n".join(str1)
print(str2)
def verticalPrint(string):
print('\n'.join(string))
本帖最后由 古堡主人。 于 2017-9-6 10:11 编辑
我就是想把特别复杂的东西写在一行上,为此一直在装b的路上……
str1 = 'IloveFishC.com'
print('\n'.join(str1))
{:10_256:}{:10_256:}{:10_266:}{:10_266:}{:10_269:}{:10_249:}{:10_261:}
工程狗 发表于 2017-9-5 08:56
str1 = 'IloveFishC.com'
n = 0
print(str1)
niubi!
>>> str1 = 'IloveFishC.com'
>>> print(*str1,sep='\n')
I
l
o
v
e
F
i
s
h
C
.
c
o
m
我瞧瞧
str1 = 'IloveFishC.com'
print('I')
print('l')
print('o')
print('v')
print('e')
print('F')
print('i')
print('s')
print('h')
print('C')
print('.')
print('c')
print('o')
print('m')
####我没用循环
str1 = 'IloveFishC.com'
list=list(str1)
for str in list:
print str
答案的语法是py3的吗,我用了报错SyntaxError: invalid syntax
{:10_243:}
str1 = 'IloveFishC.com'
print("\n".join(str1))