I have written a code using which I have to duplicate a statement 100 times. In that, the variable "degrees" has to be iterated by 3.6. Instead of getting a decimal number with 1 decimal digit, I get something like this:
95%{background-color: linear-gradient(342.0000000000002deg, red, blue)}
96%{background-color: linear-gradient(345.60000000000025deg, red, blue)}
97%{background-color: linear-gradient(349.2000000000003deg, red, blue)}
98%{background-color: linear-gradient(352.8000000000003deg, red, blue)}
Here is my code:
degrees = 0
percent = 0
for i in range(101):
print(str(percent) + "%{background-color: linear-gradient(" + str(degrees) + "deg, red, blue)}")
percent += 1
degrees += 3.6
I want the code to return the result with one decimal point.