Fügen Sie das prozentuale Zeichen für String Python hinzu
percent = 12
print "Percentage: %s %%\n" % percent # Note the double % sign
>>> Percentage: 12 %
Cheerful Cow
percent = 12
print "Percentage: %s %%\n" % percent # Note the double % sign
>>> Percentage: 12 %
val = "The percentage is 95.68"
print("{}%".format(val))
val = "The percentage is 95.68"
print(f"{val}%")