For the script, section or block 1 is a dice playing for loop where random numbers are "rolled" for players and the length a their name is added to the roll to print a win, lose, or tie statement. This section was provided and I just had to search for typing or code functionality errors. I created the next two blocks. Block 2 used a while loop to add 20 random integers between 0 and 10 to a list and block 3 used an if/else structure to count the occurrences of a specific number within the list and remove it. The toughest part in the while loop was figuring out how to get the loop to actually loop, not just print one integer to the list. The final section was challenging to get all the conditional statements to work in the correct way and in the correct order, especially getting all occurrences to remove at once, not one at a time.
It was exciting to see each block run correctly and then to see the whole script run correctly. I'm not a big numbers person, but I do enjoy problem solving and this lab assignment was definitely full of that. I expect most of the coding we'll do this summer will be.

No comments:
Post a Comment