diff --git a/cfu-data-types.ipynb b/data-types-extra.ipynb similarity index 64% rename from cfu-data-types.ipynb rename to data-types-extra.ipynb index e0fee02..0a1ad71 100644 --- a/cfu-data-types.ipynb +++ b/data-types-extra.ipynb @@ -51,9 +51,31 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Nice, your remain money is 761.5€\n" + ] + } + ], "source": [ - "# Your code here\n" + "name= input(\"Enter your name:\")\n", + "age=int(input(\"Enter your age:\"))\n", + "address= input(\"Enter your adress\")\n", + "salary=float(input(\"Enter your salary:\"))\n", + "expenses=float(input(\"Enter your expenses:\"))\n", + "salary_round=round(salary,1)\n", + "expenses_round=round(expenses,1)\n", + "remain=salary_round-expenses_round\n", + "if remain <500:\n", + " print(f\"{name}, who is {age} years olld, and livesin {address} has {remain}€ ledt from her salary after expenses. {name} need to save money, the remain is less than 500€\")\n", + "elif remain> 500:\n", + " print(f\"{name}, who is {age} years olld, and livesin {address} has {remain}€ ledt from her salary after expenses. {name} is good, the remain is more than 500€\")\n", + "else:\n", + " print (f\"{name}, who is {age} years olld, and livesin {address} has {remain}€ ledt from her salary after expenses. {name} the remain is equal to 500€\")\n", + " \n" ] }, { @@ -85,9 +107,28 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "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\n", + "240\n", + "\n" + ] + } + ], "source": [ "poem = \"\"\"Some say the world will end in fire,\n", "Some say in ice.\n", @@ -97,7 +138,19 @@ "I think I know enough of hate\n", "To say that for destruction ice\n", "Is also great\n", - "And would suffice.\"\"\"" + "And would suffice.\"\"\"\n", + "new= poem.lower()\n", + "def remove_punctuation(input_string):\n", + " result = input_string\n", + " for char in new:\n", + " result = result.replace(',', '')\n", + " result=result.replace('.','')\n", + " return result\n", + "cleaned_text = remove_punctuation(new)\n", + "print(type(new))\n", + "print (cleaned_text)\n", + "print(len(cleaned_text))\n", + "poem_list=cleaned_text.split()\n" ] }, { @@ -112,7 +165,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "base", "language": "python", "name": "python3" }, @@ -126,7 +179,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.13.5" } }, "nbformat": 4,