diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index e0fee02..b234389 100644 --- a/cfu-data-types.ipynb +++ b/cfu-data-types.ipynb @@ -51,9 +51,30 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ana, who is 20 years old, and lives in rua das couves has 950.0 dollars left from her salary after expenses. It is True that she has more than $500 left).\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "name = input(\"Enter your name: \")\n", + "age = int(input(\"Enter your age: \"))\n", + "address = input(\"Enter your address: \")\n", + "salary = float(input(\"Enter your salary: \"))\n", + "expenses = float(input(\"Enter your expenses: \"))\n", + "remaining_salary = round(salary - expenses, 1)\n", + "\n", + "if remaining_salary >= 500:\n", + " is_salary_good = True\n", + "else:\n", + " is_salary_good = False\n", + "\n", + "print(f\"{name}, who is {age} years old, and lives in {address} has {remaining_salary} dollars left from her salary after expenses. It is {is_salary_good} that she has more than $500 left.\")" ] }, { @@ -85,7 +106,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -102,17 +123,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "258\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', 'sufficepython', 'is', 'awesome!']\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "poem2 = poem.replace(\",\", \"\").replace(\".\", \"\").replace(\"\\n\", \" \").lower()+ \"python is awesome!\"\n", + "poem_list = poem2.split()\n", + "\n", + "print(len(poem2))\n", + "print(poem_list)\n", + "\n" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "base", "language": "python", "name": "python3" }, @@ -126,7 +162,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.13.9" } }, "nbformat": 4,