- 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
6 Respuestas
+ 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))
+ 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)
0
both code is not running please pravoid correct answer
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)
- 1
Is this correct
- 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)