python-面试题集

1、异常处理写法以及如何主动跑出异常(应用场景)

2、什么是面向对象的mro

3、isinstance作用以及应用场景?

4、写代码并实现:

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would

have exactly one solution, and you may not use the same element twice.

Example:?

Given nums = [2, 7, 11, 15], target = 9,

?Because nums[0] + nums[1] = 2 + 7 = 9,?

return [0, 1]

5、json序列化时,可以处理的数据类型有哪些?如何定制支持datetime类型?

6、json序列化时,默认遇到中文会转换成unicode,如果想要保留中文怎么办?

7、什么是断言?应用场景?

8、有用过with statement吗?它的好处是什么?

9、使用代码实现查看列举目录下的所有文件。

10、简述 yield和yield from关键字。

11、提高python运行效率的方法

猜你喜欢

转载自blog.csdn.net/qq_39469688/article/details/82558683