Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python tipi array

1) lista: è elenco ordinato di oggetti 'come php array numerico'
  a=[1,2,3]
  dir(a) ritorna i metodi: a.append("test")
2) tupla: è un elenco immutabile
  t= ("1","2",3,4,5)
  pro: speed + less memory consuming
3) set: è un insieme
  operazioni insiemistiche(unione con '|' o '.union', differenza '-',
                           intersezione '&'), elimina i duplicati
  s=set(["a","b","c"])
  s2=set(["d","c"])
  s3_intersection=s & s2 
  s4_union= s | s2
  s5_diff= s-s2
  print(s3_intersection) {"c"}       'quelli in comune'
  print(s4_union) {"a","b","d","c"}  'tutti no dupl'
  print(s5_diff) {"a","b","d"}
 4) Dizionario 'ricorda 1 json o array definito di php'
  people = {'George':35, 'Alex':3, 'Emma':32)
  print(people['Alex'])   res:3
  print(people.keys())    res: 'George', 'Alex', 'Emma'
Comment

PREVIOUS NEXT
Code Example
Python :: get hwid python 
Python :: OneID flask 
Python :: python check if character before character in alphabet 
Python :: element not found selenium stackoverflow 
Python :: add a dot in a long number in python 
Python :: list to tensor 
Python :: python numpy reverse an array 
Python :: mish activation function tensorflow 
Python :: factorise expression python 
Python :: seasonal_decompose python 
Python :: row names pandas 
Python :: matplotlib remove y axis label 
Python :: dataframe describe in pandas problems 
Python :: ROLL D6 
Python :: python turtle window not responding 
Python :: order dataframe by multiple columns python 
Python :: Select rows from a DataFrame based on column values? 
Python :: python tkinter filedialog 
Python :: polynomial features random forest classifier 
Python :: pygame change icon 
Python :: how to add headers in csv file using python 
Python :: how to split a string in python with multiple delimiters 
Python :: mean class accuracy sklearn 
Python :: check all python versions ubuntu 
Python :: python command not found 
Python :: python histogram as a dictionary 
Python :: how to add a number to a variable in django template 
Python :: python tkinter delete label 
Python :: np range data 
Python :: python how to sort by date 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =