2020 The Fundamentals of Python Programming(Nankai University) 最新满分章节测试答案
- 【作业】Week 1. Introduction Programming Exercises-Week 1
- Week 1. Introduction Unit Test-Week 1
- Week 2. Basics for Built-in Data Types Unit Test-Week 2
- 【作业】Week 2. Basics for Built-in Data Types Programming Exercises-Week 2
- 【作业】Week 3. Data Operators Programming Exercises-Week 3
- Week 3. Data Operators Unit Test-Week 3
- 【作业】Week 4. Conditional Statement Programming Exercises-Week 4
- Week 4. Conditional Statement Unit Test-Week 4
- 【作业】Week 5. Loop Statement Programming Exercises-Week 5
- Week 5. Loop Statement Unit Test-Week 5
- 【作业】Week 6. Function Basics Programming Exercises-Week 6
- Week 6. Function Basics Unit Test-Week 6
- 【作业】Week 7. Module and Package Programming Exercises-Week 7
- Week 7. Module and Package Unit Test-Week 7
- 【作业】Week 8. Variable Scope and Less Basics for Function Programming Exercises-Week 8
- Week 8. Variable Scope and Less Basics for Function Unit Test-Week 8
- 【作业】Week 9. Object-Oriented Programming Basics Programming Exercises-Week 9
- Week 9. Object-Oriented Programming Basics Unit Test-Week 9
- Week 10. Private Attributes and Built-in Methods Unit Test-Week 10
- 【作业】Week 10. Private Attributes and Built-in Methods Programming Exercises-Week 10
- Week 11. Inheritance and Polymorphism Unit Test-Week 11
- 【作业】Week 11. Inheritance and Polymorphism Programming Exercises-Week 11
- Week 12. More for List and Tuple Unit Test-Week 12
- 【作业】Week 12. More for List and Tuple Programming Exercises-Week 12
- Week 13. More for Set and Dictionary Unit Test-Week 13
- 【作业】Week 13. More for Set and Dictionary Programming Exercises-Week 13
- Week 14. Slice, Generator, and Iterator Unit Test-Week 14
- 【作业】Week 14. Slice, Generator, and Iterator Programming Exercises-Week 14
- Week 15. More for String Unit Test-Week 15
- 【作业】Week 15. More for String Programming Exercises-Week 15
- Week 16. File and Exception Unit Test-Week 16
- 【作业】Week 16. File and Exception Programming Exercises
本答案对应课程为:点我自动跳转查看
本课程起止时间为:2020-09-02到2020-12-27
本篇答案更新状态:已完结
【作业】Week 1. Introduction Programming Exercises-Week 1
1、 问题:Please write a program to implement the following function: Enter a string from the keyboard, and print it on the screen.
Tips:
1. Install the Python programming environment on your computer, and then write the program and run it. You should ensure that the outputs of the program on your computer are consistent with the given examples before you submit the program to the OJ (Online Judge) platform.
2. When the OJ platform evaluates the submitted program, it may use other testing cases. So you should write the program according to the requirement of the programming exercise, instead of writing the code that is only aimed at the given input/output examples.
3. Any redundant output will make the program fail to pass the testing of the OJ platform. For example, the correct output is:
Li Xiaoming
the OJ platform will report an error if the output is:
Name: Li Xiaoming
Note that when calling the input function, if we pass the prompt such as "Please input a string:", the OJ platform will also report an error since the output of the submitted program is:
Please input a string:
Li Xiaoming
建议:【本题是主观题,暂无解析】
2、 问题:Please write a program to implement the following function: Enter a valid expression from the keyboard, and print the calculation result of the expression on the screen.
Tips:
1. Install the Python programming environment on your computer, and then write the program and run it. You should ensure that the outputs of the program on your computer are consistent with the given examples before you submit the program to the OJ (Online Judge) platform.
2. When the OJ platform evaluates the submitted program, it may use other testing cases. So you should write the program according to the requirement of the programming exercise, instead of writing the code that is only aimed at the given input/output examples.
3. Any redundant output will make the program fail to pass the testing of the OJ platform. For example, the correct output is:
6
the OJ platform will report an error if the output is:
Result: 6
Note that when calling the input function, if we pass the prompt such as "Please input a valid expression:", the OJ platform will also report an error since the output of the submitted program is:
Please input a valid expression:
6
建议:【本题是主观题,暂无解析】
Week 1. Introduction Unit Test-Week 1
1、 问题:The way to directly enter and execute Python code at the prompt of the Python console is called ______.
选项:
A:Interactive mode
B:Script mode
C:Code mode
D:Immediate mode
答案: 【Interactive mode】
2、 问题:Among the following functions, ______ is to receive standard input data (that is, input from the keyboard) and return a string.
选项:
A:eval
B:input
C:print
D:get
答案: 【input】
3、 问题:Among the following functions, ______ is to output various types of data (string, integer, floating point, list, dictionary, etc.) to the screen.
选项:
A:eval
B:input
C:print
D:get
答案: 【print】
4、 问题:The options that belong to the high-level programming language include ______.
选项:
A:Python language
B:Assembly language
C:Machine language
D:C++ language
答案: 【Python language;
C++ language】
5、 问题:Python is the ______ programming language.
选项:
A:compiled
B:interpretive
C:high-level
D:low-level
答案: 【interpretive;
high-level】
6、 问题:The statements that don’t report error include ______.
选项:
A:eval(‘3+5’)
B:eval(‘3.55+6′)
C:eval(‘3.5/5+6′)
D:eval(‘3a’)
答案: 【eval(‘3+5’);
eval(‘3.5*5+6’)】
7、 问题:The prompt for the Python console is >>>.
选项:
A:正确
B:错误
答案: 【正确】
8、 问题:The statement in Python ends with a semicolon.
选项:
A:正确
B:错误
答案: 【错误】
9、 问题:The comments are to enhance the readability of the program, instead of actually running.
选项:
A:正确
B:错误
答案: 【正确】
10、 问题:Debugging is to solve syntax errors.
选项:
A:正确
B:错误
答案: 【错误】
Week 2. Basics for Built-in Data Types Unit Test-Week 2
1、 问题:In the following options, ______ is not a constant.
选项:
A:12
B:35.7
C:’Python’
D:abc
答案: 【abc】
2、 问题:When executing "print (0x20)", the output on the screen is ______.
选项:
A:20
B:0x20
C:16
D:32
答案: 【32】
3、 问题:Among the following options, the statement that does not report an error when executing is ______.
选项:
A:int(‘23.5’)
B:float(‘23.5+1’)
C:float(‘23.5’)
D:int(‘2a’,8)
答案: 【float(‘23.5’)】
4、 问题:Among the following options, statements that do not report errors when executing include ______.
选项:
A:ls=[]
B:ls=[12,[1.5,True]]
C:ls=[12;35]
D:ls=[‘test’]
答案: 【ls=[];
ls=[12,[1.5,True]];
ls=[‘test’]】
5、 问题:Among the following options, the hashable data types include ______.
选项:
A:Number
B:Set
C:List
D:Tuple
答案: 【Number;
Tuple】
6、 问题:Among the following options, the statements that cannot create a dictionary object include ______.
选项:
A:{‘one’:1, ‘two’:2, ‘three’:3}
B:dict(‘one’:1, ‘two’:2, ‘three’:3)
C:{one=1, two=2, three=3}
D:dict(one=1, two=2, three=3)
答案: 【dict(‘one’:1, ‘two’:2, ‘three’:3);
{one=1, two=2, three=3}】
7、 问题:Python is a weakly typed language, and the type of the variable is determined by the type of its value.
选项:
A:正确
B:错误
答案: 【正确】
8、 问题:1.25e3 is the scientific notation of the floating number 1250.0.
选项:
A:正确
B:错误
答案: 【正确】
9、 问题:The subscript "[]" can not only access an element in the tuple, but also modify the element.
选项:
A:正确
B:错误
答案: 【错误】
10、 问题:An empty collection can be created by "{}".
选项:
A:正确
B:错误
答案: 【错误】
【作业】Week 2. Basics for Built-in Data Types Programming Exercises-Week 2
本文章不含期末不含主观题!!
本文章不含期末不含主观题!!
支付后可长期查看
有疑问请添加客服QQ 2356025045反馈
如遇卡顿看不了请换个浏览器即可打开
请看清楚了再购买哦,电子资源购买后不支持退款哦