• Python Learning: 01


      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 H=('drunk',1)
    2 O=('Youth',0)
    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.

         To be continued.

    When you return with glory, you will be bathed in the golden rain.
  • 相关阅读:
    七、python抽象
    六、python条件、循环及其它语句
    泛型数组
    判断数组是否包含此元素
    数组倒序
    Class字节码文件获取的三种方法
    操作系统的产生
    Java重载的概述
    表设计遵循的三大范式实例
    pyqt5窗体分隔
  • 原文地址:https://www.cnblogs.com/DrunkYouth/p/10355751.html
Copyright © 2020-2023  润新知