+ 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.
8 Antworten
+ 4
Nice, remember floor division (//) is different than (/)
+ 2
Show us your attempt please
+ 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!
+ 2
Seems fine to me! You might still want to use the 'print()' function to print the value of 'Avg'
+ 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.
0
a=int(input ())
b=int(input ())
c=int(input())
Avg=(a+b+c) //3
0
a=int(input ())
b=int(input ())
c=int(input())
Avg=(a+b+c) //3