diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index e0fee02..c833124 100644 --- a/cfu-data-types.ipynb +++ b/cfu-data-types.ipynb @@ -53,9 +53,37 @@ "metadata": {}, "outputs": [], "source": [ - "# Your code here\n" + "name = input(\"enter your name\")\n", + "salary = int(input(\"how much you earn?\"))\n", + "age = int(input(\"enter your age\"))\n", + "expenses = int(input(\"how much do you spend?\"))\n", + "address = input(\"where do you live?\")\n", + "\n", + "remaining_salary = salary - expenses\n", + "round_remaining_salary = round(remaining_salary)\n", + "round_remaining_salary >= 500\n", + "\n", + " " ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -85,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -102,17 +130,46 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "some say the world will end in fire\n", + "some say in ice\n", + "from what i’ve tasted of desire\n", + "i hold with those who favor fire\n", + "but if it had to perish twice\n", + "i think i know enough of hate\n", + "to say that for destruction ice\n", + "is also great\n", + "and would suffice 'python is awesome!'\n", + "261\n", + "['some', 'say', 'the', 'world', 'will', 'end', 'in', 'fire', 'some', 'say', 'in', 'ice', 'from', 'what', 'i’ve', 'tasted', 'of', 'desire', 'i', 'hold', 'with', 'those', 'who', 'favor', 'fire', 'but', 'if', 'it', 'had', 'to', 'perish', 'twice', 'i', 'think', 'i', 'know', 'enough', 'of', 'hate', 'to', 'say', 'that', 'for', 'destruction', 'ice', 'is', 'also', 'great', 'and', 'would', 'suffice', \"'python\", 'is', \"awesome!'\"]\n" + ] + } + ], "source": [ - "# Your code here\n" + "new_poem = poem.replace(\",\", \"\").replace(\".\", \"\").lower() + \" 'python is awesome!'\"\n", + "print(new_poem)\n", + "print(len(new_poem))\n", + "poem_list = new_poem.split()\n", + "print(poem_list)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "base", "language": "python", "name": "python3" }, @@ -126,7 +183,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.12.2" } }, "nbformat": 4,