Screenshot of code results. |
After the line 'Marceline wins!' is a list of numbers - this is the result of the first block of code that I had written for the lab. This line of numbers was randomly generated from 1 to 10, but repeated up to 20 times. The code used is known as a loop, and it utilized a 'while' loop structure to obtain the results.
The last three lines of the results represent my final block of code. The first line explains that I'm removing "unlucky number 3" from the previous list of numbers. The next line shows that the number 3 had been removed, and the final line indicates that the number is no longer present. This was all accomplished using methods (such as the remove function) and conditional for statements.
It was a little tricky for me to put this all together... which is a bit disheartening since I did understand the readings. Clearly learning and doing are two very different things!
No comments:
Post a Comment