Advertisement
Guest User

Untitled

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