tips about python

  A string can be repeated several times by *:

1 'la' * 3 = 'lalala'

  Codes are divided into blocks by indention, so pay attention to your hands.

  Elseif is replaced by elif.

  A string on the first logical line of a function is the docstring for that function. Note that DocStrings also apply to modules and classes which we will learn about in the respective chapters.

  from module import object 

  You can output a list simply with:

1 list = [1, 2, 3, 4]
2 print(list)

 

posted @ 2017-03-02 17:09  glob  阅读(166)  评论(0编辑  收藏  举报