`
huangyiiiiii
  • 浏览: 119443 次
  • 性别: Icon_minigender_1
最近访客 更多访客>>
社区版块
存档分类
最新评论

a python tutorial

阅读更多
A Very Brief Introduction To Python And It's Data-Types

一篇短小精悍的 python tutorial 。对一些容易被忽视的问题讲得很清楚!很专业的 tutorial!摘录片段如下:
  • The Python 'philosophy' emphasises readability, clarity and simplicity, whilst maximising the power and expressiveness available to the programmer.
    看到这句话我不自觉地就想起了c++:“The c++ 'philosophy' emphasises performance, performance and performance, whilst maximising the power and expressiveness available to the programmer” ;-) 它们在各自的领域都做得很不错。
  • The line of code x = 3 is a statement (more about that in a bit) which means it does a job. The job it does is to assign the value 3 to the variable 'x'. In Python terminology we say that it binds the name 'x' to the number three. This idea of variables being names bound to objects (or names which 'reference' objects) is important in Python.
  • 'Under the hood' Python actually uses two types of integer, the integer and the 'long integer' for integers bigger than a certain amount.
  • If you need to a lot of complicated maths with floating point numbers, then you may be interested in extensions like numpy or General Multiprecision Python project. These extensions provide very fast ways of doing mathematical operations. For normal use the capabilities built in to Python will be sufficient.
  • The name 'string' probably comes from the fact that programming languages often treat text as a sequence of characters 'stringed' together.
  • The basic string type (which I have called 'normal strings' below) store the text as a sequence of bytes (numbers) with one byte per character. .... They can also be used for storing binary data in.
  • Unicode strings store text internally using the unicode standard. They are slightly more complicated, because you must know the 'encoding' the text is stored in whenever you read the text in or save it out. In the long run this can save a great deal of confusion.
  • Because the interpreter knows the length and types of the members of a tuple, working with them can be more efficient than using a list.
  • Dictionaries are an extremely useful and flexible datatype. In fact Python is built on them. Smile
  • Programs are actually compiled to byte-code before being executed, but the byte-code is then interpreted. In some ways this is similar to Java or .NET which also compile to byte-code. Because these languages are statically typed with JIT compiler, they are generally considered as compiled languages whilst Python is generally considered as being interpreted.
分享到:
评论

相关推荐

    Python3.7 Tutorial mobi

    a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid ...

    Python Tutorial入门指南

    英文版的Python Tutorial的翻译版 8 Classes 类 8.1 A Word About Terminology 8.2 Python Scopes and Name Spaces 8.3 A First Look at Classes 8.4 Random Remarks 8.5 Inheritance 8.6 Private Variables ...

    Python SSL Tutorial

    Python is an interpreted language that has become popular with many programmers and ...Read more: Python SSL Tutorial | eHow.com http://www.ehow.com/how_7552729_python-ssl-tutorial.html#ixzz1hH81k1Pc

    Python入门 PythonTutorial

    - **Using Python as a Calculator**:利用Python作为计算器进行基本数学运算。 - **First Steps Towards Programming**: - **变量与数据类型**:介绍Python中的基本数据类型(如整型、浮点型、字符串等)以及变量...

    Python 2.7 Tutorial 中文版.zip

    - **读写模式**:包括读('r')、写('w')、追加('a')等模式。 - **文件操作函数**:read(), readline(), readlines(), write(), seek()等。 7. **正则表达式** Python的re模块提供了正则表达式的支持,可...

    Python Tutorial 入门指南3.6英文版

    The Python Tutorial 1 1. Whetting Your Appetite 4 2. Using the Python Interpreter 6 2.1. Invoking the Interpreter 7 2.1.1. Argument Passing 8 2.1.2. Interactive Mode 8 2.2. The Interpreter and Its ...

    cosc363.zip_python tutorial

    这个“Python tutorial”来源于新西兰坎特伯雷大学,旨在为初学者提供一个全面的学习路径,涵盖了Python的基础知识到进阶技巧。 一、Python基础知识 在Python编程的初始阶段,我们将学习变量、数据类型和控制结构。...

    python-3.6.1 Tutorial

    - **Using Python as a Calculator(将Python用作计算器)** - 展示如何利用Python进行基本的数学计算。 - 涉及加减乘除、幂运算等操作。 - **First Steps Towards Programming(编程第一步)** - 介绍变量、数据...

    Hands-On Python A Tutorial Introduction for Beginners Python 3.1 Version

    Hands-On Python A Tutorial Introduction for Beginners. Python 3.1 Version. Computer Science Department, Loyola University Chicago

    A Complete Tutorial on Tree Based Modeling from Scratch (in R——& Python)

    通过一个实例代码完全描述了决策树的构造过程。具有很好的学习和借鉴意义。(PDF文档)

    Python Tutorial

    ### Python入门教程:从“Hello, World!”到高级特性 #### 概述 Python是一种流行的、易学且功能强大的编程语言。它不仅适用于文本处理,还广泛用于数据分析、Web开发、自动化脚本编写以及人工智能等领域。本文将...

    Python Tutorial 2.7 [官方文档]

    - **作为计算器使用(Using Python as a Calculator)**:展示Python如何用于基本的数学运算,包括加减乘除、指数运算等,帮助理解数据类型和运算符。 - **迈向编程的第一步(First Steps Towards Programming)**:介绍...

    python3.4 tutorial指导手册英文版

    ##### 3.1 使用 Python 作为计算器 (Using Python as a Calculator) - **基本运算**:介绍 Python 支持的基本数学运算符,包括加减乘除、取模、指数等。 - **内置函数**:列举一些常用的内置数学函数,如 abs()、...

    Tutorial on Python Curses Programming

    ### Python Curses编程教程知识点概览 #### 一、概述 **1.1 功能** 在许多常用的程序中,为了实现高效的人机交互,需要利用终端的光标移动能力。例如,`vi` 编辑器中的大多数命令都依赖于这种能力:按下 `j` 键...

    Fluent Python 原版pdf by Ramalho

    of the official Python Tutorial. That is true, but there is a catch: because the language is easy to learn and put to use, many practicing Python programmers leverage only a fraction of its powerful ...

    python-tutorial.pdf

    一个Python标识符以字母A-Z或a-z或下划线(_)开头,后面可以跟零个或多个字母、数字和下划线。Python不允许在标识符中使用诸如@、$、%等标点字符。理解这些基础知识点后,学习者可以进一步深入Python编程语言,探索其...

    python基础入门(超详细).pdf

    Python是一种高级编程语言,以其简洁明了的语法和强大的功能深受初学者和专业人士的喜爱。以下是一些关于Python基础入门的知识点: 1. **Input和Output**:`input()` 函数用于从用户那里获取输入,例如在例子中用来...

Global site tag (gtag.js) - Google Analytics