浮點(diǎn)數(shù),字符串,整數(shù),二進(jìn)制數(shù)
2025-05-20
# 方法一
template1 = 'Life is {0}, you need {1}'
print(template1.format('short', 'Python'))
# 方法二
template2 = 'Lift is {p1}, you need {p2}'
print(template2.format(p1 = 'short', p2 = 'Python'))
template1 = 'Life is {0}, you need {1}'
print(template1.format('short', 'Python'))
# 方法二
template2 = 'Lift is {p1}, you need {p2}'
print(template2.format(p1 = 'short', p2 = 'Python'))
2025-05-19
在Python中使用以下方式表示二進(jìn)制數(shù)和十六進(jìn)制數(shù)。
2025-05-08