I would like to convert the 3D list into a tuple as shown below, but what should I do?
obj1=[[[1,2],[3,4]],[[5,6],[7,8]]] obj2=(((1,2),(3,4)),((5,6),(7,8))))
Thank you for your cooperation.
obj2=tuple(map(lambdai:tuple(map(tuple,i))),obj1) print(obj2) # (((1, 2), (3, 4)), ((5, 6), (7, 8)))
670 M2 Mac fails to install rbenv install 3.1.3 due to errors
614 PHP ssh2_scp_send fails to send files as intended
608 Who developed the "avformat-59.dll" that comes with FFmpeg?
768 Uncaught (inpromise) Error on Electron: An object could not be cloned
981 /usr/bin/google-chrome:symbol lookup error:/usr/bin/google-chrome: undefined symbol:gbm_bo_get_modifier
© 2025 OneMinuteCode. All rights reserved.