# -*- coding: utf-8 -*- """ When main() is run, it should find whether these people have approval to go the ball. If not, they will be given a reason This functions has 3 inputs, the year level, whether they have paid and their attendance rate. Returns True if the student can go to the ball. Conditions are: They are Y11+ They have paid Their attendance is over 80% Otherwise: They can't go! Also return the reason why they can not go. (Return the statement properly) """ def main(): reason = ball_approval(9,False,100) print(ball_approval(12,True,90)) print(ball_approval(10,False,35)) print(ball_approval(12,True,85)) print(ball_approval(12,False,90)) print(ball_approval(13,True,25)) print(ball_approval(11,False,65)) print(ball_approval(11,True,75)) def ball_approval(year, has_paid, attendance_rate): reason = [] if(year<11): reason.append("You are not a senior!") if(has_paid == False): reason.append("You have not paid!") if(attendance_rate < 80): reason.append("You have not attended enough!") if(year>10 and has_paid == True and attendance_rate >= 80): reason.append("You can go!") return reason