my actual problem is student pass rate … output student pass rate shld be 66.7% but i got 0.666666…
0.66666… is the unrounded decimal form of 66.7%. Your answer is correct, you just need to convert it to percentage.
how i cant convert it
I don’t know if you are overthinking or underthinking - that’s something you have to figure out.
Either way, to get from 0.66 to 66 you multiply by 100.
To put a “%” at the end you can literally just print that. If you want to turn it into a string first, turn the number into a string and add the “%”.
im a beginner who completed core python a week ago so i cant determine the logic
thanks for the logic
and again there is no use to add % after converting num into string hence at last the crct output is nt getting
print( str(num) + “%”)
*spr = ((HD+D+C+P+SP)/len(l))100
use variable in if condition to count HD,D,C,P,SP. initiate with zero then get incremented by 1 each time the values come under any of these grades.
your program is not counting a number of times HD, D etc get repeated. focus on that