07 2020 档案
摘要:Flask简单使用 1、定义路由 @app.route('/')是装饰器,定义如下: app.route(rule, options) rule参数:是绑定URL与函数。 options参数:是可选参数。 2、run() 函数来让应用运行在本地服务器上。定义如下 : app.run(host, po
阅读全文
摘要:1、python反转字符串 '''第一种:使用字符串切片''' s = 'Hello World' print(s[::-1]) # dlroW olleH '''第二种:使用列表的reverse方法''' l = list(s) l.reverse() print( "".join(l) ) #
阅读全文
摘要:1.1 列表和元组 1、列表基本操作 1. 列表赋值 a = [1,2,3,4,5,6,7,8] a[0] = 100 #the result : [100, 2, 3, 4, 5, 6, 7, 8] 2. 元素删除 a = [1,2,3,4,5,6,7,8] del a[0] #the resul
阅读全文

浙公网安备 33010602011771号