Skip to content

syahravi/rock-paper-scissors-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Rock Paper Scissors

python-structural: 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 structural concepts such as attributes, classes and methods.

How to execute this program

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

python3 rock-paper-scissors.py

Result is

...
➢ python3 rock-paper-scissors.py
Your name? Ravi
Type [ Rock ] / [ Paper ] / [ Scissors ] or Q to quit: rock
Ravi picked rock.
Computer picked paper.
	You lost!
Type [ Rock ] / [ Paper ] / [ Scissors ] or Q to quit: q
You won 0 times.
The computer won 1 times.
Goodbye

CONCEPTS

  • game logic
  • While
  • If Else
  • Tuple list
  • 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.