+ 3
Is this a dictionary? (Python)
Hi everyone, I'm a new learner and I have a question. I saw a code like this: s=["%s\n" % x], where x is a string variable. What is the term for s here? Is it a dictionary? But it doesn't have a key and a value.
3 Answers
+ 7
What you see there is a format specifier. It's a pattern that looks a bit like C. You use it when you want to 'insert' a value into a string.
% is the point where the value is to be inserted, s means string.
Read more here:
https://www.learnpython.org/en/String_Formatting
0
Akun Saya diretas diganti password sorry saya uninstall dulu
0
Akun Saya diretas diganti password sorry saya uninstall dulu