[英]python Magic 8 ball using functions
The issue is the last line of answers:问题是最后一行答案:
" the Magic 8-Ball says:" + answers
You forgot to put parentheses after answers.你忘了在答案后加上括号。 Without them, it is trying to add the string to the answers function.
没有它们,它会尝试将字符串添加到答案函数中。 With parentheses it will call answers() and append the return value.
使用括号,它将调用 answers() 并附加返回值。
PS you might want a space after the colon after "says". PS,您可能需要在“says”之后的冒号后留一个空格。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.