python-oop: command-line program
41
lines of code.
This simple command-line program in python shows how you can build a simple a command-line program in python using OOP concepts such as attributes, classes and methods.
On the terminal, type the following command to run the program:
python3 oop-battle-win.py
Result is
...
Horee! Ravi/Vira menang!
- Object-Oriented Programming in Python
- game logic
- self, other
- init, str
- While
- import random
This code is open source. So feel free to use, modify, share, download as per your need. I do not take risk or responsibility for your errors or any commercial damage.