Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 37,
  6. "metadata": {},
  7. "outputs": [
  8. {
  9. "name": "stdout",
  10. "output_type": "stream",
  11. "text": [
  12. "inside final else\n",
  13. "at the end\n",
  14. "c is 10 and d is 20\n",
  15. "using or oprerator\n",
  16. "using not operator\n"
  17. ]
  18. }
  19. ],
  20. "source": [
  21. "# Condition Equal\n",
  22. "\n",
  23. "a = 5\n",
  24. "a == 6\n",
  25. "\n",
  26. "a!=6\n",
  27. "\n",
  28. "'ZA' > 'AB'\n",
  29. "\n",
  30. "#Branching\n",
  31. "\n",
  32. "age=2\n",
  33. "\n",
  34. "\n",
  35. "\n",
  36. "if age > 18:\n",
  37. "\n",
  38. " print(\"you can enter\" )\n",
  39. "\n",
  40. "if age > 10:\n",
  41. " \n",
  42. " print(\"age is greater than 10\")\n",
  43. "\n",
  44. "elif age > 15:\n",
  45. " print(\"age is greater than 15\");\n",
  46. "else:\n",
  47. " print(\"inside final else\");\n",
  48. " \n",
  49. "\n",
  50. "print(\"at the end\");\n",
  51. " \n",
  52. "#Logical Operators\n",
  53. "\n",
  54. "c =10;\n",
  55. "d=20;\n",
  56. "\n",
  57. "if (c==10) and (d==20):\n",
  58. " print(\"c is 10 and d is 20\");\n",
  59. " \n",
  60. "elif (c==10) or (d == 10):\n",
  61. " print(\"Inside else if\");\n",
  62. " \n",
  63. "if (c==10) or (d == 10):\n",
  64. " print ('using or oprerator');\n",
  65. " \n",
  66. "if not(c!=10):\n",
  67. " print(\"using not operator\");\n",
  68. "\n",
  69. "\n",
  70. "\n",
  71. "\n"
  72. ]
  73. },
  74. {
  75. "cell_type": "code",
  76. "execution_count": null,
  77. "metadata": {},
  78. "outputs": [],
  79. "source": []
  80. }
  81. ],
  82. "metadata": {
  83. "kernelspec": {
  84. "display_name": "Python",
  85. "language": "python",
  86. "name": "conda-env-python-py"
  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.6.7"
  99. }
  100. },
  101. "nbformat": 4,
  102. "nbformat_minor": 4
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement