|
173 | 173 | "protein = int(input(\"How many protein does this product have?: \"))\n", |
174 | 174 | "\n", |
175 | 175 | "total_calories = carbohydrate * 4 + fat * 9 + protein * 4\n", |
176 | | - "print(\"This product have \" + str(total_calories) + \" calories in it.\")" |
| 176 | + "print(\"This product has \" + str(total_calories) + \" calories in it.\")" |
177 | 177 | ] |
178 | 178 | }, |
179 | 179 | { |
|
205 | 205 | " protein = int(input(\"How many protein does this product have?: \"))\n", |
206 | 206 | "\n", |
207 | 207 | " calories = carbohydrate * 4 + fat * 9 + protein * 4\n", |
208 | | - " print(\"This product have \" + str(calories) + \" calories in it.\")" |
| 208 | + " print(\"This product has \" + str(calories) + \" calories in it.\")" |
209 | 209 | ] |
210 | 210 | }, |
211 | 211 | { |
|
344 | 344 | "source": [ |
345 | 345 | "def calculate_calories():\n", |
346 | 346 | " calories = carbohydrate * 4 + fat * 9 + protein * 4\n", |
347 | | - " print(\"This product have \" + str(calories) + \" calories in it.\")\n", |
| 347 | + " print(\"This product has \" + str(calories) + \" calories in it.\")\n", |
348 | 348 | "\n", |
349 | 349 | "\n", |
350 | 350 | "carbohydrate = int(input(\"How many carbohydrate does this product have?: \"))\n", |
|
387 | 387 | "source": [ |
388 | 388 | "def calculate_calories(carbohydrate, fat, protein):\n", |
389 | 389 | " calories = carbohydrate * 4 + fat * 9 + protein * 4\n", |
390 | | - " print(\"This product have \" + str(calories) + \" calories in it.\")" |
| 390 | + " print(\"This product has \" + str(calories) + \" calories in it.\")" |
391 | 391 | ] |
392 | 392 | }, |
393 | 393 | { |
|
453 | 453 | "# פרמטרים\n", |
454 | 454 | "def calculate_calories(carbohydrate, fat, protein): # כותרת הפונקציה\n", |
455 | 455 | " calories = carbohydrate * 4 + fat * 9 + protein * 4\n", |
456 | | - " print(\"This product have \" + str(calories) + \" calories in it.\")\n", |
| 456 | + " print(\"This product has \" + str(calories) + \" calories in it.\")\n", |
457 | 457 | "\n", |
458 | 458 | "\n", |
459 | 459 | "product_carbohydrate = int(input(\"How many carbohydrate does this product have?: \"))\n", |
|
614 | 614 | "metadata": {}, |
615 | 615 | "outputs": [], |
616 | 616 | "source": [ |
617 | | - "print(\"Calories in Hamburger: \" + str(calculate_calories(50, 17.5, 36)))\n", |
| 617 | + "print(\"Calories in a Hamburger: \" + str(calculate_calories(50, 17.5, 36)))\n", |
618 | 618 | "print(\"Calories in 2 Hamburgers: \" + str(2 * calculate_calories(50, 17.5, 36)))" |
619 | 619 | ] |
620 | 620 | }, |
|
636 | 636 | "metadata": {}, |
637 | 637 | "outputs": [], |
638 | 638 | "source": [ |
639 | | - "print(\"Calories in Hamburger: \" + str(501.5))\n", |
| 639 | + "print(\"Calories in a Hamburger: \" + str(501.5))\n", |
640 | 640 | "print(\"Calories in 2 Hamburgers: \" + str(2 * 501.5))" |
641 | 641 | ] |
642 | 642 | }, |
|
656 | 656 | "outputs": [], |
657 | 657 | "source": [ |
658 | 658 | "calories_in_hamburger = calculate_calories(50, 17.5, 36)\n", |
659 | | - "print(\"Calories in Hamburger: \" + str(calories_in_hamburger))\n", |
| 659 | + "print(\"Calories in a Hamburger: \" + str(calories_in_hamburger))\n", |
660 | 660 | "print(\"Calories in 2 Hamburgers: \" + str(2 * calories_in_hamburger))" |
661 | 661 | ] |
662 | 662 | }, |
|
687 | 687 | "product_protein = int(input(\"How many protein does this product have?: \"))\n", |
688 | 688 | "# ארגומנטים\n", |
689 | 689 | "cal = calculate_calories(product_carbohydrate, product_fat, product_protein)\n", |
690 | | - "print(\"This product have \" + str(cal) + \" calories in it.\")" |
| 690 | + "print(\"This product has \" + str(cal) + \" calories in it.\")" |
691 | 691 | ] |
692 | 692 | }, |
693 | 693 | { |
|
1156 | 1156 | }, |
1157 | 1157 | { |
1158 | 1158 | "cell_type": "code", |
1159 | | - "execution_count": 23, |
1160 | | - "metadata": {}, |
1161 | | - "outputs": [ |
1162 | | - { |
1163 | | - "name": "stdout", |
1164 | | - "output_type": "stream", |
1165 | | - "text": [ |
1166 | | - "How many hours did it take to finish a 5km run? 5\n", |
1167 | | - "You can't do it :(\n" |
1168 | | - ] |
1169 | | - } |
1170 | | - ], |
| 1159 | + "execution_count": null, |
| 1160 | + "metadata": {}, |
| 1161 | + "outputs": [], |
1171 | 1162 | "source": [ |
1172 | 1163 | "MARATHON_DISTANCE = 42.195\n", |
1173 | 1164 | "\n", |
|
0 commit comments