Please solve this | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please solve this

Write a program to input marks of three tests of a student (all integers). Then calculate and print the average of all test marks.

14th May 2020, 7:05 PM
Satyam Patel
Satyam Patel - avatar
7 Answers
+ 4
Nice, remember floor division (//) is different than (/)
14th May 2020, 7:13 PM
Slick
Slick - avatar
+ 2
Show us your attempt please
14th May 2020, 7:08 PM
Slick
Slick - avatar
+ 2
The reading of the marks you can do using the 'input()' function in python (and using the 'int()' function you can convert the user input to integers). Calculating the average is simple: add the three marks and divide that answer by three. Good luck!
14th May 2020, 7:10 PM
DeX97
+ 2
Seems fine to me! You might still want to use the 'print()' function to print the value of 'Avg'
14th May 2020, 7:12 PM
DeX97
+ 2
x=int(input("enter mark of first student ") y=int(input("enter mark of second student") z=int(input ("enter mark of third student") Avg=(x+y+z) //3 print (f" Average is {Avg}") ----->here // is float division.
16th May 2020, 3:49 PM
ROHIT KUMAR
ROHIT KUMAR - avatar
0
a=int(input ()) b=int(input ()) c=int(input()) Avg=(a+b+c) //3
14th May 2020, 7:11 PM
Satyam Patel
Satyam Patel - avatar
0
a=int(input ()) b=int(input ()) c=int(input()) Avg=(a+b+c) //3
15th May 2020, 11:34 PM
Alá Daqamseh
Alá Daqamseh - avatar