I am trying to get a clean percentage from this line of code. For example, 50.00% or 61.37%. From this line, I am getting 5000.00% and so on. I have an idea that it has to do with how I am using format, but I'm not sure how it is doing this. I tried using int and got the desired number, just without the .00 and the % sign.
class_males = float(input('Please enter the number of male students registered:')) #Asks for user input of males
class_females = float(input('Please enter the number of female students registered:'))#Asks for user input of females
class_total = int(class_males) + int(class_females) #class total by combining user inputs
m_perc = int(class_males)/int(class_total)* 100 #divide user input of males by class total then multiply by 100 for %
f_perc = int(class_females)/int(class_total)* 100 #divide user input of females by class total then multiply by 100 for %
male_perc = "{:.2%}".format(m_perc) #adds "%" sign after number total
female_perc = "{:.2%}".format(f_perc) #adds "%" sign after number total
print('Percentage of males registered:', (male_perc)) #display percent of males
print('Percentage of females registered:',(female_perc)) #display percent of females
If it isn't already clear, I am a beginner. Thank you for any help provided.