Python:面向对象的编程语言,多态,封装,继承三个主要特性
多态:来自希腊语,意味着有多种形式。
>>> from random import choice
>>> x = choice(['Hello,World!',[1,2,'e','e',4]])
>>> x.count('e')
1
任何不知道对象到底是什么类型,但又要对对象做的什么的时候,就要用到多态
>>> 1+2
3
>>> 'hot'+'dog'
'hotdog'
#和下面的形式是一样的
>>> def add(x,y): return...
分类:
编程语言 时间:
2014-09-23 23:54:05
阅读次数:
366
很偶然的机会认识到这个语言,当时在纸上对着它的 "hello world" 程序一个字符一个字符的解释了一遍,惊讶于它的设计思想。到网上查了下,记录下来。 以下是正文 : --------------------------------? Brainfuc...
分类:
编程语言 时间:
2014-09-23 16:36:25
阅读次数:
248
1、下载python,默认安装即可:2、添加C:\Python27(默认安装目录)到path环境变量:3、CMD下测试是否安装成功:4、桌面新建txt文档,修改后缀名为py,右击选择“edit whit IDLE”,用自带的轻量级IDE写一个hello world。下面图示复习了下CMD下面怎样方面...
分类:
编程语言 时间:
2014-09-22 23:42:03
阅读次数:
378
#include #include typedef struct DataNode{ int (*handle)();}tDataNode;int print(){ printf("Hello World!\n"); return 0;}int main(){ int a = 0; tDataNod...
分类:
其他好文 时间:
2014-09-22 20:39:53
阅读次数:
166
本博文主要探讨字符串的相关操作。问题描述:将一篇文本录入,实现查询功能。a):可以输入字符或者字符串,然后将包含他们的单词取出,并打印;(即返回一个容器)b):允许重复;c):如果查询词包含多项,则执行多次查询。例如:“hello world”,则先查询hello,后查询world。本程序待优化之处...
分类:
编程语言 时间:
2014-09-22 02:14:21
阅读次数:
329
通过JS代码输出log信息Js代码Js代码: console.log("Hello World"); Log信息: Console: Hello World http://www.example.com/hello.html :82 在WebChromeClient中实现onConsoleM...
分类:
移动开发 时间:
2014-09-22 01:11:01
阅读次数:
411
"Hello world"作为静态字符串实际上存储在数据区,但写程序的人不知道这个地址,而程序本身知道。当某一函数以{ char p[] = "Hello world"; ...}方式使用此静态字符串时,实际上相当于: char p[12]; strcpy(p, "Hello world"); .....
分类:
其他好文 时间:
2014-09-21 23:45:41
阅读次数:
203
#pip??install??tornado
#cat??web.py
import?tornado.ioloop
import?tornado.web
class?MainHandler(tornado.web.RequestHandler):
????def?get(self):
????????self.write(‘hello,world...
分类:
其他好文 时间:
2014-09-21 22:13:51
阅读次数:
324
#import<Foundation/Foundation.h>
intmain(intargc,constchar*argv[])
{
@autoreleasepool{
NSString*tempStr;
//将要分割的字符串
NSMutableString*mutableString=[[NSMutableStringalloc]initWithString:@"hello,world!nihao"];
//分割字符串的字符集
NSCharacterSe..
分类:
编程语言 时间:
2014-09-21 21:26:32
阅读次数:
250