What this script covers
- import module to use random library
- randint (for randomised integers)
- 3 main functions
- Card (suit and value defined)
- Deck (organised and shuffled, suits named and range specified)
- Player (draws card – this can be adapted for different card selection styles, last card as default)
- class – (class is a set or category of things having some property or attribute in common)
- object – (object is one of instances of the class which can perform the functionalities which are defined in the class)
- self – (this method allows access to attributes and methods of the class in Python)
- __init__ – (reserved method in Python classes. It is known as a constructor in object oriented concepts. Allows the class to initialise the attributes of a class)
- range
- list (create empty and append throughout script)
- variables