Like a string, a list is a sequence of values. In a string, the values are characters; in a list, they can be any type. The values in list are called elements or sometimes items. There are several ways to create a new list; the simplest is to enclose the elements in square brackets ( [ ]):

[10, 20, ‘span’, [30,40]]

A list within another list is said to be nested. A list that contains no elements is called an empty list; you can create one with empty brackets, []. List that contain consecutive integers are common, so Python provides a built-in function to create them:

range takes two arguments and returns a list that contains all the integers from the first to the second, including the first but excluding the second! With one argument, range starts at 0:

If there is a third argument, it specifies the space between successive values, which is called the ‘step size’.

from Thinking in Python

A list is a sequence的更多相关文章

  1. oracle SEQUENCE 创建, 修改,删除

    oracle创建序列化: CREATE SEQUENCE seq_itv_collection            INCREMENT BY 1  -- 每次加几个              STA ...

  2. Oracle数据库自动备份SQL文本:Procedure存储过程,View视图,Function函数,Trigger触发器,Sequence序列号等

    功能:备份存储过程,视图,函数触发器,Sequence序列号等准备工作:--1.创建文件夹 :'E:/OracleBackUp/ProcBack';--文本存放的路径--2.执行:create or ...

  3. DG gap sequence修复一例

    环境:Oracle 11.2.0.4 DG 故障现象: 客户在备库告警日志中发现GAP sequence提示信息: Mon Nov 21 09:53:29 2016 Media Recovery Wa ...

  4. Permutation Sequence

    The set [1,2,3,-,n] contains a total of n! unique permutations. By listing and labeling all of the p ...

  5. [LeetCode] Sequence Reconstruction 序列重建

    Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. Th ...

  6. [LeetCode] Binary Tree Longest Consecutive Sequence 二叉树最长连续序列

    Given a binary tree, find the length of the longest consecutive sequence path. The path refers to an ...

  7. [LeetCode] Verify Preorder Sequence in Binary Search Tree 验证二叉搜索树的先序序列

    Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary ...

  8. [LeetCode] Longest Consecutive Sequence 求最长连续序列

    Given an unsorted array of integers, find the length of the longest consecutive elements sequence. F ...

  9. [LeetCode] Permutation Sequence 序列排序

    The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the p ...

  10. Leetcode 60. Permutation Sequence

    The set [1,2,3,-,n] contains a total of n! unique permutations. By listing and labeling all of the p ...

随机推荐

  1. bzoj3626【LNOI2014】LCA

    3626: [LNOI2014]LCA Time Limit: 10 Sec  Memory Limit: 128 MB Submit: 1266  Solved: 448 [Submit][Stat ...

  2. android 读取xml

    在有些应用中,有一点小数据.直接存储在XML就是.实现较为简单, 1.xml文件放入asset目录.结构如: <?xml version="1.0" encoding=&qu ...

  3. FPGA实现网络通信时的网络字节序问题

    在上位机软件发送字符abcd 在鲨鱼上抓包 用逻辑分析仪从FPGA网络接收管脚分析 数据接收后存储在位宽为8bit的ram中 从ram中读32bitUDP数据为 64636261 依据以上那个现象, ...

  4. ORA-38760: This database instance failed to turn on flashback database

    ORA-38760: This database instance failed to turn on flashback database 问题背景:        測试数据库运行shutdown ...

  5. LeetCode——Copy List with Random Pointer

    A linked list is given such that each node contains an additional random pointer which could point t ...

  6. 1)Win10-UWA开发 UWP应用操作方法、Windows 10应用程序的指南

    孙广东   2015.8.22 全部任务类型(比方在列表中显示数据或创建导航窗格)的说明和代码演示样例. 在这一节 包含例如以下: 主题 描写叙述 Accessibility 创建通用的Windows ...

  7. 闲来无事爬了下通讯录 试手 jsdom

    curl http://xxx.com/address/addresslist\?search\=%40 --cookie oa_cookie=123 -s| node parss .js js 代码 ...

  8. How to Hide Zip Files Inside a Picture Without any Extra Software in Windows

    http://www.howtogeek.com/119365/how-to-hide-zip-files-inside-a-picture-without-any-extra-software/ c ...

  9. Spark技术在京东智能供应链预测的应用——按照业务进行划分,然后利用scikit learn进行单机训练并预测

    3.3 Spark在预测核心层的应用 我们使用Spark SQL和Spark RDD相结合的方式来编写程序,对于一般的数据处理,我们使用Spark的方式与其他无异,但是对于模型训练.预测这些需要调用算 ...

  10. HTML的常用标签属性及使用时需注意的一些细节

    前言 本篇随笔的主要是复习一下常用的一些HTML(Hyper Text Markup Language)标签及其属性,并总结一些使用过程中需要注意的一些细节,本篇提及的常用标签主要有: iframe标 ...