{ "metadata": { "kernelspec": { "name": "python", "display_name": "Python (Pyodide)", "language": "python" }, "language_info": { "codemirror_mode": { "name": "python", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8" } }, "nbformat_minor": 5, "nbformat": 4, "cells": [ { "id": "b61037f1-6db8-4565-97a9-26ca044f9157", "cell_type": "markdown", "source": "
\n
🕐 Do Now: Fix The Code
\n
\n
\n

The code below has several errors that prevent it from functioning properly.

\n

Fix each of the errors and add comments below to explain how you fixed them

\n
\n \n
\n\n
", "metadata": {} }, { "id": "d7bc1608-a7b9-430e-9949-e998087bf31e", "cell_type": "code", "source": "guess = input(\"Name an item people leave out for Santa\")\n\nif guess.lower = \"mince pie\":\n print(\"Correct\")\nif guess.lower = \"carrot\":\n print(\"Correct\")\nif guess.lower = \"milk\":\n print(\"Correct\")\nelse:\n print(\"Incorrect\n\n# Space for comments about the changes you made\n\n ", "metadata": { "trusted": true }, "outputs": [], "execution_count": null }, { "id": "4b29626b-0f58-44a9-a7e9-60b825ebffa4", "cell_type": "markdown", "source": "
\n
⌨️ Coding Activity (A): Working with numbers
\n
\n
\n

You will now work with your teacher to develop a program that incorporates integers (whole numbers)

\n

You will complete some code with your teacher and comment as you go along

\n
\n \n
\n\n
", "metadata": {} }, { "id": "eed231d5-135d-4b7c-9f21-da95e4e3984c", "cell_type": "code", "source": "# Coding Activity A\n\nnum1 = input(\"Enter your first number\")\nnum2 = input(\"Enter your second number\")\n\n# (1) Your teacher will show you how to do some calculations with these numbers\n\n\n\n\n\n\n# (2) Answer these questions\n#----------------------------------\n\n#(a) Explain the difference between integers and strings\n\n\n#(b) Explain the need for casting and how it is done\n\n\n#(c) Identify the main arithmetic operations\n\n", "metadata": { "trusted": true }, "outputs": [], "execution_count": null }, { "id": "27059d0f-8412-4e87-aede-c48bd070be4d", "cell_type": "markdown", "source": "
\n
⌨️ Coding Activity (B): Santa's Nice List
\n
\n
\n

You will now apply your understanding of:

\n \n

To make a Nice-Ometer for Santa!🎅🤶

\n
\n\n

A child will enter the number of times they have been good in one year.\n
Depending on the number they enter, they will be given a rating and a gift suggestion:

\n\n\nTo test if a number is greater than another we use this symbol >\n

Example
if score > 9:
\n
\n
", "metadata": {} }, { "id": "94b79ed1-c03b-4c1b-89d9-81f3eb5a8ad9", "cell_type": "code", "source": "# Coding Activity B - Santa's List\n\n\n\n\n\n\n\n", "metadata": { "trusted": true }, "outputs": [], "execution_count": null }, { "id": "fffc8020-d835-4053-ab6a-943703e31a22", "cell_type": "markdown", "source": "
\n
\n
\n
⌨️ Extension: Reindeer Guesser
\n
\n
\n \n\n
\n

Extending further

\nAward different points, depending on how obscure the reindeer is (only 1 point for rudolf)\n
\n\n
", "metadata": {} }, { "id": "dc9bf77c-65c6-4980-8020-d5c7ae8bfdf7", "cell_type": "code", "source": "", "metadata": { "trusted": true }, "outputs": [], "execution_count": null } ] }