%s/n | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

%s/n

I'm sorry if this is a stupid question. I'm new at coding. What are these % things? Also why are they /n? It didn't really explain anything about this.

16th Oct 2018, 10:34 PM
Shahzaib Fareed
Shahzaib Fareed - avatar
1 Answer
+ 8
Imagine them to be somewhat "boxes" within a string that can be taken up by what is shown. %s means a "box" for a string %d means a "box" for an integer, and many more examples. These boxes can be of a particulqr size, which is achieved by %10s, %5d, etc. There is more to this but I forgot the exact name.
16th Oct 2018, 11:27 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar