|
482 | 482 | { |
483 | 483 | "id": "f77a0854-4d85-4c8c-a398-9253503a37ce", |
484 | 484 | "cell_type": "markdown", |
485 | | - "source": "## Exercise 1\nWrite a script that does the following:\n1. Asks the user for two numbers.\n2. Prints their sum, difference, product, and quotient.\n\n### Hints:\n1. Recall the function used to gather user input.\n2. Refer to the arithmetic operators", |
| 485 | + "source": "## Exercise 1\nWrite a script that does the following:\n1. Asks the user for two numbers\n2. Prints their sum, difference, product, and quotient\n\n### Hints:\n1. Recall the function used to gather user input and save it in a variable\n2. Refer to the arithmetic operators we looked at earlier", |
486 | 486 | "metadata": {} |
487 | 487 | }, |
| 488 | + { |
| 489 | + "id": "ca0e57d2-f31e-42b5-8570-ad32429f92f8", |
| 490 | + "cell_type": "code", |
| 491 | + "source": "# PUT YOUR SOLUTION HERE\n", |
| 492 | + "metadata": { |
| 493 | + "trusted": true |
| 494 | + }, |
| 495 | + "outputs": [], |
| 496 | + "execution_count": null |
| 497 | + }, |
| 498 | + { |
| 499 | + "id": "5e063dd0-78c2-4463-87ea-df406e630661", |
| 500 | + "cell_type": "code", |
| 501 | + "source": "", |
| 502 | + "metadata": { |
| 503 | + "trusted": true |
| 504 | + }, |
| 505 | + "outputs": [], |
| 506 | + "execution_count": null |
| 507 | + }, |
488 | 508 | { |
489 | 509 | "id": "40a8a587-c60a-4fd5-8658-4bd154337f61", |
490 | 510 | "cell_type": "markdown", |
491 | | - "source": "### possible solution", |
| 511 | + "source": "### Possible solution to Exercise 1\nPlease don't unhide the cell below until you are ready to view the solution.", |
492 | 512 | "metadata": { |
493 | 513 | "jp-MarkdownHeadingCollapsed": true |
494 | 514 | } |
|
506 | 526 | { |
507 | 527 | "id": "73ec57a1-0a04-467a-84c1-003a05d9f50b", |
508 | 528 | "cell_type": "markdown", |
509 | | - "source": "## Exercise 2\nBuild a Number Guessing Game:\n1. Generate a random number between 1–10.\n2. Let the user guess until they get it right.\n3. Give hints if the guess is too high/low.\n\n### Hints:\n1. Start with `import random` to import the package that allows us to generate random numbers.\n2. Use `random.randint(1, 10)` to generate a random integer between 1 and 10, inclusive.\n3. Use a loop to keep prompting until the user guesses correctly.", |
| 529 | + "source": "## Exercise 2\nBuild a Number Guessing Game:\n1. Generate a random number between 1 and 10\n2. Let the user keep guessing until they get it right\n3. Give a hint each time if the guess is too high or too low\n\n### Hints:\n1. Start with `import random` to import the package that allows us to generate random numbers\n2. Use `random.randint(1, 10)` to generate a random integer between 1 and 10, inclusive\n3. Use a loop to keep prompting until the user guesses correctly", |
510 | 530 | "metadata": {} |
511 | 531 | }, |
| 532 | + { |
| 533 | + "id": "0301ddd0-12a3-4a98-aa54-944b7e8f119e", |
| 534 | + "cell_type": "code", |
| 535 | + "source": "# PUT YOUR SOLUTION HERE\nimport random\n# put more code here...\n", |
| 536 | + "metadata": { |
| 537 | + "trusted": true |
| 538 | + }, |
| 539 | + "outputs": [], |
| 540 | + "execution_count": null |
| 541 | + }, |
| 542 | + { |
| 543 | + "id": "8b4d7bfd-68a6-40f9-bbb9-95d698b99e92", |
| 544 | + "cell_type": "code", |
| 545 | + "source": "", |
| 546 | + "metadata": { |
| 547 | + "trusted": true |
| 548 | + }, |
| 549 | + "outputs": [], |
| 550 | + "execution_count": null |
| 551 | + }, |
512 | 552 | { |
513 | 553 | "id": "3bc5d2c8-9a4b-402a-85b6-e8f5d52c61a6", |
514 | 554 | "cell_type": "markdown", |
515 | | - "source": "### possible solution", |
| 555 | + "source": "### Possible solution to Exercise 2\nPlease don't unhide the cell below until you are ready to view the solution.", |
516 | 556 | "metadata": { |
517 | 557 | "jp-MarkdownHeadingCollapsed": true |
518 | 558 | } |
|
0 commit comments