posts - 195,  comments - 30,  trackbacks - 0
Python  “” ‘’ 都可以表示字符串 

s1 = "hello,world" 
如果要写成多行,那么就要使用/ (“连行符”)吧,如 
s2 = "hello,/ 
world" 
s2与s1是一样的。如果你用3个双引号的话,就可以直接写了,如下: 
s3 = """hello, 
world, 
hahaha.""",那么s3实际上就是"hello,/nworld,/nhahaha.", 注意“/n”

s5 = "Let's go"  
s4 = 'Let/'s go' 

我们也可以把'''  ''' 作为多行注释

str(object) 可以将所有转化为字符串。


pythonjava描述
or||逻辑或
and&&逻辑与
not逻辑非
<,>,<=,>=,==,!=或<><,>,<=,>=,==,!=比较操作
is,is notinstanceof身份认证
||位或
&&位与
^^位异或
<<,>><<,>>移位
+,-,*,/+,-,*,/加减乘除
%%余数
~~位取补


//运算符  
10/3==3
120//10==12
121//10==12
122//10==12
130//10==13
10//3.0==3.0

A new operator, //, is the floor division operator. (Yes, we know it 
looks like C++'s comment symbol.) // always performs floor division no 
matter what the types of its operands are, so 1 // 2 is 0 and 1.0 // 
2.0 is also 0.0. 

not ()
posted on 2012-11-08 06:43 luis 阅读(332) 评论(0)  编辑 收藏 引用 所属分类: Python

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2012年11月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

常用链接

留言簿(3)

随笔分类

随笔档案

文章分类

文章档案

友情链接

搜索

  •  

最新评论

阅读排行榜

评论排行榜