Python data types

type()

1)Number

  • int
  • long
  • float
  • complex

2) String (string)

  • str() value function

3) List (list)

  • List =['apple', 'alligator', 'gibbon', 'salamander']   /  print (list[2:])

4) Tuple (tuple) -- similar to list, read-only

5) Dictionary (dictionary) -- the elements in the dictionary are accessed by keys, not by offset access. Dictionaries are identified with "{ }". A dictionary consists of an index (key) and its corresponding value value

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325230121&siteId=291194637