pyton 程序内容的颠倒,运用 [](列表)

def reverse_string(s):
"""Returns the reversal of the given string."""
result = ""
for char in s:
result = char + result
return result print reverse_string("hello")

输出的效果是: “olleh”

pyton 实现斐波那契数列

import math
a = [0, 1]
for i in range(1,41):
a.append(a[-1] + a[-2])
print a




Week 5a - Mouse input and more lists----learning notes的更多相关文章

  1. Week 5a - Mouse input and more lists ----mouse input

    <span style="font-size:14px;">import simplegui import math # global variables ball_p ...

  2. Rust learning notes

    Rust learning notes Rust Version 1.42.0 $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs ...

  3. rt-thread learning notes

    rt-thread learning notes 2018-01-15 > 001 具有相同优先级的线程,每个线程的时间片大小都可以在初始化或创建该线程时指定 rt_thread_t rt_th ...

  4. Mybatis Learning Notes 1

    Mybatis Learning Notes 主要的参考是博客园竹山一叶的Blog,这里记录的是自己补充的内容 实体类属性名和数据库不一致的处理 如果是实体类的结果和真正的数据库的column的名称不 ...

  5. OSCP Learning Notes - Privilege Escalation

    Privilege Escalation Download the Basic-pentesting vitualmation from the following website: https:// ...

  6. Coursera, Machine Learning, notes

      Basic theory (i) Supervised learning (parametric/non-parametric algorithms, support vector machine ...

  7. 【Learning Notes】线性链条件随机场(CRF)原理及实现

    1. 概述条件随机场(Conditional Random Field, CRF)是概率图模型(Probabilistic Graphical Model)与区分性分类( Discriminative ...

  8. Node.js Learning Notes

    简介 简单的说 Node.js 就是运行在服务端的 JavaScript. Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台. Node.js是一个事件驱动I/O服务 ...

  9. Apache Thrift Learning Notes

    简介 Apache Thrift软件框架(用于可扩展的跨语言服务开发)将软件堆栈与代码生成引擎结合在一起,以构建可在C ++,Java,Python,PHP,Ruby,Erlang,Perl,Hask ...

随机推荐

  1. 数组序列的capacity及size函数

    #include<iostream>#include<vector>using namespace std;int main(){    vector<int> i ...

  2. underscore api 概览

    underscore 集合函数(数组或对象) _.each(list, iteratee, [context]); _.map(list, iteratee, [context]); _.reduce ...

  3. BZOJ 4259 残缺的字符串(FFT)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=4259 [题目大意] 给出两个包含*和小写字母的字符串,*为适配符,可以和任何字符匹配, ...

  4. 套接字socket 的地址族和类型、工作原理、创建过程

    注:本分类下文章大多整理自<深入分析linux内核源代码>一书,另有参考其他一些资料如<linux内核完全剖析>.<linux c 编程一站式学习>等,只是为了更好 ...

  5. iOS开发-Protocol协议及委托代理(Delegate)传值

    前言:因为Object-C是不支持多继承的,所以很多时候都是用Protocol(协议)来代替.Protocol(协议)只能定义公用的一套接口,但不能提供具体的实现方法.也就是说,它只告诉你要做什么,但 ...

  6. android http同步请求

    1.界面 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:too ...

  7. git学习基础教程

    分享一个git学习基础教程 http://pan.baidu.com/s/1o6ugkGE 具体在网盘里面的内容..需要的学习可以直接下.

  8. C/C++ 结构体成员在内存中的对齐规则

    这几天在看王艳平的<windows 程序设计>,第5章讲解了MFC框架是怎么管理窗口句柄到窗口实例之间的映射,用到了两个类CPlex和CMapPtrToPtr,用于管理内存分配的类(避免因 ...

  9. Append和AppendTo

    Append和AppendTo Append向标签中追加内容 AppendTo把所有匹配的元素追加到元素集合中

  10. [LeetCode]题解(python):080-Remove Duplicates from Sorted Array II

    题目来源: https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/ 题意分析: 跟定一个排好序的数组.修改这个数组使 ...