h='{0} {1} {2}, {3} {4} {5}'
g=h.format('life','is','short','you','need','Python')
print(g)
g=h.format('life','is','short','you','need','Python')
print(g)
2025-04-21
h='{a} {c}, nhkv1sx5v02o {e} {f}'
a1 ='list'
b1 = 'is'
c1 ='short'
d1 = 'you'
e1 = 'need'
f1 = 'Python'
g=h.format(a=a1,b=b1,c=c1,d=d1,e=e1,f=f1)
print(g)
a1 ='list'
b1 = 'is'
c1 ='short'
d1 = 'you'
e1 = 'need'
f1 = 'Python'
g=h.format(a=a1,b=b1,c=c1,d=d1,e=e1,f=f1)
print(g)
2025-04-21
Alice_score = ['Alice','chinese',92,'math',75,'english',99]
print(Alice_score)
print(Alice_score)
2025-03-18
評(píng)論區(qū)這個(gè)程序可以參考:
T = ((1+2), ((1+2),), ('a'+'b'), (1, ), (1,2,3,4,5))
for a in T:
print(type(a))
結(jié)果:
<class 'int'>
<class 'tuple'>
<class 'str'>
<class 'tuple'>
<class 'tuple'>
T = ((1+2), ((1+2),), ('a'+'b'), (1, ), (1,2,3,4,5))
for a in T:
print(type(a))
結(jié)果:
<class 'int'>
<class 'tuple'>
<class 'str'>
<class 'tuple'>
<class 'tuple'>
2025-03-18