Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 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. "7"
  12. ]
  13. },
  14. "execution_count": 1,
  15. "metadata": {},
  16. "output_type": "execute_result"
  17. }
  18. ],
  19. "source": [
  20. "3 + 2 * 2"
  21. ]
  22. },
  23. {
  24. "cell_type": "code",
  25. "execution_count": 2,
  26. "metadata": {},
  27. "outputs": [],
  28. "source": [
  29. "name = 'Lizz'"
  30. ]
  31. },
  32. {
  33. "cell_type": "code",
  34. "execution_count": 3,
  35. "metadata": {},
  36. "outputs": [
  37. {
  38. "name": "stdout",
  39. "output_type": "stream",
  40. "text": [
  41. "Li\n"
  42. ]
  43. }
  44. ],
  45. "source": [
  46. "print(name[0:2])"
  47. ]
  48. },
  49. {
  50. "cell_type": "code",
  51. "execution_count": 4,
  52. "metadata": {},
  53. "outputs": [],
  54. "source": [
  55. "var = '01234567'"
  56. ]
  57. },
  58. {
  59. "cell_type": "code",
  60. "execution_count": 5,
  61. "metadata": {},
  62. "outputs": [
  63. {
  64. "name": "stdout",
  65. "output_type": "stream",
  66. "text": [
  67. "0246\n"
  68. ]
  69. }
  70. ],
  71. "source": [
  72. "print(var[::2])"
  73. ]
  74. },
  75. {
  76. "cell_type": "code",
  77. "execution_count": 6,
  78. "metadata": {},
  79. "outputs": [
  80. {
  81. "data": {
  82. "text/plain": [
  83. "'12'"
  84. ]
  85. },
  86. "execution_count": 6,
  87. "metadata": {},
  88. "output_type": "execute_result"
  89. }
  90. ],
  91. "source": [
  92. "'1' + '2'"
  93. ]
  94. },
  95. {
  96. "cell_type": "code",
  97. "execution_count": 7,
  98. "metadata": {},
  99. "outputs": [],
  100. "source": [
  101. "myvar ='hello'"
  102. ]
  103. },
  104. {
  105. "cell_type": "code",
  106. "execution_count": 8,
  107. "metadata": {},
  108. "outputs": [
  109. {
  110. "data": {
  111. "text/plain": [
  112. "'HELLO'"
  113. ]
  114. },
  115. "execution_count": 8,
  116. "metadata": {},
  117. "output_type": "execute_result"
  118. }
  119. ],
  120. "source": [
  121. "myvar.upper()"
  122. ]
  123. },
  124. {
  125. "cell_type": "code",
  126. "execution_count": null,
  127. "metadata": {},
  128. "outputs": [],
  129. "source": []
  130. }
  131. ],
  132. "metadata": {
  133. "kernelspec": {
  134. "display_name": "Python",
  135. "language": "python",
  136. "name": "conda-env-python-py"
  137. },
  138. "language_info": {
  139. "codemirror_mode": {
  140. "name": "ipython",
  141. "version": 3
  142. },
  143. "file_extension": ".py",
  144. "mimetype": "text/x-python",
  145. "name": "python",
  146. "nbconvert_exporter": "python",
  147. "pygments_lexer": "ipython3",
  148. "version": "3.6.7"
  149. }
  150. },
  151. "nbformat": 4,
  152. "nbformat_minor": 4
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement