Guest User

Untitled

a guest
Apr 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. # hastables/dictionary
  2. # note a comma (,) after each key-value pair
  3. # and colon (:) between the Key-value pair instead of 'equals to' (=) used in PowerShell
  4. table = {} # empty hashtable
  5. table = dict() # alternative way to create empty hastable
  6.  
  7. # hashtable with integer keys
  8. table = {
  9. 1 : 'one',
  10. 2 : 'two',
  11. 3 : 'three'
  12. }
  13.  
  14. # hashtable is a data stucture that has key-value pair as a element
  15. table = {
  16. 'firstname' : 'prateek', # in powershell single/double quotes around 'string keys' are optional, but not in python
  17. 'lastname' : 'singh'
  18. }
Add Comment
Please, Sign In to add comment