标题所说的,我的函数不工作了,我该如何修复它?提前谢谢。
代码:
def is_crowd(people):
# Write your function here.
if people >= 30:
return 'a crowd'
elif people == 3:
return 'a crowd'
else:
return 'no crowd'
# Write the rest of your program here.
crowd = int(input('Number of people: '))
print(f"There's {is_crowd} here!")它输出的内容:
Number of people: 48
There's <function is_crowd at 0xf6e128e4> here!发布于 2021-08-02 02:08:25
需要使用()来打印函数的返回值。或者,简单地输入is_crowd将打印它的内存位置:<function .... at 0x....>
print(f"There's {is_crowd(value)} here!")https://stackoverflow.com/questions/68615690
复制相似问题