Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 64 additions & 8 deletions cfu-data-types.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -85,7 +112,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -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"
},
Expand All @@ -126,7 +182,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.9.10"
}
},
"nbformat": 4,
Expand Down