Skip to content

syahravi/looping-oop.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

OOP Attack and win

python-oop: command-line program

41lines 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.

How to execute this program

On the terminal, type the following command to run the program:

python3 oop-battle-win.py

Result is

...
Horee! Ravi/Vira menang!

CONCEPTS

  • Object-Oriented Programming in Python
  • game logic
  • self, other
  • init, str
  • While
  • import random

License

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.