Skip to content

Commit 351dfea

Browse files
committed
Tweaked exercise section a bit
1 parent df25581 commit 351dfea

1 file changed

Lines changed: 44 additions & 4 deletions

File tree

content/Foundations.ipynb

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,33 @@
482482
{
483483
"id": "f77a0854-4d85-4c8c-a398-9253503a37ce",
484484
"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",
486486
"metadata": {}
487487
},
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+
},
488508
{
489509
"id": "40a8a587-c60a-4fd5-8658-4bd154337f61",
490510
"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.",
492512
"metadata": {
493513
"jp-MarkdownHeadingCollapsed": true
494514
}
@@ -506,13 +526,33 @@
506526
{
507527
"id": "73ec57a1-0a04-467a-84c1-003a05d9f50b",
508528
"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",
510530
"metadata": {}
511531
},
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+
},
512552
{
513553
"id": "3bc5d2c8-9a4b-402a-85b6-e8f5d52c61a6",
514554
"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.",
516556
"metadata": {
517557
"jp-MarkdownHeadingCollapsed": true
518558
}

0 commit comments

Comments
 (0)