Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ii:labs:02:tasks:01 [2021/11/07 23:13]
radu.mantu
ii:labs:02:tasks:01 [2024/10/25 01:48] (current)
radu.mantu
Line 154: Line 154:
 ...     "​and his comrades would chuckle at the sheer treason of it." ...     "​and his comrades would chuckle at the sheer treason of it."
  
->>>​ the length of the string can be obtained using len()+>>> ​the length of the string can be obtained using len()
 >>>​ len(s) >>>​ len(s)
 230 230
Line 325: Line 325:
 >>>​ list(t) >>>​ list(t)
 ['​pi',​ 3.1415, True] ['​pi',​ 3.1415, True]
->>>​ list(t) + [ '​e',​ .5772, True ] +>>>​ list(t) + [ '​e', ​2.7182, True ] 
-['​pi',​ 3.1415, True, '​e', ​0.5772, True]+['​pi',​ 3.1415, True, '​e', ​2.7182, True]
  
 >>>​ # similarly, a tuple can be generated from a list >>>​ # similarly, a tuple can be generated from a list
->>>​ tuple(list(t) + [ '​e',​ .5772, True ]) +>>>​ tuple(list(t) + [ '​e', ​2.7182, True ]) 
-('​pi',​ 3.1415, True, '​e', ​0.5772, True)+('​pi',​ 3.1415, True, '​e', ​2.7182, True)
  
 >>>​ # tuples can be used as a shortcut to assign multiple values at once >>>​ # tuples can be used as a shortcut to assign multiple values at once
ii/labs/02/tasks/01.1636319586.txt.gz · Last modified: 2021/11/07 23:13 by radu.mantu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0