|
37 | 37 | }, |
38 | 38 | { |
39 | 39 | "cell_type": "code", |
40 | | - "execution_count": 6, |
| 40 | + "execution_count": null, |
41 | 41 | "metadata": {}, |
42 | | - "outputs": [ |
43 | | - { |
44 | | - "name": "stdout", |
45 | | - "output_type": "stream", |
46 | | - "text": [ |
47 | | - "\n", |
48 | | - "---- Simple Calculator ----\n", |
49 | | - "1. Addition (+)\n", |
50 | | - "2. Subtraction (-)\n", |
51 | | - "3. Multiplication (*)\n", |
52 | | - "4. Division (/)\n", |
53 | | - "5. Exponentiation (^)\n", |
54 | | - "6. Exit\n", |
55 | | - "Result: 5.0 ^ 8.0 = 390625.0\n", |
56 | | - "\n", |
57 | | - "---- Simple Calculator ----\n", |
58 | | - "1. Addition (+)\n", |
59 | | - "2. Subtraction (-)\n", |
60 | | - "3. Multiplication (*)\n", |
61 | | - "4. Division (/)\n", |
62 | | - "5. Exponentiation (^)\n", |
63 | | - "6. Exit\n", |
64 | | - "Result: 5.0 + 8.0 = 13.0\n", |
65 | | - "\n", |
66 | | - "---- Simple Calculator ----\n", |
67 | | - "1. Addition (+)\n", |
68 | | - "2. Subtraction (-)\n", |
69 | | - "3. Multiplication (*)\n", |
70 | | - "4. Division (/)\n", |
71 | | - "5. Exponentiation (^)\n", |
72 | | - "6. Exit\n" |
73 | | - ] |
74 | | - }, |
75 | | - { |
76 | | - "ename": "ValueError", |
77 | | - "evalue": "could not convert string to float: ''", |
78 | | - "output_type": "error", |
79 | | - "traceback": [ |
80 | | - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", |
81 | | - "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", |
82 | | - "Cell \u001b[1;32mIn[6], line 53\u001b[0m\n\u001b[0;32m 50\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m 51\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mInvalid choice. Please try again.\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m---> 53\u001b[0m calculator()\n", |
83 | | - "Cell \u001b[1;32mIn[6], line 32\u001b[0m, in \u001b[0;36mcalculator\u001b[1;34m()\u001b[0m\n\u001b[0;32m 29\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mExiting calculator...\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m 30\u001b[0m \u001b[39mbreak\u001b[39;00m\n\u001b[1;32m---> 32\u001b[0m num1 \u001b[39m=\u001b[39m \u001b[39mfloat\u001b[39;49m(\u001b[39minput\u001b[39;49m(\u001b[39m\"\u001b[39;49m\u001b[39mEnter the first number: \u001b[39;49m\u001b[39m\"\u001b[39;49m))\n\u001b[0;32m 33\u001b[0m num2 \u001b[39m=\u001b[39m \u001b[39mfloat\u001b[39m(\u001b[39minput\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mEnter the second number: \u001b[39m\u001b[39m\"\u001b[39m))\n\u001b[0;32m 35\u001b[0m \u001b[39mif\u001b[39;00m choice \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39m1\u001b[39m\u001b[39m'\u001b[39m:\n", |
84 | | - "\u001b[1;31mValueError\u001b[0m: could not convert string to float: ''" |
85 | | - ] |
86 | | - } |
87 | | - ], |
| 42 | + "outputs": [], |
88 | 43 | "source": [ |
89 | 44 | "def add(a, b):\n", |
90 | 45 | " return a + b\n", |
|
0 commit comments