Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # 整数
- print 1
- print -1
- print 0xf
- print 010
- #浮点数
- #字符串
- print "hello world"
- print "I\'m Ok"
- #想打印\\t,这样就需要加多个\来转移
- print '\\\\t'
- # Python还允许用r''表示''内部的字符串默认不转义
- print r'\\t'
- print "line1\nline2\nline3"
- #如果字符串内部有很多换行,用\n写在一行里不好阅读,为了简化,Python允许用'''...'''的格式表示多行内容
- print '''line1
- line2
- line3'''
- #布尔值
- b=3>2
- print b
- # or 或运算 and 与运算 not 非运算
- b=True or False
- print b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement