Teach jenn coding with python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.6 KiB

  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "id": "76cc981d",
  6. "metadata": {},
  7. "source": [
  8. "# Wordle Master\n",
  9. "\n",
  10. "This notebook is meant ot teach you how to become a wordle master! In it we will run through various exercises in python to analyze words and do some simple analysis of the wordle dictionary and english words in general.\n",
  11. "\n",
  12. "The wordle dataset is from here: https://www.kaggle.com/bcruise/wordle-valid-words\n",
  13. "\n",
  14. "Let's get started with some python review!\n",
  15. "\n",
  16. "Strings are values which are wrapped in quotation marks, either single or double. Strings also act as lists - you can treat them as a sequence of individual characters which is really useful for analysis."
  17. ]
  18. },
  19. {
  20. "cell_type": "code",
  21. "execution_count": 1,
  22. "id": "ae40bab8",
  23. "metadata": {},
  24. "outputs": [
  25. {
  26. "name": "stdout",
  27. "output_type": "stream",
  28. "text": [
  29. "wordle\n"
  30. ]
  31. }
  32. ],
  33. "source": [
  34. "# Here is a variable called word which contains the string \"wordle\"\n",
  35. "name = \"wordle\"\n",
  36. "\n",
  37. "# You can print any value in python with the print() function\n",
  38. "print(name)"
  39. ]
  40. },
  41. {
  42. "cell_type": "code",
  43. "execution_count": 2,
  44. "id": "8accc4ba",
  45. "metadata": {
  46. "scrolled": true
  47. },
  48. "outputs": [
  49. {
  50. "name": "stdout",
  51. "output_type": "stream",
  52. "text": [
  53. "w\n"
  54. ]
  55. }
  56. ],
  57. "source": [
  58. "# Since strings are sequences we can index them to get individual letters.\n",
  59. "# Remember that indexing starts at 0\n",
  60. "first_letter = name[0]\n",
  61. "\n",
  62. "print(first_letter)"
  63. ]
  64. },
  65. {
  66. "cell_type": "markdown",
  67. "id": "18ac848a",
  68. "metadata": {},
  69. "source": [
  70. "### Exercise 1: Try and print the last letter of name using indexing"
  71. ]
  72. },
  73. {
  74. "cell_type": "code",
  75. "execution_count": null,
  76. "id": "45e2c86e",
  77. "metadata": {},
  78. "outputs": [],
  79. "source": []
  80. },
  81. {
  82. "cell_type": "markdown",
  83. "id": "e9ad82b7",
  84. "metadata": {},
  85. "source": [
  86. "## Indexing review\n",
  87. "\n",
  88. "Great job with that exercise! Indexing is a valuable tool when working with sequences and we'll be relying on it heavily in the rest of the module. "
  89. ]
  90. }
  91. ],
  92. "metadata": {
  93. "kernelspec": {
  94. "display_name": "Python 3 (ipykernel)",
  95. "language": "python",
  96. "name": "python3"
  97. },
  98. "language_info": {
  99. "codemirror_mode": {
  100. "name": "ipython",
  101. "version": 3
  102. },
  103. "file_extension": ".py",
  104. "mimetype": "text/x-python",
  105. "name": "python",
  106. "nbconvert_exporter": "python",
  107. "pygments_lexer": "ipython3",
  108. "version": "3.10.1"
  109. }
  110. },
  111. "nbformat": 4,
  112. "nbformat_minor": 5
  113. }