Ada yang tau code untuk persentase di phyton?
Jawaban:
Phyton Kode
print" Welcome to NLC Boys Hr. Sec. School "
a=input("nEnter the Tamil marks :")
b=input("nEnter the English marks :")
c=input("nEnter the Maths marks :")
d=input("nEnter the Science marks :")
e=input("nEnter the Social science marks :")
tota=a+b+c+d+e
print"Total is: ", tota
per=float(tota)*(100/500)
print "Percentage is: ",per
Hasil:
Welcome to NLC Boys Hr. Sec. School
Enter the Tamil marks :78
Enter the English marks :98
Enter the Maths marks :56
Enter the Science marks :65
Enter the Social science marks :78 Total is: 375 Percentage is: 0.0