- 8

Write a python program to find best of two test average marks out of three test marks accepted

Can anyone help me how to write this program

14th Mar 2019, 4:03 PM
SD Justin
SD Justin - avatar
6 Antworten
+ 2
inp = input("Enter marks separated by space ") marks = inp.split() avg1 =(marks[0]+marks[1])/2 avg2 = (marks[1]+marks[2])/2 avg3 = (marks[0]+marks[2])/2 print (max(avg1, avg2, avg3))
1st Jul 2019, 7:02 AM
Leander Leo Lagardo
Leander Leo Lagardo - avatar
+ 1
a=10#a=int(input("enter test 1 marks")) b=15#a=int(input("enter test 2 marks")) c=35#a=int(input("enter test 3 marks")) def avg(a,b): return (a+b)/2 ab=avg(a,b) bc=avg(b,c) ca=avg(c,a) big=max(ab,bc,ca) if big==ab: print ("ab=",big) elif big==bc: print("bc=",big) else : print("ca=",big)
7th Mar 2020, 6:22 PM
Mohammed Muzammil Khan
Mohammed Muzammil Khan - avatar
0
both code is not running please pravoid correct answer
25th Feb 2020, 4:36 PM
Sameer Khan
Sameer Khan - avatar
0
a = float(input("Enter Marks of 1st Subject: ")) b = float(input("Enter Marks of 2nd Subject: ")) c = float(input("Enter Marks of 3rd Subject: ")) ab = (a+b)/2.0 bc = (b+c)/2.0 ca = (a+c)/2.0 print("Best of two test average marks: ") if( ab>bc and ab>ca ): print(ab) if( bc>ab and bc>ca ): print(bc) if( ca>bc and ca>ab ): print(ca)
17th Jan 2021, 9:12 AM
Vivek Gupta
Vivek Gupta - avatar
- 1
Is this correct
22nd Jun 2019, 5:59 AM
shivakumar ts
shivakumar ts - avatar
- 4
Import math n1=int(input('enter a number)) n2=int(input('enter 2nd number)) n3=int(input('enter the 3rd number)) avg=(n1+n2)/(n1+n2+n3) Print(avg)
28th Apr 2019, 6:36 PM
Ashutosh Dash
Ashutosh Dash - avatar