| The results of my script this week: my last name, followed by the repaired game code, then jumping down to the random numbers at the last three lines. |
For part one, we had to create a string that was our name, turn it into a list, and then print out last name from the list. I stumbled a little in getting the string turned into a list that printed words rather than all the separate letters. In reviewing the book and other codes online, it didn’t dawn upon me at first that the split code was using a space to find the places to create the splits. I just thought you had to put quotation marks in the parenthesis for whatever reason. Once I realized that the space was key I was able to make it all happen quickly!
The second part including fixing a code block for a dice game. This was the hardest step for me. I immediately saw the issue with the case – Dice instead of dice. But it took me a while to understand the issue with turning dice into a string to have it print properly. I guess I learned a lot about types of objects while I read, re-read, and searched the internet for the meaning of the error message I was receiving!
Part three including writing code to randomly generate a list of 20 integers. This part was a little tedious as well, largely because I kept making dumb mistakes! I was easily able to print a list of 1 randomly generated number but had a time trying to sort out how to make 20 of them. I finally figured out that my big mistake was assigning i as the variable to cap the list, but then kept typing in a 1 in the code block later. Oh boy! I’m still a little confused as to if I have followed the instructions correctly. I have a list of numbers and I have an if/break statement in there. But the code worked just as well before I added this in. I know with coding you can get the same output by using a couple of different methods.
And finally, part four included creating conditions to find and remove a specific integer from the list we had just created. I felt most confident with part 4 as it seemed the most straightforward. This reinforced the syntax of the language in putting the thing you’re looking at (object), followed by what you want to do to it (method), and then the thing other variable involved (argument). So looking in luckyList to count the times x is there.
![]() |
| Here's a look behind the curtain at what made such a beautiful block of text above. |

