【发布时间】:2016-02-12 01:16:57
【问题描述】:
#Soccer Matchup Possibilities
def soccermatchups(team1,team2):
result=" "
if (team1== "Brazil" and team2== "Canada"):
result= "These teams could play each other in the World Cup!"
if (team1== " England" and team2== "Netherlands"):
result= "These teams could play each other in both Cups!"
return(result)
我遇到了上面显示的结果没有返回的问题,我该怎么办?我在这方面遇到了一些麻烦!我会很感激帮助,这是在 Python 2.7 中。
【问题讨论】:
-
return语句缩进一级太远,无法始终返回result
标签: python python-2.7 syntax return