+ 2
What does the % sign do in python
I understand that if you say something like this print(26%5) the output would be 1 because it does the remainder. But all too often I see it used for something else and I'm clueless as of what it means. Like people use it like this sometimes print(%s + "Something else") I don't even know if the syntax was correct there.
1 Réponse
+ 9
In that case that is "format form"
in this code %s will be replaced by inp value
inp=str(input())
print("%s,man"%inp)