Example:
regular_string = "%s %s" % ("foo", "bar") result = {} result["somekey"] = regular_string, print result["somekey"] # ('foo bar',)
Why is result["somekey"]tuple now not a string?
result["somekey"]
Because of the comma at the end of the line.
When you write
result["somekey"] = regular_string,
Python reads
result["somekey"] = (regular_string,)
(x,)is the syntax of a single-element tuple. Brackets are assumed. And you really insert a tuple instead of a string.
(x,)
Source: https://habr.com/ru/post/1712393/More articles:Using generics for arrays - javaJava GUI design consultation - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1712390/update-desktop-show-window-contents-while-dragging-setting-programatically&usg=ALkJrhj5bq244J1mETnn-nt_VqnCj2nurAΠ Π΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎΠ³ΠΎ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΡ - Π²ΡΠΏΡΡΠΊ/ΠΌΠΎΠ΄ΡΠ»Ρ/ΠΎΡΠΈΠ±ΠΊΠ°/ΠΎΡΡΠ»Π΅ΠΆΠΈΠ²Π°Π½ΠΈΠ΅ ΡΡΠ½ΠΊΡΠΈΠΉ - designTesting Nested Error Handling with OCMock - objective-cMechanical Turk File Download - amazonPHP - search for domain name availability - phpΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° Nibernate Icriteria Enum (Π±ΠΈΡΠΌΠ°ΡΠΊ) - nhibernateRich Edit / Word Processing Control for IntraWeb (Delphi VCL for the web)? - asp.netDoes Visual Studio Runner support other framework support? - unit-testingAll Articles