最新回答 / qq_慕仔3233167
# coding:utf-8age = 19pot = '今年{}岁了'if age >= 18: print('adult') print(pot.format(float(age)))
2021-08-18
最新回答 / 白白酱
结合2-2 第一个Python程序的练习去看,应该是Python默认是以ASCII作为编码方式,如果在自己的Python源码中包含了中文需要在第一行加上:#coding=utf-8加上后就运行成功啦
2021-08-16
已采纳回答 / minzeOK
很简单啊,只打印不返回,那就会继续执行下去。那到了用len(args)时len(args)=0为除数就报错了。我记得前面的章节9-2有讲:return表示返回的意思,函数体内部的语句在执行时,一旦执行到return时,函数就执行完毕,并将结果返回。所以懂了么
2021-08-15
最赞回答 / 车约会李海钢
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的值已经是true,赋值为python。根据or或运算法则,一个为true其结果为true,所以(a or 'world')为python,最后运行结果为 hello python。(这只是我自己的见解)
2021-08-12
最新回答 / Wind随风
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