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
18 changes: 15 additions & 3 deletions Notebook1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,24 @@
"id": "4c5c9023",
"metadata": {},
"outputs": [],
"source": []
"source": [
"print(\"Hello\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "443099f3",
"metadata": {},
"outputs": [],
"source": [
"git checkout -b '2nd_Year_CSE'\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "myenv",
"display_name": "base",
"language": "python",
"name": "python3"
},
Expand All @@ -209,7 +221,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.7"
"version": "3.13.9"
}
},
"nbformat": 4,
Expand Down
Empty file added Pyt_Abhay_3rdyr_10mar26.ipynb
Empty file.
96 changes: 96 additions & 0 deletions Pyt_Name_CSE_10Mar26.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "349737d7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello CSE People\n"
]
}
],
"source": [
"print('Hello CSE People')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c53c099b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"315\n"
]
}
],
"source": [
"x = 3+4*78\n",
"print(x)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7a1a6503",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"str"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = 4\n",
"name = 'Ronit'\n",
"#Convert the inteeger data to string\n",
"x_str = str(x)\n",
"data_type = type(x_str)\n",
"data_type"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "972c4d61",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
247 changes: 247 additions & 0 deletions notebook2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "34fe69ac",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Please choose an option: Greet, Info, Exit\n",
"This is a simple command-line program.\n",
"Please choose an option: Greet, Info, Exit\n",
"Hello! Nice to meet you.\n",
"Please choose an option: Greet, Info, Exit\n",
"Goodbye!\n",
"Please choose an option: Greet, Info, Exit\n",
"Goodbye!\n",
"Please choose an option: Greet, Info, Exit\n",
"Invalid choice. Please try again.\n",
"Please choose an option: Greet, Info, Exit\n",
"Invalid choice. Please try again.\n",
"Please choose an option: Greet, Info, Exit\n"
]
}
],
"source": [
"choice = ''\n",
"while choice != 'Exit':\n",
" print(\"Please choose an option: Greet, Info, Exit\")\n",
" choice = input(\"Enter You Choice:\").lower()\n",
" if choice == 'greet':\n",
" print(\"Hello! Nice to meet you.\")\n",
" elif choice == 'info':\n",
" print(\"This is a simple command-line program.\")\n",
" elif choice == 'exit':\n",
" print(\"Goodbye!\")\n",
" else:\n",
" print(\"Invalid choice. Please try again.\")"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "52af0fe8",
"metadata": {},
"outputs": [],
"source": [
"#Write a Python program that uses the 'For' loop for \n",
"# iterating through a list of elements and \n",
"# prints all the elements present in that list."
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "cad2ec55",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"No elements meets\n",
"Pencil\n",
"No elements meets\n"
]
}
],
"source": [
"new_dict = {\"Item1\": \"Pen\", \"Item2\": \"Pencil\", \"Item3\": \"Eraser\"}\n",
"for i,j in new_dict.items():\n",
" if i ==\"Item2\":\n",
" print(j)\n",
" else:\n",
" print(\"No elements meets\")\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "634c5850",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"2\n",
"3\n",
"4\n"
]
}
],
"source": [
"list_A = [1,2,3,4,5,6,7,8]\n",
"search_item = 5\n",
"for i in list_A:\n",
" if i == search_item:\n",
" break\n",
" else:\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "e8fe689b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"2\n",
"3\n",
"5\n",
"6\n",
"7\n",
"8\n"
]
}
],
"source": [
"for i in list_A:\n",
" if i == search_item:\n",
" continue\n",
" else:\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "a8861a91",
"metadata": {},
"outputs": [],
"source": [
"#Use append function in the list\n",
"#Use the extend & insert fucntions in the list\n",
"#Observe the difference in the outputs afterwards"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "e68fd552",
"metadata": {},
"outputs": [],
"source": [
"#Populate a list with the squares of the numbers between 1-12."
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "6c4f9e2b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list_of_squares = []\n",
"for i in range(1,13):\n",
" list_of_squares.append(i*i)\n",
"\n",
"list_of_squares"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13c41cec",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list_of_sq = [x*x for x in range(1,13)] #List Comprehension\n",
"list_of_sq"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "c7a64b35",
"metadata": {},
"outputs": [],
"source": [
"#Use the sort(), remove(), pop() functions in the list of squares \n",
"# that You have created."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fb06c887",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading