1. hash character # starts the comment
2. Division always returns a float.
3. floor division '//' discards the fractional part
'%'
4. power **
5. '_' acts as the 'ans' in matlab
6. single quotes and double quotes is the same
'' ""
\ can be used to escape quotes as is shown bellow
"\"Yes.\" he said."
'"Yes." he said.'
7. You can use raw string by adding an r before the first quote to prevent characters from being interpreted as special characters.
8. String literals can span multiple lines using '''...''' or """...""".
End of lines are automatically included in the string but it’s possible to prevent this by adding a \ at the end of the line.
9.String can be concatenated and repeated
3*"hello"+"world"
10."hel" "llo"="hello"
Note: this only works with two literals though, not with variables or expressions.
+ and * can do some help
11. This feature is particularly useful when you want to break long strings:
12. String can be indexed (subscripted), with the first character have index 0.
13. Python string is immutable.
If you need to change you can just create a new one .
14. List: compound data types. Can be indexed and changed.
a[2:5]=[] this help to delete.
Nest lists is possible.
a=[1,2,3]
b=['a','b','c']
c=[a,b]
c[0][1]=2