Percentage of passing students Module 5.2 15


#1

The question is to find the percentage of student who passed, after almost one hour going back and forth with this, I cannot foresee the solution arriving anytime soon… can someone please explain?

Editor
total_students = int(input(“How many students are in the class?”))
passing_students = int(input(“How many students passed this test?”))

def find_percentage():
percentage = passing_students / total_students

percentage = int(find_percentage() * 100)
print("The percentage of students who passed is " + str(percentage) + “%”)

Shell
How many students are in the class?36
How many students passed this test?9
Traceback (most recent call last):
File “main.py”, line 7, in
percentage = int(find_percentage() * 100)
TypeError: unsupported operand type(s) for *: ‘NoneType’ and ‘int’


#2

found it… :grin: just took longer to look at it