You can make use of the reversed function for this as:

>>> array=[0,10,20,40]
>>> for i in reversed(array):
... print(i)

Note that reversed(...) does not return a list. You can get a reversed list using list(reversed(array)).

list reverse的更多相关文章

  1. LeetCode 7. Reverse Integer

    Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you ...

  2. js sort() reverse()

    数组中存在的两个方法:sort()和reverse() 直接用sort(),如下: ,,,,,,,,,,,]; console.log(array.sort());ps:[0, 1, 2, 2, 29 ...

  3. [LeetCode] Reverse Vowels of a String 翻转字符串中的元音字母

    Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Giv ...

  4. [LeetCode] Reverse String 翻转字符串

    Write a function that takes a string as input and returns the string reversed. Example: Given s = &q ...

  5. [LeetCode] Reverse Linked List 倒置链表

    Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either i ...

  6. [LeetCode] Reverse Bits 翻转位

    Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in ...

  7. [LeetCode] Reverse Words in a String II 翻转字符串中的单词之二

    Given an input string, reverse the string word by word. A word is defined as a sequence of non-space ...

  8. [LeetCode] Reverse Words in a String 翻转字符串中的单词

    Given an input string, reverse the string word by word. For example, Given s = "the sky is blue ...

  9. [LeetCode] Evaluate Reverse Polish Notation 计算逆波兰表达式

    Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, ...

  10. [LeetCode] Reverse Linked List II 倒置链表之二

    Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1-> ...

随机推荐

  1. 解决element-ui表头错位的问题

    经过测试得出: 使用element-ui的表格,并在table中设置固定height会出现表头错位的现象(不知道是什么bug) 解决方案: 将height改为max-height,设置固定高度为最大高 ...

  2. pickle序列化一个函数,将fun()存入文件

  3. ajaxfileupload 上传使用demo

    1.添加js引用 <script src="JS/jquery-1.4.2.min.js" type="text/javascript"></ ...

  4. Java内功修炼系列一工厂模式

    工厂模式是一种创建型模式,它提供了一种新的创建对象的方式,一般情况下我们都习惯用new关键字直接创建对象.有时候会遇到这种情况,我们需要根据具体的场景选择创建什么类型的对象,可能有多种类型都能选择,但 ...

  5. PAT甲级——A1037 Magic Coupon

    The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, m ...

  6. Jmeter设置中文汉化

    下载汉化包logkit-2.0.jar 将汉化包copy至 jmeter文件的lib目录下 打开Jmeter软件,设置汉化包 Options  ->  ChooseLanguage  -> ...

  7. Chapter 1 线性表

    Preface: 这部分主要是我考研之前的总结,留作以后用到时再翻出来看看.都是基础的知识点,望各(Da)位(Lao)不喜勿喷,欢迎指正. 适用人群:考研复习过一遍数据结构的,可以看看,查漏补缺(顺便 ...

  8. tensorflow 利用python generate_cifar10_tfrecords.py --data-dir=${PWD}/cifar-10-data报错

    报的错误如下:UnicodeDecodeError: 'ascii' codec can't decode byte 0x9e in position 0: ordinal not in range( ...

  9. 新的开始 | Arthas GitHub Star 破万后的回顾和展望

    一切新的开始,都始于一个里程碑. 2月20日上午,Java 开源诊断工具 Arthas 的 GitHub Star 突破10000,距离开源后的第一个Release 版发布仅 147 天. 从中,我们 ...

  10. windows 和 mac 文件夹共享问题汇总

    目标:windows上的文件夹,共享给MAC,mac可以将文件复制到windows上来 windows设置共享文件夹,然后在mac上访问 假设win的ip地址是10.10.27.11,则mac上远程方 ...