├── Python _Basic_Info2.ipynb ├── Python_Basic_Info.ipynb ├── celsius_fernite.ipynb ├── console.js ├── console22.js ├── elif_Astrological.ipynb ├── elif_BMI.ipynb ├── elif_alphabate.ipynb ├── elif_month.ipynb ├── elif_range.ipynb ├── elif_zodic.ipynb ├── if_else example_1.ipynb ├── if_else example_2.ipynb └── if_else_ example_3.ipynb /Python _Basic_Info2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 5, 6 | "id": "542f0351", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "data": { 11 | "text/plain": [ 12 | "20" 13 | ] 14 | }, 15 | "execution_count": 5, 16 | "metadata": {}, 17 | "output_type": "execute_result" 18 | } 19 | ], 20 | "source": [ 21 | "#BASIC INFO\n", 22 | "a=10 #to declare a variable\n", 23 | "b=10\n", 24 | "a+b\n" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": 6, 30 | "id": "bc3e45cb", 31 | "metadata": {}, 32 | "outputs": [ 33 | { 34 | "data": { 35 | "text/plain": [ 36 | "10" 37 | ] 38 | }, 39 | "execution_count": 6, 40 | "metadata": {}, 41 | "output_type": "execute_result" 42 | } 43 | ], 44 | "source": [ 45 | "a #find a value of a" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 7, 51 | "id": "3f0c38f3", 52 | "metadata": {}, 53 | "outputs": [ 54 | { 55 | "data": { 56 | "text/plain": [ 57 | "10" 58 | ] 59 | }, 60 | "execution_count": 7, 61 | "metadata": {}, 62 | "output_type": "execute_result" 63 | } 64 | ], 65 | "source": [ 66 | "b" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": 11, 72 | "id": "3c4378be", 73 | "metadata": {}, 74 | "outputs": [ 75 | { 76 | "data": { 77 | "text/plain": [ 78 | "'vachaSoni'" 79 | ] 80 | }, 81 | "execution_count": 11, 82 | "metadata": {}, 83 | "output_type": "execute_result" 84 | } 85 | ], 86 | "source": [ 87 | "a='vacha'#declare a string\n", 88 | "b=\"Soni\"\n", 89 | "a+b" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": 12, 95 | "id": "77448dc6", 96 | "metadata": {}, 97 | "outputs": [ 98 | { 99 | "data": { 100 | "text/plain": [ 101 | "str" 102 | ] 103 | }, 104 | "execution_count": 12, 105 | "metadata": {}, 106 | "output_type": "execute_result" 107 | } 108 | ], 109 | "source": [ 110 | "type(a) #to find a datatype" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": 14, 116 | "id": "e609b7eb", 117 | "metadata": {}, 118 | "outputs": [ 119 | { 120 | "data": { 121 | "text/plain": [ 122 | "complex" 123 | ] 124 | }, 125 | "execution_count": 14, 126 | "metadata": {}, 127 | "output_type": "execute_result" 128 | } 129 | ], 130 | "source": [ 131 | "c=1.5+7j\n", 132 | "type(c)" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 15, 138 | "id": "5da933e2", 139 | "metadata": {}, 140 | "outputs": [ 141 | { 142 | "data": { 143 | "text/plain": [ 144 | "5" 145 | ] 146 | }, 147 | "execution_count": 15, 148 | "metadata": {}, 149 | "output_type": "execute_result" 150 | } 151 | ], 152 | "source": [ 153 | "Name = \"Vacha\"\n", 154 | "len(Name) #to find a lenth of a given string" 155 | ] 156 | }, 157 | { 158 | "cell_type": "code", 159 | "execution_count": 19, 160 | "id": "30d29361", 161 | "metadata": {}, 162 | "outputs": [ 163 | { 164 | "data": { 165 | "text/plain": [ 166 | "'c'" 167 | ] 168 | }, 169 | "execution_count": 19, 170 | "metadata": {}, 171 | "output_type": "execute_result" 172 | } 173 | ], 174 | "source": [ 175 | "Name = \"Vacha\"\n", 176 | "Name[0] #to find a position of a given string\n" 177 | ] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "execution_count": 20, 182 | "id": "d4e7fe52", 183 | "metadata": {}, 184 | "outputs": [ 185 | { 186 | "data": { 187 | "text/plain": [ 188 | "'a'" 189 | ] 190 | }, 191 | "execution_count": 20, 192 | "metadata": {}, 193 | "output_type": "execute_result" 194 | } 195 | ], 196 | "source": [ 197 | "Name[-1] \n" 198 | ] 199 | }, 200 | { 201 | "cell_type": "code", 202 | "execution_count": 21, 203 | "id": "87a434e4", 204 | "metadata": {}, 205 | "outputs": [ 206 | { 207 | "data": { 208 | "text/plain": [ 209 | "'c'" 210 | ] 211 | }, 212 | "execution_count": 21, 213 | "metadata": {}, 214 | "output_type": "execute_result" 215 | } 216 | ], 217 | "source": [ 218 | "Name[2]" 219 | ] 220 | }, 221 | { 222 | "cell_type": "code", 223 | "execution_count": 24, 224 | "id": "a846c685", 225 | "metadata": {}, 226 | "outputs": [ 227 | { 228 | "data": { 229 | "text/plain": [ 230 | "'is a jupyter not'" 231 | ] 232 | }, 233 | "execution_count": 24, 234 | "metadata": {}, 235 | "output_type": "execute_result" 236 | } 237 | ], 238 | "source": [ 239 | "z=\"This is a jupyter note\"\n", 240 | "z[5:-1]" 241 | ] 242 | }, 243 | { 244 | "cell_type": "code", 245 | "execution_count": 25, 246 | "id": "331b8be4", 247 | "metadata": {}, 248 | "outputs": [ 249 | { 250 | "data": { 251 | "text/plain": [ 252 | "'This is a jupyter not'" 253 | ] 254 | }, 255 | "execution_count": 25, 256 | "metadata": {}, 257 | "output_type": "execute_result" 258 | } 259 | ], 260 | "source": [ 261 | "z[0:-1]" 262 | ] 263 | }, 264 | { 265 | "cell_type": "code", 266 | "execution_count": 26, 267 | "id": "21f941f1", 268 | "metadata": {}, 269 | "outputs": [ 270 | { 271 | "data": { 272 | "text/plain": [ 273 | "'jupyter not'" 274 | ] 275 | }, 276 | "execution_count": 26, 277 | "metadata": {}, 278 | "output_type": "execute_result" 279 | } 280 | ], 281 | "source": [ 282 | "z[10:-1]" 283 | ] 284 | }, 285 | { 286 | "cell_type": "code", 287 | "execution_count": 27, 288 | "id": "7377a6ab", 289 | "metadata": {}, 290 | "outputs": [ 291 | { 292 | "data": { 293 | "text/plain": [ 294 | "'e'" 295 | ] 296 | }, 297 | "execution_count": 27, 298 | "metadata": {}, 299 | "output_type": "execute_result" 300 | } 301 | ], 302 | "source": [ 303 | "z[-1]" 304 | ] 305 | }, 306 | { 307 | "cell_type": "code", 308 | "execution_count": 38, 309 | "id": "477dd25d", 310 | "metadata": {}, 311 | "outputs": [ 312 | { 313 | "data": { 314 | "text/plain": [ 315 | "'Ti saj'" 316 | ] 317 | }, 318 | "execution_count": 38, 319 | "metadata": {}, 320 | "output_type": "execute_result" 321 | } 322 | ], 323 | "source": [ 324 | "z[0:11:2]" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": 39, 330 | "id": "0ed80305", 331 | "metadata": {}, 332 | "outputs": [ 333 | { 334 | "data": { 335 | "text/plain": [ 336 | "'Ti sajptrnt'" 337 | ] 338 | }, 339 | "execution_count": 39, 340 | "metadata": {}, 341 | "output_type": "execute_result" 342 | } 343 | ], 344 | "source": [ 345 | "z[0:-1:2]" 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": 40, 351 | "id": "8d5da8ef", 352 | "metadata": {}, 353 | "outputs": [ 354 | { 355 | "data": { 356 | "text/plain": [ 357 | "True" 358 | ] 359 | }, 360 | "execution_count": 40, 361 | "metadata": {}, 362 | "output_type": "execute_result" 363 | } 364 | ], 365 | "source": [ 366 | "1<2 #conditional\n" 367 | ] 368 | }, 369 | { 370 | "cell_type": "code", 371 | "execution_count": 41, 372 | "id": "f5f53128", 373 | "metadata": {}, 374 | "outputs": [ 375 | { 376 | "data": { 377 | "text/plain": [ 378 | "False" 379 | ] 380 | }, 381 | "execution_count": 41, 382 | "metadata": {}, 383 | "output_type": "execute_result" 384 | } 385 | ], 386 | "source": [ 387 | "1>2" 388 | ] 389 | }, 390 | { 391 | "cell_type": "code", 392 | "execution_count": 42, 393 | "id": "9821eb5a", 394 | "metadata": {}, 395 | "outputs": [ 396 | { 397 | "name": "stdout", 398 | "output_type": "stream", 399 | "text": [ 400 | "Hello! This is a jupyter Note\n" 401 | ] 402 | } 403 | ], 404 | "source": [ 405 | "print(\"Hello! This is a jupyter Note\") #to print any sentence" 406 | ] 407 | }, 408 | { 409 | "cell_type": "code", 410 | "execution_count": 43, 411 | "id": "6e170ab7", 412 | "metadata": {}, 413 | "outputs": [ 414 | { 415 | "name": "stdout", 416 | "output_type": "stream", 417 | "text": [ 418 | "Hello! This is a jupyter Note\n" 419 | ] 420 | } 421 | ], 422 | "source": [ 423 | "a=\"This is a jupyter Note\"\n", 424 | "print(\"Hello!\",a)\n" 425 | ] 426 | }, 427 | { 428 | "cell_type": "code", 429 | "execution_count": 47, 430 | "id": "75d73b86", 431 | "metadata": {}, 432 | "outputs": [ 433 | { 434 | "name": "stdout", 435 | "output_type": "stream", 436 | "text": [ 437 | "1\n", 438 | "2\n" 439 | ] 440 | }, 441 | { 442 | "data": { 443 | "text/plain": [ 444 | "int" 445 | ] 446 | }, 447 | "execution_count": 47, 448 | "metadata": {}, 449 | "output_type": "execute_result" 450 | } 451 | ], 452 | "source": [ 453 | "a=int(input()) #user defined input\n", 454 | "b=int(input())\n", 455 | "type(a)" 456 | ] 457 | }, 458 | { 459 | "cell_type": "code", 460 | "execution_count": 49, 461 | "id": "083d546b", 462 | "metadata": {}, 463 | "outputs": [ 464 | { 465 | "name": "stdout", 466 | "output_type": "stream", 467 | "text": [ 468 | "Enter NameVacha Soni\n", 469 | "Name: Vacha Soni\n" 470 | ] 471 | } 472 | ], 473 | "source": [ 474 | "a = input(\"Enter Name\") #for string\n", 475 | "print(\"Name:\",a)" 476 | ] 477 | }, 478 | { 479 | "cell_type": "code", 480 | "execution_count": null, 481 | "id": "79ed5120", 482 | "metadata": {}, 483 | "outputs": [], 484 | "source": [] 485 | } 486 | ], 487 | "metadata": { 488 | "kernelspec": { 489 | "display_name": "Python 3 (ipykernel)", 490 | "language": "python", 491 | "name": "python3" 492 | }, 493 | "language_info": { 494 | "codemirror_mode": { 495 | "name": "ipython", 496 | "version": 3 497 | }, 498 | "file_extension": ".py", 499 | "mimetype": "text/x-python", 500 | "name": "python", 501 | "nbconvert_exporter": "python", 502 | "pygments_lexer": "ipython3", 503 | "version": "3.11.4" 504 | } 505 | }, 506 | "nbformat": 4, 507 | "nbformat_minor": 5 508 | } 509 | -------------------------------------------------------------------------------- /Python_Basic_Info.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "542f0351", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "data": { 11 | "text/plain": [ 12 | "20" 13 | ] 14 | }, 15 | "execution_count": 1, 16 | "metadata": {}, 17 | "output_type": "execute_result" 18 | } 19 | ], 20 | "source": [ 21 | "a=10\n", 22 | "b=10\n", 23 | "a+b" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 4, 29 | "id": "bc3e45cb", 30 | "metadata": {}, 31 | "outputs": [ 32 | { 33 | "name": "stdout", 34 | "output_type": "stream", 35 | "text": [ 36 | "false\n" 37 | ] 38 | } 39 | ], 40 | "source": [ 41 | "a='vacha'\n", 42 | "if a=='soni':\n", 43 | " print(\"true\")\n", 44 | "else:\n", 45 | " print(\"false\")" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "id": "f233dcec", 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [] 55 | } 56 | ], 57 | "metadata": { 58 | "kernelspec": { 59 | "display_name": "Python 3 (ipykernel)", 60 | "language": "python", 61 | "name": "python3" 62 | }, 63 | "language_info": { 64 | "codemirror_mode": { 65 | "name": "ipython", 66 | "version": 3 67 | }, 68 | "file_extension": ".py", 69 | "mimetype": "text/x-python", 70 | "name": "python", 71 | "nbconvert_exporter": "python", 72 | "pygments_lexer": "ipython3", 73 | "version": "3.11.4" 74 | } 75 | }, 76 | "nbformat": 4, 77 | "nbformat_minor": 5 78 | } 79 | -------------------------------------------------------------------------------- /celsius_fernite.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 5, 6 | "id": "28a44d03", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter the value in fahrenheit:56\n", 14 | "Celsius: 13.333333333333334\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "#Fahrenheit to Celsius \n", 20 | "F = float(input(\"Enter the value in fahrenheit:\"))\n", 21 | "c= (F-32)*5/9\n", 22 | "print(\"Celsius:\",c)" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 6, 28 | "id": "847d59dd", 29 | "metadata": {}, 30 | "outputs": [ 31 | { 32 | "name": "stdout", 33 | "output_type": "stream", 34 | "text": [ 35 | "Enter the value in celsius:23\n", 36 | "Fahrenheit 73.4\n" 37 | ] 38 | } 39 | ], 40 | "source": [ 41 | "#Celsius to Fahrenheit\n", 42 | "c = float(input(\"Enter the value in celsius:\"))\n", 43 | "F = c * (9/5) + 32\n", 44 | "print(\"Fahrenheit\",F)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "d7de80c6", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "7db6b1a6", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "27c65413", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": null, 74 | "id": "49a7d9c9", 75 | "metadata": {}, 76 | "outputs": [], 77 | "source": [] 78 | } 79 | ], 80 | "metadata": { 81 | "kernelspec": { 82 | "display_name": "Python 3 (ipykernel)", 83 | "language": "python", 84 | "name": "python3" 85 | }, 86 | "language_info": { 87 | "codemirror_mode": { 88 | "name": "ipython", 89 | "version": 3 90 | }, 91 | "file_extension": ".py", 92 | "mimetype": "text/x-python", 93 | "name": "python", 94 | "nbconvert_exporter": "python", 95 | "pygments_lexer": "ipython3", 96 | "version": "3.11.4" 97 | } 98 | }, 99 | "nbformat": 4, 100 | "nbformat_minor": 5 101 | } 102 | -------------------------------------------------------------------------------- /console.js: -------------------------------------------------------------------------------- 1 | console.log("jalpa") 2 | -------------------------------------------------------------------------------- /console22.js: -------------------------------------------------------------------------------- 1 | console.js("desai") 2 | -------------------------------------------------------------------------------- /elif_Astrological.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "00e7fd62", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter Date:14\n", 14 | "Enter Month:October\n", 15 | "Enter Year2003\n", 16 | "Birth Date: October 14 , 2003\n", 17 | "Libra\n" 18 | ] 19 | } 20 | ], 21 | "source": [ 22 | "#to diaplay astrological sign to given date of birth \n", 23 | "Date=int(input(\"Enter Date:\"))\n", 24 | "Month =input(\"Enter Month:\")\n", 25 | "Year=int(input(\"Enter Year\"))\n", 26 | "print(\"Birth Date:\",Month,Date,',',Year)\n", 27 | "if Month in ('March 21 to April 19'):\n", 28 | " print(\"Aries\")\n", 29 | "elif Month in ('April 20 to May 20'):\n", 30 | " print(\"Taurus\")\n", 31 | "elif Month in ('May 21 to June 20'):\n", 32 | " print(\"Gemini\")\n", 33 | "elif Month in ('June 21 to july 22'):\n", 34 | " print(\"Cancer\") \n", 35 | "elif Month in ('July 23 to August 22'):\n", 36 | " print(\"Leo\")\n", 37 | "elif Month in ('August 23 to September 22'):\n", 38 | " print(\"Virgo\")\n", 39 | "elif Month in ('September 23 to October 22'):\n", 40 | " print(\"Libra\")\n", 41 | "elif Month in ('October 23 to November 21'):\n", 42 | " print(\"Scorpio\") \n", 43 | "elif Month in ('November 22 to December 21'):\n", 44 | " print(\"Sagittarius\")\n", 45 | "elif Month in ('December 22 to January 19'):\n", 46 | " print(\"Capricorn\")\n", 47 | "elif Month in ('January 20 to Feb 18'):\n", 48 | " print(\"Aquarius\") \n", 49 | "elif Month in ('Feb 19 to March 20'):\n", 50 | " print(\"Pisces\") \n", 51 | "else:\n", 52 | " print(\"Not Valid\") " 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "29a5f911", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "bf741fbd", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": null, 74 | "id": "f413df5a", 75 | "metadata": {}, 76 | "outputs": [], 77 | "source": [] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "id": "ff5c4c11", 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "execution_count": null, 90 | "id": "68bfc83c", 91 | "metadata": {}, 92 | "outputs": [], 93 | "source": [] 94 | } 95 | ], 96 | "metadata": { 97 | "kernelspec": { 98 | "display_name": "Python 3 (ipykernel)", 99 | "language": "python", 100 | "name": "python3" 101 | }, 102 | "language_info": { 103 | "codemirror_mode": { 104 | "name": "ipython", 105 | "version": 3 106 | }, 107 | "file_extension": ".py", 108 | "mimetype": "text/x-python", 109 | "name": "python", 110 | "nbconvert_exporter": "python", 111 | "pygments_lexer": "ipython3", 112 | "version": "3.11.4" 113 | } 114 | }, 115 | "nbformat": 4, 116 | "nbformat_minor": 5 117 | } 118 | -------------------------------------------------------------------------------- /elif_BMI.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 9, 6 | "id": "28a44d03", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter Weight in kg:89\n", 14 | "Enter height in cm:2.4\n", 15 | "BMI: 15.45138888888889\n", 16 | "You are underweight\n" 17 | ] 18 | } 19 | ], 20 | "source": [ 21 | "#BMI(weight (kg) / [height (cm)]2 (height/100)**2) )\n", 22 | "Weight = float(input(\"Enter Weight in kg:\"))\n", 23 | "height = float(input(\"Enter height in cm:\"))\n", 24 | "BMI = Weight/(height*height) \n", 25 | "print(\"BMI:\",BMI)\n", 26 | "if BMI < 18.5:\n", 27 | " print(\"You are underweight\")\n", 28 | "elif BMI < 24.9:\n", 29 | " print(\"You are healthy\")\n", 30 | "elif BMI <29.9:\n", 31 | " print(\"You are an over weight\")\n", 32 | "else:\n", 33 | " print(\"You are obese.\")\n" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": null, 39 | "id": "847d59dd", 40 | "metadata": {}, 41 | "outputs": [], 42 | "source": [] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "id": "d7de80c6", 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": null, 55 | "id": "7db6b1a6", 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": null, 63 | "id": "27c65413", 64 | "metadata": {}, 65 | "outputs": [], 66 | "source": [] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "id": "49a7d9c9", 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [] 75 | } 76 | ], 77 | "metadata": { 78 | "kernelspec": { 79 | "display_name": "Python 3 (ipykernel)", 80 | "language": "python", 81 | "name": "python3" 82 | }, 83 | "language_info": { 84 | "codemirror_mode": { 85 | "name": "ipython", 86 | "version": 3 87 | }, 88 | "file_extension": ".py", 89 | "mimetype": "text/x-python", 90 | "name": "python", 91 | "nbconvert_exporter": "python", 92 | "pygments_lexer": "ipython3", 93 | "version": "3.11.4" 94 | } 95 | }, 96 | "nbformat": 4, 97 | "nbformat_minor": 5 98 | } 99 | -------------------------------------------------------------------------------- /elif_alphabate.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 13, 6 | "id": "28a44d03", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter Alphabate:A\n", 14 | "It is a Vowel\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "#to check alphabate is vowel or constant\n", 20 | "a=input(\"Enter Alphabate:\")\n", 21 | "if a in (\"a\",\"e\",\"i\",\"o\",\"u\"):\n", 22 | " print(\"It is a Vowel\")\n", 23 | "elif a in(\"A\",\"E\",\"I\",\"O\",\"U\"):\n", 24 | " print(\"It is a Vowel\")\n", 25 | "else:\n", 26 | " print(\"It is a Constant\")\n", 27 | " " 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "id": "847d59dd", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "id": "d7de80c6", 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": null, 49 | "id": "7db6b1a6", 50 | "metadata": {}, 51 | "outputs": [], 52 | "source": [] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": null, 57 | "id": "27c65413", 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": null, 65 | "id": "49a7d9c9", 66 | "metadata": {}, 67 | "outputs": [], 68 | "source": [] 69 | } 70 | ], 71 | "metadata": { 72 | "kernelspec": { 73 | "display_name": "Python 3 (ipykernel)", 74 | "language": "python", 75 | "name": "python3" 76 | }, 77 | "language_info": { 78 | "codemirror_mode": { 79 | "name": "ipython", 80 | "version": 3 81 | }, 82 | "file_extension": ".py", 83 | "mimetype": "text/x-python", 84 | "name": "python", 85 | "nbconvert_exporter": "python", 86 | "pygments_lexer": "ipython3", 87 | "version": "3.11.4" 88 | } 89 | }, 90 | "nbformat": 4, 91 | "nbformat_minor": 5 92 | } 93 | -------------------------------------------------------------------------------- /elif_month.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 11, 6 | "id": "28a44d03", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter month name:June\n", 14 | "30 days\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "#find which month has 30/31/28 days\n", 20 | "Month = str(input(\"Enter month name:\"))\n", 21 | "if Month in (\"January\",\"March\",\"May\",\"July\",\"August\",\"October\",\"December\"):\n", 22 | " print(\"31 days\")\n", 23 | "elif Month in(\"April\",\"June\",\"September\",\"November\"):\n", 24 | " print(\"30 days\")\n", 25 | "elif Month ==\"February\":\n", 26 | " print(\"28 days\")\n", 27 | "else:\n", 28 | " print(\"None\")" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": null, 34 | "id": "847d59dd", 35 | "metadata": {}, 36 | "outputs": [], 37 | "source": [] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "id": "d7de80c6", 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "id": "7db6b1a6", 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "id": "27c65413", 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "49a7d9c9", 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [] 70 | } 71 | ], 72 | "metadata": { 73 | "kernelspec": { 74 | "display_name": "Python 3 (ipykernel)", 75 | "language": "python", 76 | "name": "python3" 77 | }, 78 | "language_info": { 79 | "codemirror_mode": { 80 | "name": "ipython", 81 | "version": 3 82 | }, 83 | "file_extension": ".py", 84 | "mimetype": "text/x-python", 85 | "name": "python", 86 | "nbconvert_exporter": "python", 87 | "pygments_lexer": "ipython3", 88 | "version": "3.11.4" 89 | } 90 | }, 91 | "nbformat": 4, 92 | "nbformat_minor": 5 93 | } 94 | -------------------------------------------------------------------------------- /elif_range.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 12, 6 | "id": "28a44d03", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter Number:999\n", 14 | "Number is between 900 to 1000\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "Num=int(input(\"Enter Number:\"))\n", 20 | "if Num<=100:\n", 21 | " print(\"Number is between 1 to 100\")\n", 22 | "elif Num<=200:\n", 23 | " print(\"Number is between 100 to 200\")\n", 24 | "elif Num<=300:\n", 25 | " print(\"Number is between 200 to 300\") \n", 26 | "elif Num<=400:\n", 27 | " print(\"Number is between 300 to 400\")\n", 28 | "elif Num<=500:\n", 29 | " print(\"Number is between 400 to 500\")\n", 30 | "elif Num<=600:\n", 31 | " print(\"Number is between 500 to 600\")\n", 32 | "elif Num<=700:\n", 33 | " print(\"Number is between 600 to 700\")\n", 34 | "elif Num<=800:\n", 35 | " print(\"Number is between 700 to 800\") \n", 36 | "elif Num<=900:\n", 37 | " print(\"Number is between 800 to 900\") \n", 38 | "elif Num<=1000:\n", 39 | " print(\"Number is between 900 to 1000\")\n", 40 | "else:\n", 41 | " print(\"Out of range\")" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "id": "847d59dd", 48 | "metadata": {}, 49 | "outputs": [], 50 | "source": [] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": null, 55 | "id": "d7de80c6", 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": null, 63 | "id": "7db6b1a6", 64 | "metadata": {}, 65 | "outputs": [], 66 | "source": [] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "id": "27c65413", 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "id": "49a7d9c9", 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [] 83 | } 84 | ], 85 | "metadata": { 86 | "kernelspec": { 87 | "display_name": "Python 3 (ipykernel)", 88 | "language": "python", 89 | "name": "python3" 90 | }, 91 | "language_info": { 92 | "codemirror_mode": { 93 | "name": "ipython", 94 | "version": 3 95 | }, 96 | "file_extension": ".py", 97 | "mimetype": "text/x-python", 98 | "name": "python", 99 | "nbconvert_exporter": "python", 100 | "pygments_lexer": "ipython3", 101 | "version": "3.11.4" 102 | } 103 | }, 104 | "nbformat": 4, 105 | "nbformat_minor": 5 106 | } 107 | -------------------------------------------------------------------------------- /elif_zodic.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "00e7fd62", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "\n", 11 | "\n" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 4, 17 | "id": "29a5f911", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "name": "stdout", 22 | "output_type": "stream", 23 | "text": [ 24 | "Enter your birth Year:1921\n", 25 | "ROOSTER\n" 26 | ] 27 | } 28 | ], 29 | "source": [ 30 | "\n", 31 | "#to diaplay sign of the chinese zodic for given year in which you where born\n", 32 | "Year = int(input(\"Enter your birth Year:\"))\n", 33 | "if Year % 12 ==0 :\n", 34 | " print(\"MONKEY\")\n", 35 | "elif Year % 12 ==1 :\n", 36 | " print(\"ROOSTER\") \n", 37 | "elif Year % 12 == 2 :\n", 38 | " print(\"DOG\")\n", 39 | "elif Year % 12 == 3 :\n", 40 | " print(\"PIG\")\n", 41 | "elif Year % 12 == 4:\n", 42 | " print(\"RAT\")\n", 43 | "elif Year % 12 == 5:\n", 44 | " print(\"OX\")\n", 45 | "elif Year % 12 == 6:\n", 46 | " print(\"TIGER\")\n", 47 | "elif Year % 12 == 7:\n", 48 | " print(\"RABBIT\")\n", 49 | "elif Year % 12 == 8:\n", 50 | " print(\"DRAGON\")\n", 51 | "elif Year % 12 == 9:\n", 52 | " print(\"SNAKE\") \n", 53 | "elif Year % 12 == 10:\n", 54 | " print(\"HORSE\") \n", 55 | "elif Year % 12 ==11 :\n", 56 | " print(\"SHEEP\") \n", 57 | "else:\n", 58 | " print(\"Not Found\")" 59 | ] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "id": "bf741fbd", 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "id": "f413df5a", 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": null, 80 | "id": "ff5c4c11", 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [] 84 | }, 85 | { 86 | "cell_type": "code", 87 | "execution_count": null, 88 | "id": "68bfc83c", 89 | "metadata": {}, 90 | "outputs": [], 91 | "source": [] 92 | } 93 | ], 94 | "metadata": { 95 | "kernelspec": { 96 | "display_name": "Python 3 (ipykernel)", 97 | "language": "python", 98 | "name": "python3" 99 | }, 100 | "language_info": { 101 | "codemirror_mode": { 102 | "name": "ipython", 103 | "version": 3 104 | }, 105 | "file_extension": ".py", 106 | "mimetype": "text/x-python", 107 | "name": "python", 108 | "nbconvert_exporter": "python", 109 | "pygments_lexer": "ipython3", 110 | "version": "3.11.4" 111 | } 112 | }, 113 | "nbformat": 4, 114 | "nbformat_minor": 5 115 | } 116 | -------------------------------------------------------------------------------- /if_else example_1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "738838bf", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter string:vacha\n", 14 | "Enter string:soni\n", 15 | "a is greater\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "#FIND THE GREATEST LENGTH OF THE STRING\n", 21 | "a = input(\"Enter string:\")\n", 22 | "b = input(\"Enter string:\")\n", 23 | "if len(a)>len(b):\n", 24 | " print(\"a is greater\")\n", 25 | "else:\n", 26 | " print(\"b is not greater\")" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 2, 32 | "id": "fc3e8bc9", 33 | "metadata": {}, 34 | "outputs": [ 35 | { 36 | "name": "stdout", 37 | "output_type": "stream", 38 | "text": [ 39 | "Enter Number:1\n", 40 | "Enter Number:4\n", 41 | "num2 4\n" 42 | ] 43 | } 44 | ], 45 | "source": [ 46 | "#FIND THE SMALLER NUMBER\n", 47 | "num1 = input(\"Enter Number:\")\n", 48 | "num2 = input(\"Enter Number:\")\n", 49 | "if num10:\n", 74 | " print(\"Number is positive:\",n)\n", 75 | "else:\n", 76 | " print(\"Number is negetive:\",n)" 77 | ] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "id": "7daaafc4", 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "execution_count": null, 90 | "id": "ac3c1286", 91 | "metadata": {}, 92 | "outputs": [], 93 | "source": [] 94 | } 95 | ], 96 | "metadata": { 97 | "kernelspec": { 98 | "display_name": "Python 3 (ipykernel)", 99 | "language": "python", 100 | "name": "python3" 101 | }, 102 | "language_info": { 103 | "codemirror_mode": { 104 | "name": "ipython", 105 | "version": 3 106 | }, 107 | "file_extension": ".py", 108 | "mimetype": "text/x-python", 109 | "name": "python", 110 | "nbconvert_exporter": "python", 111 | "pygments_lexer": "ipython3", 112 | "version": "3.11.4" 113 | } 114 | }, 115 | "nbformat": 4, 116 | "nbformat_minor": 5 117 | } 118 | -------------------------------------------------------------------------------- /if_else example_2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "2c1a69e2", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "#number is divisible by 3 or not " 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 11, 16 | "id": "c381d284", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "Enter number:5\n", 24 | "Not divisible by 3\n" 25 | ] 26 | } 27 | ], 28 | "source": [ 29 | "num = int(input(\"Enter number:\"))\n", 30 | "if num % 3 == 0:\n", 31 | " print(\"Divisible by 3\")\n", 32 | "else:\n", 33 | " print(\"Not divisible by 3\")" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 16, 39 | "id": "e00a7f1c", 40 | "metadata": {}, 41 | "outputs": [ 42 | { 43 | "name": "stdout", 44 | "output_type": "stream", 45 | "text": [ 46 | "Enter Number15\n", 47 | "Divisible by both\n" 48 | ] 49 | } 50 | ], 51 | "source": [ 52 | "#number is divisible by 3 and also 5, only 3 ,only 5, 3 or 5\n", 53 | "num = int(input(\"Enter Number\"))\n", 54 | "if num % 3==0:\n", 55 | " if num%5==0:\n", 56 | " print(\"Divisible by both\")\n", 57 | " else:\n", 58 | " print(\"Divisible by 3\")\n", 59 | "else:\n", 60 | " if num % 5==0:\n", 61 | " print(\"Divisible by 5\")\n", 62 | " else:\n", 63 | " print(\"Not Divisible\")" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": 17, 69 | "id": "10b5d3ea", 70 | "metadata": {}, 71 | "outputs": [ 72 | { 73 | "name": "stdout", 74 | "output_type": "stream", 75 | "text": [ 76 | "Enter Number24\n", 77 | "EVEN number\n" 78 | ] 79 | } 80 | ], 81 | "source": [ 82 | "#find num is even or odd\n", 83 | "num = int(input(\"Enter Number\"))\n", 84 | "if num % 2==0:\n", 85 | " print(\"EVEN number\")\n", 86 | "else:\n", 87 | " print(\"ODD number\")\n", 88 | " " 89 | ] 90 | }, 91 | { 92 | "cell_type": "code", 93 | "execution_count": 20, 94 | "id": "7435cf87", 95 | "metadata": {}, 96 | "outputs": [ 97 | { 98 | "name": "stdout", 99 | "output_type": "stream", 100 | "text": [ 101 | "Enter String:Vacha\n", 102 | "Enter String:Abcd\n", 103 | "NOT SAME\n" 104 | ] 105 | } 106 | ], 107 | "source": [ 108 | "# find 1st letter of the string is same or not\n", 109 | "a=str(input(\"Enter String:\"))\n", 110 | "b=str(input(\"Enter String:\"))\n", 111 | "if a[0]==b[0]:\n", 112 | " print(\" 1st letter SAME\")\n", 113 | "else:\n", 114 | " print(\"NOT SAME\")\n" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "id": "d5b77413", 121 | "metadata": {}, 122 | "outputs": [], 123 | "source": [] 124 | } 125 | ], 126 | "metadata": { 127 | "kernelspec": { 128 | "display_name": "Python 3 (ipykernel)", 129 | "language": "python", 130 | "name": "python3" 131 | }, 132 | "language_info": { 133 | "codemirror_mode": { 134 | "name": "ipython", 135 | "version": 3 136 | }, 137 | "file_extension": ".py", 138 | "mimetype": "text/x-python", 139 | "name": "python", 140 | "nbconvert_exporter": "python", 141 | "pygments_lexer": "ipython3", 142 | "version": "3.11.4" 143 | } 144 | }, 145 | "nbformat": 4, 146 | "nbformat_minor": 5 147 | } 148 | -------------------------------------------------------------------------------- /if_else_ example_3.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 4, 6 | "id": "28a44d03", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter Mark of Data_Structure:67\n", 14 | "Enter Mark of Networks:45\n", 15 | "Enter Mark of Hacking:87\n", 16 | "Total Marks: 199\n", 17 | "Percentage: 66.33333333333333\n", 18 | "Third Class\n" 19 | ] 20 | } 21 | ], 22 | "source": [ 23 | "#find the student class according to their marks (Here there are multiple condition that's why used elif)\n", 24 | "Data_Structure=int(input(\"Enter Mark of Data_Structure:\"))\n", 25 | "Networks=int(input(\"Enter Mark of Networks:\"))\n", 26 | "Hacking=int(input(\"Enter Mark of Hacking:\"))\n", 27 | "Total=Data_Structure+Networks+Hacking\n", 28 | "per=(Total/300)*100\n", 29 | "print(\"Total Marks:\",Total)\n", 30 | "print(\"Percentage:\",per)\n", 31 | "if per<50:\n", 32 | " print(\"Fail\")\n", 33 | "elif per<70:\n", 34 | " print(\"Third Class\")\n", 35 | "elif per< 80:\n", 36 | " print(\"Second Class\")\n", 37 | "else:\n", 38 | " print(\"Distinction\")" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "id": "847d59dd", 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": null, 52 | "id": "d7de80c6", 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": null, 60 | "id": "7db6b1a6", 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": null, 68 | "id": "27c65413", 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "id": "49a7d9c9", 77 | "metadata": {}, 78 | "outputs": [], 79 | "source": [] 80 | } 81 | ], 82 | "metadata": { 83 | "kernelspec": { 84 | "display_name": "Python 3 (ipykernel)", 85 | "language": "python", 86 | "name": "python3" 87 | }, 88 | "language_info": { 89 | "codemirror_mode": { 90 | "name": "ipython", 91 | "version": 3 92 | }, 93 | "file_extension": ".py", 94 | "mimetype": "text/x-python", 95 | "name": "python", 96 | "nbconvert_exporter": "python", 97 | "pygments_lexer": "ipython3", 98 | "version": "3.11.4" 99 | } 100 | }, 101 | "nbformat": 4, 102 | "nbformat_minor": 5 103 | } 104 | --------------------------------------------------------------------------------