我有一个要求看电影的小应用程序。当评分超过 50 时,返回观看。如果没有,请选择另一部电影。虽然当我到达movieDec中的条件时,它不会回到函数的顶部来计算电影的分数。想不通这个
def getScore():
choose = raw_input("pick a movie ")
rt = RT()
info = rt.search(choose)
rating1 = info[0].get('ratings').get('critics_score')
rating2 = info[0].get('ratings').get('audience_score')
stars = (rating1 + rating2) / 2
return rating1, rating2, stars
def movieDec():
critic, aud, stars = getScore()
print 'Critics gave it a %s' %critic
print 'Audiences gave it a %s' %aud
print 'The average rating is %s' %stars
while stars < 50:
print "That's no good, pick again"
getScore()
print 'Good choice.'