How can you do the following code?
example = "%%(test)%" % {'test':'name',} print example
If the desired result is: "% name%"
thanks
An alternative is to use the new Advanced String Formatting
>>> example = "%{test}%".format(test="name") >>> print example %name%
example = "%%%(test)s%%" % {'test':'name',} print example
%(key)sis a placeholder for the string identified key. %%performs %when using an operator %.
%(key)s
key
%%
%
Source: https://habr.com/ru/post/1721166/More articles:Why SIGSEGV? - cUse Enum as parameter in Windsor configuration file - .netHow are these two lines of PHP different? - phphttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1721164/how-can-i-install-a-gadget-to-a-users-desktop-programmatically&usg=ALkJrhixC0MVkWIfjmwf1C9EZbL1TT6fqQHow to install AutoCompleteExtender to allow only values ββfrom the autocomplete list? - .netJavascript to close IE6, IE7, IE8 and Firefox without confirmation? - javascriptHow to add a double-click event on a table row using JavaScript? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1721169/what-shall-i-use-vbnet-or-c-for-desktop-application&usg=ALkJrhgEjnY1LYH8NlExGtJKMJ7Wneno1Aonkeydown keycode javascript element - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1721171/sending-emails-to-multiple-recipients-best-practices&usg=ALkJrhidy3dSMxDPI6FbcFnYdmTA-GX7QgAll Articles