81、举例说明SQL注入和解决办法
当以字符串格式化书写方式的时候,如果用户输入的有;+SQL语句,后面的SQL语句会执行,比如例子中的SQL注入会删除数据库demo

解决方式:通过传参数方式解决SQL注入

82、s="info:xiaoZhang 33 shandong",用正则切分字符串输出['info', 'xiaoZhang', '33', 'shandong']
|表示或,根据冒号或者空格切分

83、正则匹配以http://163.com结尾的邮箱

84、递归求和

85、python字典和json字符串相互转化方法
json.dumps()字典转json字符串,json.loads()json转字典

86、MyISAM 与 InnoDB 区别:
1、InnoDB 支持事务,MyISAM 不支持,这一点是非常之重要。事务是一种高
级的处理方式,如在一些列增删改中只要哪个出错还可以回滚还原,而 MyISAM
就不可以了;
2、MyISAM 适合查询以及插入为主的应用,InnoDB 适合频繁修改以及涉及到
安全性较高的应用;
3、InnoDB 支持外键,MyISAM 不支持;
4、对于自增长的字段,InnoDB 中必须包含只有该字段的索引,但是在 MyISAM
表中可以和其他字段一起建立联合索引;
5、清空整个表时,InnoDB 是一行一行的删除,效率非常慢。MyISAM 则会重
建表;
87、统计字符串中某字符出现次数

88、字符串转化大小写

89、用两种方法去空格

90、正则匹配不是以4和7结尾的手机号

网友评论