当前位置: 移动技术网 > IT编程>脚本编程>Python > Python Learning: 01

Python Learning: 01

2019年02月08日  | 移动技术网IT编程  | 我要评论

我们小区艺体能神话,213小游戏,宋久林

  after a short period of  new year days, i found life a little boring. so just do something funny--python. before we begin, what we should know first is that python is a dynamic language, which means the type of data of every varieable

  • differences between python2 and python3

    as the version i download is python, which i found something wrong with the studying video, i look through some websites.the first point need paying attention to is the change of function 'print', which can be used as output sentense in p2 while can be used as a function in p3.

  • unicode in python

    if we met " unicodedecodeerror" when coding, add a note line at the first line.

         1 # -*- coding: utf-8 -*- 
  • comparation between list and tuple

list:

1 h=['drunk',1]
2 o=['youth',0]
3 g=[]

tuple:

1 1 h=('drunk',1)
2 2 o=('youth',0)
3 3 g=(('drunk',0),['youth',1])

    the greatest difference between them is the whether can be changed. tuple is determined as long as it is defined, while list can be changed by append(), insert(), pop(). but there is a exception that the list in tuple can alse be changed.

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网