@ADoctor/

Fixed Dice Rolling

Python

Original name: CrookedDotingCopyright

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import random
 
class Die():
 
    def toss(self):
        self.__side_up = random.choice(range(1,7))
 
    def get_sideup(self):
        return self.__side_up
 
def main():
 
    myDie = Die()
    print("I'm tossing the die")
    myDie.toss()
    myDie.side_up = 10
    print("The side up is",myDie.get_sideup())
 
if __name__ == "__main__":
    main()
    main()
    main()