Sunday, March 3, 2019

Maximum, Minimum & Average using user define function - Python3

def score_summary(name,score1,score2,score3):
        print('Name: '+name+
              '\nMax: '+str(max(score1,score2,score3))+
              '\nMin: '+str(min(score1,score2,score3))+
              '\nAvg: '+str((score1+score2+score3)/3))
        
name = input('Enter name of person: ')
score1 = float(input('Enter score 1: '))
score2 = float(input('Enter score 2: '))
score3 = float(input('Enter score 3: '))
score_summary(name,score1,score2,score3)




No comments:

Post a Comment