From de9cc265e4aa3df3e75bc5920c9ad7e26ebdc929 Mon Sep 17 00:00:00 2001 From: hex-plex <56990337+hex-plex@users.noreply.github.com> Date: Mon, 28 Oct 2019 10:43:53 +0530 Subject: [PATCH] its just to make a general case for any list just to make a general callable function using rguements --- Find Max/16123004.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Find Max/16123004.py b/Find Max/16123004.py index 7e98aef..044596a 100644 --- a/Find Max/16123004.py +++ b/Find Max/16123004.py @@ -1,12 +1,9 @@ -l = [ 2,3,4,5,6,8] - -n = len(l) -curr_max = 0 -for i in n: - # TODO Fill Code here - if l[i] > curr_max: - curr_max = l[i] +def maximum(*a): + ma=a[0] + for i in a: + if(i>ma):ma=i + print("the maximum value is "+str(ma)) + -print("Max element is ", curr_max) - - +maximum(1,6,7,2,9) +maximum(4,0,8,2,9)