print(type(3.1415926));
print(type('Learn Python in imooc.'));
print(type(100));
print(type(0b1101));
print(type('Learn Python in imooc.'));
print(type(100));
print(type(0b1101));
2022-04-02
template='life {i},you {n}'
i="is short,"
n="need python"
result=template.format(i='is short,',n='need pytonn')
print(result)
i="is short,"
n="need python"
result=template.format(i='is short,',n='need pytonn')
print(result)
2022-03-31
a=字符=True,所以a or 'world'=a 所以結(jié)果是hello,python
b=空字符串=False,所以b or 'world'=world,所以結(jié)果是hello,world
b=空字符串=False,所以b or 'world'=world,所以結(jié)果是hello,world
2022-03-30
age = 18
if age < 3 :
print('baby')
elif age >= 3 and age < 6 :
print('kid')
elif age >= 6 and age < 18 :
print('teenager')
else :
print('adult')
if age < 3 :
print('baby')
elif age >= 3 and age < 6 :
print('kid')
elif age >= 6 and age < 18 :
print('teenager')
else :
print('adult')
2022-03-26
最贊回答 / 慕粉3851067
print(sum/5)這個縮進和 sum = sum +x 同級了,所以for循環(huán)每迭代一次就會執(zhí)行一次print(sum/5).這樣就行了:>>> for x in l:? ? ? ? sum = sum+x? print(sum/ 5)
2022-03-23
最贊回答 / weixin_慕娘7382922
a=3000b='我愛你'c='遍'print(str(a)+b+c)因為a是整數(shù)而其它變量為字符串,所以需要先把a轉(zhuǎn)換為字符串 進行統(tǒng)一
2022-03-23