Lab 2 [GIS5103]: Python Fundamentals
Output from Module 2 Python script This week's lab focused on practicing with data types and fundamental constructs in the Python scripting language, including for and while loops, as well as if statements. I examined the differences between functions and methods , and I additionally learned how to work with lists, strings, and numbers in Python. The output shown above is for a Python script that performed these tasks: Step 1: Print the last element of a list containing a full name. Step 2: Display the dice rolls of a set of players and their game status (win, lose, or tie). Step 3: Create a list of 20 random numbers in the range 0 to 10. Step 4: Remove a preset number from a list. A flowchart I sketched as part of Step 4 is shown here: In this case, I have two variables that I initialize prior to entering the while loop. Within the while loop, I continue to remove the preset number from the list based on the number of times it is present in the lis