#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apa
一.字符串的表示和存储 字符串是字符的序列,每个字符都有有一个数字作为标识,同时会有一个将标识转换为存储字节的编码方案: s = 'hello world python' for c in s: print(c, end=' ') h e l l o w o r l d p y t h o n ACSII为协议内的每个字符分别对应一个数字,然后以这个数字的二进制形式存储到计算机; s = 'hello world python' for c in s: num = ord(c) print(nu