Python3学习笔记3-try and except, comment, \(back-slash)
来源:互联网 发布:linux查看进程端口 编辑:程序博客网 时间:2024/06/11 16:37
干货太多了,天哪
1.Try and except
>>> try: import flaskexcept: print("No mudule named flask")No mudule named flask>>>
2 Comments , Triple quotation marks,Back-salsh
2.1
用#注释。#之后的语句不会运行。
2.2
"""Write anything you want.Can span multiple lines.""" """Or three single quotation marks ''' '''"""
2.3
\ character is a way we can put difficult-to-type characters into a string.
Escape What it does.\\ Backslash (\)\' Single-quote (')\" Double-quote (")\a ASCII bell (BEL)\b ASCII backspace (BS)\f ASCII formfeed (FF)\n ASCII linefeed (LF)\N{name} Character named name in the Unicode database (Unicode only)\r Carriage Return (CR)\t Horizontal Tab (TAB)\uxxxx Character with 16-bit hex value xxxx (Unicode only)\Uxxxxxxxx Character with 32-bit hex value xxxxxxxx (Unicode only)\v ASCII vertical tab (VT)\ooo Character with octal value ooo\xhh Character with hex value hh来自 <https://learnpythonthehardway.org/book/ex10.html>
一行代码太长的时候,可以用 \ 来换行。
>>> longitude = 118.06>>> latitude = 24.27>>> if 118.00000000 < longitude < 118.22222222\ and 24.22222222 < latitude < 29.66666666 : print("Somewhere.")else: print("Somewhere else.")Somewhere.>>>
阅读全文
0 0
- Python3学习笔记3-try and except, comment, \(back-slash)
- try except and try catch
- Python3:异常处理,try...except
- try except and try catch ZZ
- try except and try catch ZZ
- try except and try catch ZZ
- python 学习笔记——try,except,else,finally
- 《python》学习笔记(Day1++),try\except\finally机制
- Python--小甲鱼学习笔记--第33课:异常处理(try-except, try-finally, raise)
- try except
- try except
- 【python学习笔记】Python异常处理raise、try...except、断言assert
- android学习笔记之Task and back stack
- android学习笔记之Task and back stack
- Python学习笔记之错误处理(关键词:错误处理、异常机制、try、except、else、finally、raise)
- [代码笔记] python之 异常处理 try except else finally
- Python笔记-错误处理try...except...finally...、logging模块
- try ... except 用法
- Redis安装及配置启动方式
- 二十一、React顶级API
- 装饰模式 Decorator Pattern
- 《深度学习原理与TensorFlow实践》学习笔记(一)
- 解决类似/usr/lib64/libstdc++.so.6: version 'GLIBCXX_3.4.19' not found错误
- Python3学习笔记3-try and except, comment, \(back-slash)
- 二叉树
- passing 'char[16]' to parameter of type 'const u8*' (aka 'const unsigned char*') converts between p
- java基础之数组的介绍
- CSS滤镜效果属性filter
- 求js数组的最大值和最小值的四种方法
- 神经网络为什么要归一化
- scala学习笔记 之 函数
- 七月读书表