L = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
s1=L[0][0]*L[0][1]*L[0][2]
print(s1)
s1=L[0][0]*L[0][1]*L[0][2]
print(s1)
2020-09-10
# Enter a code
L = ['Alice', 66, 'Bob', True, 'False', 100]
i=0
while i<=5:
if i%2!=0:
print (L[i])
i=i+1
L = ['Alice', 66, 'Bob', True, 'False', 100]
i=0
while i<=5:
if i%2!=0:
print (L[i])
i=i+1
2020-09-09
參考答案有問題吧,應該是
hello='Hello'
space=' '
world='World'
print(hello+space +world)
hello='Hello'
space=' '
world='World'
print(hello+space +world)
2020-09-09
L = ['Alice', 66, 'Bob', True, 'False', 100]
for item in L:
i=L.index(item)
if(i%2)!=0:
print(item)
for item in L:
i=L.index(item)
if(i%2)!=0:
print(item)
2020-09-09
已采納回答 / qq_慕少3205394
template='Life?is?short,you?need?{P}' P='python' result=template.format(P=P) print(result)P相當于占位符,沒有給他賦值
2020-09-08
age = 19
if age>=18:
print('adult'+' '+str(age))
if age>=18:
print('adult'+' '+str(age))
2020-09-07
print('special string: \', ", \\, \\\\, \\n, \\t')
2020-09-07