Differences

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

Link to this comparison view

Next revision
Previous revision
lfa:2023:lab01 [2023/09/30 15:38]
tpruteanu created
lfa:2023:lab01 [2024/10/06 21:29] (current)
stefan.sterea old revision restored (2023/10/08 15:08)
Line 152: Line 152:
 # set constructed from a list: # set constructed from a list:
 s = set([1,​2,​3]) s = set([1,​2,​3])
 +
 +# normal set construction (you cannot use {} to create an empty set as that would create an empty dict)
 +s = {1,2,3}
  
 # adding a new element to the set: # adding a new element to the set:
Line 157: Line 160:
 </​code>​ </​code>​
  
-==== Tuples ====+==== Tuples === 
 +=
  
 Tuples are very similar to lists and can be substituted by the latter in many cases: Tuples are very similar to lists and can be substituted by the latter in many cases: