Try using string format
method:
write("{0}%".format(grades[1]))
문제
So, I'm trying to get the grade to be able to print a percentage sign in the exact same line as to when I write the grade.
The aim is to have it print: 45% for the first example.
from turtle import *
grades = [45, 42, 13, 98, 82]
write(grades[0],'%')
When I run this code both the grade and percentage sign gets printed on top of each other. How do I get the grade and the percentage sign, side by side without the two overlapping?
해결책
Try using string format
method:
write("{0}%".format(grades[1]))