You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.6 KiB

2 years ago
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "**下面给出了该选择结构的python代码实现,试试运行下方单元的代码!**"
  8. ]
  9. },
  10. {
  11. "cell_type": "code",
  12. "execution_count": null,
  13. "metadata": {},
  14. "outputs": [],
  15. "source": [
  16. "a = input(\"请输入要洗的衣物(牛仔裤/丝织物):\")\n",
  17. "if a == \"牛仔裤\":\n",
  18. " print(\"洗涤12分钟\")\n",
  19. "else:\n",
  20. " if a == \"丝织物\":\n",
  21. " print(\"洗涤8分钟\")\n",
  22. " else:\n",
  23. " print(\"洗涤10分钟\")"
  24. ]
  25. },
  26. {
  27. "cell_type": "code",
  28. "execution_count": null,
  29. "metadata": {},
  30. "outputs": [],
  31. "source": []
  32. },
  33. {
  34. "cell_type": "code",
  35. "execution_count": null,
  36. "metadata": {},
  37. "outputs": [],
  38. "source": []
  39. }
  40. ],
  41. "metadata": {
  42. "kernelspec": {
  43. "display_name": "Python 3",
  44. "language": "python",
  45. "name": "python3"
  46. },
  47. "language_info": {
  48. "codemirror_mode": {
  49. "name": "ipython",
  50. "version": 3
  51. },
  52. "file_extension": ".py",
  53. "mimetype": "text/x-python",
  54. "name": "python",
  55. "nbconvert_exporter": "python",
  56. "pygments_lexer": "ipython3",
  57. "version": "3.7.3"
  58. },
  59. "toc": {
  60. "base_numbering": 1,
  61. "nav_menu": {},
  62. "number_sections": true,
  63. "sideBar": true,
  64. "skip_h1_title": false,
  65. "title_cell": "Table of Contents",
  66. "title_sidebar": "Contents",
  67. "toc_cell": false,
  68. "toc_position": {
  69. "height": "calc(100% - 180px)",
  70. "left": "10px",
  71. "top": "150px",
  72. "width": "250px"
  73. },
  74. "toc_section_display": true,
  75. "toc_window_display": false
  76. }
  77. },
  78. "nbformat": 4,
  79. "nbformat_minor": 2
  80. }