I donโt know how I came across this, and I donโt know what to think about it, but it seems to [] = []be a legal operation in python, therefore [] = '', but '' = []not allowed. It doesn't seem to have any effect, but I wonder: what the hell?
[] = []
[] = ''
'' = []
This is due to Python's multiple purpose (sequence unpacking):
a, b, c = 1, 2, 3
works the same as:
[a, b, c] = 1, 2, 3
Since strings are sequences of characters, you can also do:
a, b, c = "abc" # assign each character to a variable
, , : . , , . ; !
, , Python :
() = () # SyntaxError: can't assign to ()
, Python !
/ python, . .
>>> [a,v] = [2,4] >>> print a 2 >>> print v 4
Source: https://habr.com/ru/post/1655500/More articles:Compilation when the column does not exist - sql-servergzip: stdin: not in gzip tar format: child status returned 1 tar: error is not restored: exit now - linuxNoClassDefFoundError: org / testng / TestNG - javaHow to put text on top of node in scenekit? - iosdplyr :: failwith does not work with lme4 :: lmer, but does with lm - rgit clone with a different username / account - gitHow to send big data on cURL? - phpSimple PHP calculation using an array - arraysSharing Realm Data with WatchOS - iosHow to make a fuzzy connection with fuzzyjoin :: difference_ * in R - rAll Articles