Python
By 2017-12-19
1. Python math __________ sqrt
2. Python __________ None
3. Python _________( )
4. Python ________________type()
5. Python _________________id()
6. [1, 2, 3]*3 ______________________ [1, 2, 3, 1, 2, 3, 1, 2, 3]
7. list(map(str, [1, 2, 3])) _____________________ [ 1 , 2 , 3
8. x = 3 id(x) 496103280 x += 6 id(x) ==
496103280 ___________False
9. x = 3 x *= 6 x ________________ 18
10. [3] in [1, 2, 3, 4] ________________False
11. aList [3, 4, 5, 6, 7, 9, 11, 13, 15, 17] aList[3:7]
______________________ [6, 7, 9, 11]
12. 10 5 _______________ [5 for i in
range(10)]
13. a = ['name', 'age', 'sex'] b = ['Dong', 38, 'Male']
a b
_____________________ c = dict(zip(a, b))
14. Python ________-1
15. Python ''.join(list('hello world!')) ____________________'hello world!'
16. ___________________
17. Python list(range(1,10,3)) ___________________ [1, 4, 7]
18. list(range(6))[::2] ________________[0, 2, 4]
19. 'ab' in 'acbed' ________False
20. Python 3.x print(1, 2, 3, sep=':') ____________1:2:3
21. int(4**0.5) ____________2
22. sorted([111, 2, 33], key=lambda x: -len(str(x))) ____________ [111, 33, 2]
23. x = ['11', '2', '3'] max(x) ___________'3'
24. min(['11', '2', '3']) _________________'11'
25. x = ['11', '2', '3'] max(x, key=len) ___________ '11'
26. x = (3,) x _______________(3,)
27. x = (3) x ________________3
28. x = {1:2} x[2] = 3 x ________________{1: 2, 2: 3}
29. _____________ - items()
30. 100 13
___________________________________ [i for i in range(100) if i%13==0]
31. 3 ** 2 _________9
32. 3 * 2 ___________ 6
33. x = [3, 5, 7] x[len(x):] = [1, 2] x ______________[3, 5, 7, 1, 2]
34. list(zip([1,2], [3,4])) ________________________ [(1, 3), (2, 4)]
35. x = [1, 2, 3, 2, 3] x.pop() x _____________[1, 2, 3, 2]
36. [x for x in [1,2,3,4,5] if x<3] _____________________ [1, 2]
37. [index for index, value in enumerate([3,5,7,3,7]) if value == max([3,5,7,3,7])]
__________________ [2, 4]
38. path = r'c: est.html' path[:-4]+'htm' __________'c:\test.htm'