Python Notes-data types
Http://www.runoob.com/python/python-tutorial.html rookie tutorial
1. Number, which can be defined directly, a = 18
two。 String, a = 'helloworld'
Operations that can be performed in a sequence include indexing, slicing, adding, multiplying, and checking members.
3. List, list = [1, 2, 2, 3, 4, 4, parentheses
4. Tuple, the element of tuple cannot be modified, tup = ('aaa',1,2,3,'ddd'), parentheses indicate
5. Dictionary, key-value pair, d = {key1: value1, key2: value2}, the key is unique
Curly braces
String manipulation:
Var1 = 'Hello Worldwide'
Var2 = "Python Runoob"
Print "var1 [0]:", var1 [0] # take values according to subscript
Print "var2 [1:5]:", var2 [1:5] # intercepts several values
Output result:
Var1 [0]: H
Var2 [1:5]: ytho