Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {},
  7. "outputs": [
  8. {
  9. "data": {
  10. "text/plain": [
  11. "False"
  12. ]
  13. },
  14. "execution_count": 1,
  15. "metadata": {},
  16. "output_type": "execute_result"
  17. }
  18. ],
  19. "source": [
  20. "a=5\n",
  21. "a==6"
  22. ]
  23. },
  24. {
  25. "cell_type": "code",
  26. "execution_count": 3,
  27. "metadata": {},
  28. "outputs": [
  29. {
  30. "data": {
  31. "text/plain": [
  32. "True"
  33. ]
  34. },
  35. "execution_count": 3,
  36. "metadata": {},
  37. "output_type": "execute_result"
  38. }
  39. ],
  40. "source": [
  41. "a==5"
  42. ]
  43. },
  44. {
  45. "cell_type": "code",
  46. "execution_count": 4,
  47. "metadata": {},
  48. "outputs": [
  49. {
  50. "data": {
  51. "text/plain": [
  52. "True"
  53. ]
  54. },
  55. "execution_count": 4,
  56. "metadata": {},
  57. "output_type": "execute_result"
  58. }
  59. ],
  60. "source": [
  61. "a>=5"
  62. ]
  63. },
  64. {
  65. "cell_type": "code",
  66. "execution_count": 5,
  67. "metadata": {},
  68. "outputs": [
  69. {
  70. "data": {
  71. "text/plain": [
  72. "False"
  73. ]
  74. },
  75. "execution_count": 5,
  76. "metadata": {},
  77. "output_type": "execute_result"
  78. }
  79. ],
  80. "source": [
  81. "a!=5"
  82. ]
  83. },
  84. {
  85. "cell_type": "code",
  86. "execution_count": 1,
  87. "metadata": {},
  88. "outputs": [
  89. {
  90. "data": {
  91. "text/plain": [
  92. "False"
  93. ]
  94. },
  95. "execution_count": 1,
  96. "metadata": {},
  97. "output_type": "execute_result"
  98. }
  99. ],
  100. "source": [
  101. "'abcde'=='faghc'"
  102. ]
  103. },
  104. {
  105. "cell_type": "code",
  106. "execution_count": 4,
  107. "metadata": {},
  108. "outputs": [
  109. {
  110. "data": {
  111. "text/plain": [
  112. "False"
  113. ]
  114. },
  115. "execution_count": 4,
  116. "metadata": {},
  117. "output_type": "execute_result"
  118. }
  119. ],
  120. "source": [
  121. "'mark'=='mike'"
  122. ]
  123. },
  124. {
  125. "cell_type": "code",
  126. "execution_count": 6,
  127. "metadata": {},
  128. "outputs": [
  129. {
  130. "data": {
  131. "text/plain": [
  132. "True"
  133. ]
  134. },
  135. "execution_count": 6,
  136. "metadata": {},
  137. "output_type": "execute_result"
  138. }
  139. ],
  140. "source": [
  141. "'mark'!='mike'"
  142. ]
  143. },
  144. {
  145. "cell_type": "code",
  146. "execution_count": 11,
  147. "metadata": {},
  148. "outputs": [
  149. {
  150. "name": "stdout",
  151. "output_type": "stream",
  152. "text": [
  153. "you can enter\n",
  154. "move on\n"
  155. ]
  156. }
  157. ],
  158. "source": [
  159. "age=19\n",
  160. "if age >18:\n",
  161. " print('you can enter')\n",
  162. "print('move on')\n"
  163. ]
  164. },
  165. {
  166. "cell_type": "code",
  167. "execution_count": 13,
  168. "metadata": {},
  169. "outputs": [
  170. {
  171. "name": "stdout",
  172. "output_type": "stream",
  173. "text": [
  174. "you can enter\n",
  175. "move on\n"
  176. ]
  177. }
  178. ],
  179. "source": [
  180. "age=19\n",
  181. "if age > 18:\n",
  182. " print('you can enter')\n",
  183. "else:\n",
  184. " print('go to meatloaf')\n",
  185. "print('move on')"
  186. ]
  187. },
  188. {
  189. "cell_type": "code",
  190. "execution_count": 17,
  191. "metadata": {},
  192. "outputs": [
  193. {
  194. "name": "stdout",
  195. "output_type": "stream",
  196. "text": [
  197. "go to pinkloyd\n",
  198. "move on\n"
  199. ]
  200. }
  201. ],
  202. "source": [
  203. "age=15\n",
  204. "if age>18:\n",
  205. " print('you can enter')\n",
  206. "elif age==18:\n",
  207. " print('go to meatloaf')\n",
  208. "else:\n",
  209. " print('go to pinkloyd')\n",
  210. "print('move on')"
  211. ]
  212. },
  213. {
  214. "cell_type": "code",
  215. "execution_count": 20,
  216. "metadata": {},
  217. "outputs": [
  218. {
  219. "name": "stdout",
  220. "output_type": "stream",
  221. "text": [
  222. "ghost student\n",
  223. "do something\n"
  224. ]
  225. }
  226. ],
  227. "source": [
  228. "graduation_year = 1980\n",
  229. "graduation_year = 1960\n",
  230. "if graduation_year>1980:\n",
  231. " print('graduation later than 1980')\n",
  232. "elif graduation_year<1973:\n",
  233. " print('ghost student')\n",
  234. "else:\n",
  235. " print('investigate')\n",
  236. "print('do something')"
  237. ]
  238. },
  239. {
  240. "cell_type": "code",
  241. "execution_count": 23,
  242. "metadata": {},
  243. "outputs": [
  244. {
  245. "name": "stdout",
  246. "output_type": "stream",
  247. "text": [
  248. "valid grad year\n",
  249. "\n",
  250. "our student\n"
  251. ]
  252. }
  253. ],
  254. "source": [
  255. "grad_year=1980\n",
  256. "if (grad_year>1979) and (grad_year<1990):\n",
  257. " print('valid grad year')\n",
  258. "print(\"\")\n",
  259. "print('our student')\n",
  260. " "
  261. ]
  262. },
  263. {
  264. "cell_type": "code",
  265. "execution_count": 26,
  266. "metadata": {},
  267. "outputs": [
  268. {
  269. "name": "stdout",
  270. "output_type": "stream",
  271. "text": [
  272. "investigate\n",
  273. "all results subject to verification\n"
  274. ]
  275. }
  276. ],
  277. "source": [
  278. "grad_year=1993\n",
  279. "if (grad_year>1979) and (grad_year<1990):\n",
  280. " print('valid grad year')\n",
  281. "elif (grad_year<=1978) and (grad_year>=1991):\n",
  282. " print('not our student')\n",
  283. "else:\n",
  284. " print('investigate')\n",
  285. "print('all results subject to verification')"
  286. ]
  287. },
  288. {
  289. "cell_type": "code",
  290. "execution_count": null,
  291. "metadata": {},
  292. "outputs": [],
  293. "source": []
  294. }
  295. ],
  296. "metadata": {
  297. "kernelspec": {
  298. "display_name": "Python 3",
  299. "language": "python",
  300. "name": "python3"
  301. },
  302. "language_info": {
  303. "codemirror_mode": {
  304. "name": "ipython",
  305. "version": 3
  306. },
  307. "file_extension": ".py",
  308. "mimetype": "text/x-python",
  309. "name": "python",
  310. "nbconvert_exporter": "python",
  311. "pygments_lexer": "ipython3",
  312. "version": "3.6.7"
  313. }
  314. },
  315. "nbformat": 4,
  316. "nbformat_minor": 4
  317. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement