L1 = [1, 2, 3]
L2 = [5, 3, 2]
L3 = [7, 3, 2]
def s(L):
A = L[0] * L[1] + L[1] * L[2]+ L[0] * L[2]
return A
print(s(L1), s(L2), s(L3))
L2 = [5, 3, 2]
L3 = [7, 3, 2]
def s(L):
A = L[0] * L[1] + L[1] * L[2]+ L[0] * L[2]
return A
print(s(L1), s(L2), s(L3))
2025-02-28
a = 'python'
print('hello,', a or 'world')
#a為非空字符串,所以為True,或運(yùn)算,a為True則返回a
b = ''
print('hello,', b or 'world')
#b為空字符串,所以為False,b為False,或運(yùn)算,有一個為True則結(jié)果為True,所以返回后面的word
print('hello,', a or 'world')
#a為非空字符串,所以為True,或運(yùn)算,a為True則返回a
b = ''
print('hello,', b or 'world')
#b為空字符串,所以為False,b為False,或運(yùn)算,有一個為True則結(jié)果為True,所以返回后面的word
2025-02-27
3.1415926 浮點數(shù)
'Learn Python in imooc.' 字符串
100 整數(shù)
0b1101 二進(jìn)制整數(shù)
'Learn Python in imooc.' 字符串
100 整數(shù)
0b1101 二進(jìn)制整數(shù)
2025-02-27
s = "ABCDEFGHIGKLMNOPQRSTUVWXYZ"
print(s[3])
print(s[0:4])
print(s[1:])
print(s[1:3])
print(s[ :3])
print(s[1: ])
print(s[3])
print(s[0:4])
print(s[1:])
print(s[1:3])
print(s[ :3])
print(s[1: ])
2025-02-23
>>> Length=3.14
>>> Width=1.57
>>> result=round(Length*Width,2)#
>>> print(result)
4.93
>>> Width=1.57
>>> result=round(Length*Width,2)#
>>> print(result)
4.93
2025-02-22
>>> Python='寶庫'#
>>> print(Python)
寶庫
>>> I='我'#
>>> Love='愛'#
>>> Python='Python計算機(jī)語言'#
>>> print(I,Love,Python)
我 愛 Python計算機(jī)語言
>>> s='雖然'#
>>> i='我'#
>>> B='很笨'#
>>> print(s,i,B)
雖然 我 很笨
>>> D='但是'#
>>> i='我'#
>>> N='努力'#
>>> print(D,i,N)
但是 我 努力
>>> H='會'#
>>> C='成功'#
>>> print(i,H,C)
我 會 成功
>>> print(Python)
寶庫
>>> I='我'#
>>> Love='愛'#
>>> Python='Python計算機(jī)語言'#
>>> print(I,Love,Python)
我 愛 Python計算機(jī)語言
>>> s='雖然'#
>>> i='我'#
>>> B='很笨'#
>>> print(s,i,B)
雖然 我 很笨
>>> D='但是'#
>>> i='我'#
>>> N='努力'#
>>> print(D,i,N)
但是 我 努力
>>> H='會'#
>>> C='成功'#
>>> print(i,H,C)
我 會 成功
2025-02-22
最新回答 / 原諒我這一生放縱不_lpAHSZ
template='Life is{a},you need'a='short'b='python'result=template.format(a=a,b=b)print(result)
2025-02-21