diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index e0fee02..df5a809 100644 --- a/cfu-data-types.ipynb +++ b/cfu-data-types.ipynb @@ -49,11 +49,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sindhu, who is 22 years old,and lives in portugal has 1000.0 dollars left from her 1500 salary after expenses.It is True that she has more than $500 left.\n" + ] + } + ], "source": [ - "# Your code here\n" + "name=str(input(\"enter your name\"))\n", + "age=int(input(\"enter your age\"))\n", + "address=input(\"enter your address\")\n", + "salary=int(input(\"enter your salary\"))\n", + "expenses=float(input(\"enter your expenses\"))\n", + "remaining_salary=round(salary-expenses,1)\n", + "\n", + "is_salary_good=remaining_salary >=500\n", + "\n", + "print(f\"{name}, who is {age} years old,and lives in {address} has {remaining_salary} dollars left from her {salary} salary after expenses.It is {is_salary_good} that she has more than $500 left.\")\n" ] }, { @@ -85,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -102,17 +119,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "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" + "result=poem.lower().replace(\".\",\"\").replace(\",\",\"\").replace(\"'\",\"\").replace(\"\\n\",\" \")\n", + "string=\"python is awesome!\"\n", + "combined=result + string\n", + "print(len(combined))\n", + "poem_list=combined.split()\n", + "print(poem_list)\n" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -126,7 +157,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.9" } }, "nbformat": 4,