最新回答 / qq_慕仔3233167
# coding:utf-8age = 19pot = '今年{}歲了'if age >= 18:? ? print('adult')? ? print(pot.format(float(age)))
2021-08-18
最新回答 / 白白醬
結(jié)合2-2 第一個Python程序的練習(xí)去看,應(yīng)該是Python默認(rèn)是以ASCII作為編碼方式,如果在自己的Python源碼中包含了中文需要在第一行加上:#coding=utf-8加上后就運(yùn)行成功啦
2021-08-16
最新回答 / 精慕門3379778
因?yàn)樵赼 or b運(yùn)算中當(dāng)a為ture的時候,結(jié)果必定為true,所以輸出a當(dāng)a為false的時候,結(jié)果取決于b,所以輸出b
2021-08-14
最贊回答 / 車約會李海鋼
age = int(input('請年齡:'))if age >= 18:? ? print('adult')elif age > 6 and age <= 8:? ? print('kid')elif age > 3 and age <= 6:? ? ? # 年齡3歲到6歲? ? print('child')
2021-08-13
最贊回答 / Maybe0829
a的值已經(jīng)是true,賦值為python。根據(jù)or或運(yùn)算法則,一個為true其結(jié)果為true,所以(a or 'world')為python,最后運(yùn)行結(jié)果為 hello python。(這只是我自己的見解)
2021-08-12
最新回答 / Wind隨風(fēng)
L?=?[[1,2,3],?[5,?3,?2],?[7,3,2]] for?cube?in?L: ????length?=?cube[0] ????width?=?cube[1] ????height?=?cube[2] ????result?=?length?*?width?*?2?+?width?*?height?*?2?+?length?*?height?*?2 ????print(result)
2021-08-11