From 8f33a1d26ef718ae187ae3b9b2d7106fa6eb4505 Mon Sep 17 00:00:00 2001 From: Orgo4ever <163662002+Orgo4ever@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:36:19 +0200 Subject: [PATCH] Update cfu-data-types.ipynb solved lab --- cfu-data-types.ipynb | 72 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index e0fee02..8ec94e1 100644 --- a/cfu-data-types.ipynb +++ b/cfu-data-types.ipynb @@ -51,9 +51,36 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kyle,who is 29years old, and lives at 25030 Newberry Dr.has 1000.0left after expenses. It is a good salary and you have more than $500 left\n", + "29\n", + "Kyle\n", + "Remaining salary: 1000.0\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "user_age = int(input(\"Please enter your age: \"))\n", + "user_name = input(\"Please enter your name: \")\n", + "user_address= str(input(\"Please enter your address: \"))\n", + "user_monthly_salary = round(float(input(\"Please enter your monthly salary: \")), 1)\n", + "user_expense = round(float(input(\"Please enter your monthly expenses: \")), 1)\n", + "\n", + "remaining_salary = round(user_monthly_salary - user_expense, 1)\n", + "\n", + "if remaining_salary > 500:\n", + " print(f\"{user_name},who is {user_age} years old, and lives at {user_address}has ${remaining_salary}left after expenses. It is a good salary and you have more than $500 left\")\n", + "else:\n", + " print(f\"{user_name},who is {user_age}years old, and lives at {user_address}has {remaining_salary}left after expenses. It is not a good salary and you have less than $500 left\")\n", + "\n", + "print(user_age)\n", + "print(user_name)\n", + "print(\"Remaining salary:\", remaining_salary)\n" ] }, { @@ -85,7 +112,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -102,17 +129,46 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "259" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "new_poem = poem.lower().replace(\",\", \"\").replace(\".\", \"\").replace(\"!\", \"\").replace(\"?\", \"\")\n", + "message= \"python is awesome!\"\n", + "added_message=new_poem + \" \" + message\n", + "len(added_message)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -126,7 +182,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.9.10" } }, "nbformat": 4,