Hello, I was following a video lesson in Python string formatting and I saw that the teacher used% d and%, but my internet is having problems loading the video, I wanted to know what that means%
Hello, I was following a video lesson in Python string formatting and I saw that the teacher used% d and%, but my internet is having problems loading the video, I wanted to know what that means%
As stated,% is for formatting.
>>> "Uso do percent %d" % 30
The first % d marks that at this point there is a placeholder to replace with a decimal (to be informed in the future).
The second% effectively performs the substitution by the right values.