{ "cells": [ { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "method = '4'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'course_id': 'False', 'error_msg': '参数错误: 缺少course_id'}\n" ] } ], "source": [ "if method not in ['0','1','2','3']:\n", " result = {\n", " \"course_id\": str('False'),\n", " \"error_msg\": str('参数错误: 缺少course_id')\n", " }\n", " print(result)" ] } ], "metadata": { "kernelspec": { "display_name": "mooc", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.2" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }