Skip to main content

Command Palette

Search for a command to run...

Project 3 - Rock, Paper, Scissors game in Python

Updated
1 min readView as Markdown

Project -3

Link to see the code:

https://youtu.be/uA7pUPsqBJU

Problems that I encountered

  1. How to make a random pick from computers side using random library

     options = ["rock" , "paper" , "scissors"]
     #  0        1           2     
    
     solution:
     random_numbers  = random.randint(0,2)
     #rock : 0 , paper:1, scissors: 2
    

Functions that I have used

  1. random library: It is used to generate random numbers.

  2. list: syntax: ["ele1","ele2","ele3"]

  3. if else condition

  4. random.randint(start,end) function to generate random number in between the starting and ending number.

  5. print() and input() functions

What I learned

  1. How to use indexing to make choice for computers.

  2. indexing of a list.

  3. Use of 'elif' syntax instead of using the if else syntax.

More from this blog

Let see

16 posts