Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Virtual environments
myenv/
pyt101/
venv/
.env/

Expand All @@ -23,3 +23,5 @@ Thumbs.db

# Secrets
.env


Empty file added Discount_calc.ipynb
Empty file.
100 changes: 93 additions & 7 deletions Notebook1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,114 @@
"name": "stdout",
"output_type": "stream",
"text": [
"7\n"
"6\n"
]
}
],
"source": [
"x = 3\n",
"y = 4\n",
"y = 3\n",
"print(x + y)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "20b4d1be",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Python\n",
"95\n",
"77.5\n",
"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n",
"{'name': 'Sharwari', 'age': 22, 'city': 'Nagpur', 'Height': 5.5}\n"
]
}
],
"source": [
"subject = \"Python\"\n",
"marks = 95\n",
"percentage = 77.5\n",
"list1 = [1, 2, 3, 4, 5,6,7,8,9,10]\n",
"dict1 = {\"name\": \"Sharwari\", \"age\": 22, \"city\": \"Nagpur\", \"Height\": 5.5}\n",
"print(subject)\n",
"print(marks)\n",
"print(percentage)\n",
"print(list1)\n",
"print(dict1)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "e4fd482d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{11, 12, 13, 14, 15, 'b', 'a', 'c'}\n",
"[11, 12, 13, 14, 15, 14, 11, 'a', 'b', 'c', 'a']\n",
"10.0\n",
"10\n",
"10\n",
"True\n"
]
}
],
"source": [
"list2 = [11, 12, 13, 14, 15 ,14, 11,\"a\", \"b\", \"c\", \"a\"] \n",
"print(set(list2))\n",
"print(list(tuple(list2)))\n",
"price_str = \"10\"\n",
"price_float = float(price_str)\n",
"print(price_float)\n",
"price_int = int(price_float)\n",
"print(price_int)\n",
"price_int = int(price_str)\n",
"print(price_int)\n",
"print(bool(price_str))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ca9af74b",
"id": "ecdad8a4",
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You got 20% discount! Your discount amount is:800.0\n",
"Your final amount is: 3200.0\n"
]
}
],
"source": [
"input_str =float(input(\"Enter a amount: \")) \n",
"if input_str > 1200: \n",
" discount = 0.2 * float(input_str)\n",
" amt = float(input_str) - discount\n",
" print(f\"You got 20% discount! Your discount amount is:{discount}\")\n",
" print(f\"Your final amount is: {amt}\")\n",
"elif input_str > 800: \n",
" discount = 0.1 * float(input_str)\n",
" print(f\"You got 10% discount! Your discount amount is:{discount}\")\n",
" print(f\"Your final amount is: {amt}\")\n",
"else:\n",
" print(\"You are not eligible for any discount.\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "myenv",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -45,7 +131,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.7"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down