M2 - Python Fundamentals

 

Screenshot of Successful Script Result

Description of Script

The screenshot displays the successful results of my Python script execution. The output includes:

1. Printing Last Name:
  • The name "Klinkhamer" is printed as the last name from the list of names.
2. Dice Game Results:
  • The results of a simulated dice game for multiple players. Each player's roll result is displayed along with whether they won, tied, or lost. For example:
    • Tom rolls a 0 out of 6 and loses.
    • Phillip rolls a 13 out of 14 and wins.
    • Mary rolls a 4 out of 8 and gets a tie.
3. Random Integer List Generation:
  • A list of 20 randomly generated integers between 0 and 10 is shown: 
    • [7, 1, 6, 3, 1, 9, 0, 10, 0, 0, 9, 10, 8, 9, 10, 8, 8, 6, 0, 2, 6]
4. Removing an Unlucky Number:
  • The unlucky number 3 is identified and removed from the list.
  • The list after removing the unlucky number 3 is updated and displayed: 
    • [7, 1, 6, 1, 9, 0, 10, 0, 0, 9, 10, 8, 9, 10, 8, 8, 6, 0, 2, 6]
This output demonstrates the successful completion of all tasks the lab assignment requires.

Flowchart of Script

Printing Last Name Flowchart

Dice Game Flowchart

Random Integer List Generator Flowchart



Removing an Unlucky Number

Process Summary Notes

For step 3, where we’re required to write an if statement that uses a break statement to end the section of code, I believe I could just use: while counter < 20 to break the loop instead of the if statement.

Comments

Popular posts from this blog

M1 - Python Environments & Flowcharts

GIS Map Projections

ArcGIS Pro Orientation