Python-操作符和表达式

//: 除后向下取正  -3//2=-2

**: 幂 3**3 = 27

not: !

and: &&

or: ||

除了以上几个之外,其余与C++相同

 

length = 3

width = 4

area = length * width

print('Area is',area)

output:

Area is 12

注意在[is]和[12]之间有个空格

 

posted @ 2014-09-06 12:03  米其林轮船  阅读(132)  评论(0编辑  收藏  举报